Changeset 10065

Show
Ignore:
Timestamp:
12/01/08 17:45:11 (1 month ago)
Author:
afz
Message:

Update PEAR::Net_Socket

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jaws/html/libraries/pear/Net/Socket.php

    r10063 r10065  
    2424 * @copyright 1997-2003 The PHP Group 
    2525 * @license   http://www.php.net/license/2_02.txt PHP 2.02 
    26  * @version   CVS: $Id: Socket.php,v 1.40 2008/12/01 15:25:01 chagenbu Exp $ 
     26 * @version   CVS: $Id: Socket.php,v 1.42 2008/12/01 17:31:35 chagenbu Exp $ 
    2727 * @link      http://pear.php.net/packages/Net_Socket 
    2828 */ 
     
    313313     *         not connected. 
    314314     */ 
    315     function gets($size) 
    316     { 
    317         if (!is_resource($this->fp)) { 
    318             return $this->raiseError('not connected'); 
    319         } 
    320  
    321         return @fgets($this->fp, $size); 
     315    function gets($size = null) 
     316    { 
     317        if (!is_resource($this->fp)) { 
     318            return $this->raiseError('not connected'); 
     319        } 
     320 
     321        if (is_null($size)) { 
     322            return @fgets($this->fp); 
     323        } else { 
     324            return @fgets($this->fp, $size); 
     325        } 
    322326    } 
    323327 
     
    373377            while ($pos < $size) { 
    374378                $written = @fwrite($this->fp, substr($data, $pos, $blocksize)); 
    375                 if ($written === false) { 
    376                     return false
     379                if (!$written) { 
     380                    return $written
    377381                } 
    378382                $pos += $written;