Changeset 10064
- Timestamp:
- 12/01/08 17:45:05 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.8/jaws/html/libraries/pear/Net/Socket.php
r10062 r10064 24 24 * @copyright 1997-2003 The PHP Group 25 25 * @license http://www.php.net/license/2_02.txt PHP 2.02 26 * @version CVS: $Id: Socket.php,v 1.4 0 2008/12/01 15:25:01chagenbu Exp $26 * @version CVS: $Id: Socket.php,v 1.42 2008/12/01 17:31:35 chagenbu Exp $ 27 27 * @link http://pear.php.net/packages/Net_Socket 28 28 */ … … 313 313 * not connected. 314 314 */ 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 } 322 326 } 323 327 … … 373 377 while ($pos < $size) { 374 378 $written = @fwrite($this->fp, substr($data, $pos, $blocksize)); 375 if ( $written === false) {376 return false;379 if (!$written) { 380 return $written; 377 381 } 378 382 $pos += $written;
