[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/filters filter_errors.inc filter_errors_convert_base64_decode.phpt filter_errors_user.phpt filter_errors_zlib_inflate.

2009-01-08 Thread Arnaud Le Blanc
lbarnaudThu Jan  8 17:01:58 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/filters 

filter_errors_convert_base64_decode.phpt 
filter_errors.inc 
filter_errors_user.phpt 
filter_errors_zlib_inflate.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
/php-src/main/streams   filter.c php_stream_filter_api.h 
  Log:
  MFH: Fixed error conditions handling in stream_filter_append()
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.32r2=1.58.2.6.2.15.2.33diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.32 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.33
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.32  Wed Dec 31 
11:15:45 2008
+++ php-src/ext/standard/streamsfuncs.c Thu Jan  8 17:01:58 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.32 2008/12/31 11:15:45 sebastian Exp 
$ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.33 2009/01/08 17:01:58 lbarnaud Exp $ 
*/
 
 #include php.h
 #include php_globals.h
@@ -1147,6 +1147,7 @@
long read_write = 0;
zval *filterparams = NULL;
php_stream_filter *filter = NULL;
+   int ret;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|lz, zstream,
filtername, filternamelen, read_write, 
filterparams) == FAILURE) {
@@ -1176,9 +1177,13 @@
}
 
if (append) { 
-   php_stream_filter_append(stream-readfilters, filter);
+   ret = php_stream_filter_append_ex(stream-readfilters, 
filter TSRMLS_CC);
} else {
-   php_stream_filter_prepend(stream-readfilters, filter);
+   ret = 
php_stream_filter_prepend_ex(stream-readfilters, filter TSRMLS_CC);
+   }
+   if (ret != SUCCESS) {
+   php_stream_filter_remove(filter, 1 TSRMLS_CC);
+   RETURN_FALSE;
}
}
 
@@ -1189,9 +1194,13 @@
}
 
if (append) { 
-   php_stream_filter_append(stream-writefilters, filter);
+   ret = 
php_stream_filter_append_ex(stream-writefilters, filter TSRMLS_CC);
} else {
-   php_stream_filter_prepend(stream-writefilters, 
filter);
+   ret = 
php_stream_filter_prepend_ex(stream-writefilters, filter TSRMLS_CC);
+   }
+   if (ret != SUCCESS) {
+   php_stream_filter_remove(filter, 1 TSRMLS_CC);
+   RETURN_FALSE;
}
}
 
http://cvs.php.net/viewvc.cgi/php-src/main/streams/filter.c?r1=1.17.2.3.2.10.2.3r2=1.17.2.3.2.10.2.4diff_format=u
Index: php-src/main/streams/filter.c
diff -u php-src/main/streams/filter.c:1.17.2.3.2.10.2.3 
php-src/main/streams/filter.c:1.17.2.3.2.10.2.4
--- php-src/main/streams/filter.c:1.17.2.3.2.10.2.3 Wed Dec 31 11:15:48 2008
+++ php-src/main/streams/filter.c   Thu Jan  8 17:01:58 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filter.c,v 1.17.2.3.2.10.2.3 2008/12/31 11:15:48 sebastian Exp $ */
+/* $Id: filter.c,v 1.17.2.3.2.10.2.4 2009/01/08 17:01:58 lbarnaud Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -313,7 +313,7 @@
pefree(filter, filter-is_persistent);
 }
 
-PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, 
php_stream_filter *filter TSRMLS_DC)
+PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, 
php_stream_filter *filter TSRMLS_DC)
 {
filter-next = chain-head;
filter-prev = NULL;
@@ -325,9 +325,16 @@
}
chain-head = filter;
filter-chain = chain;
+
+   return SUCCESS;
 }
 
-PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, 
php_stream_filter *filter TSRMLS_DC)
+PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, 
php_stream_filter *filter TSRMLS_DC)
+{
+   php_stream_filter_prepend_ex(chain, filter TSRMLS_CC);
+}
+
+PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, 
php_stream_filter *filter TSRMLS_DC)
 {
php_stream *stream = chain-stream;
 
@@ -349,7 +356,7 @@
php_stream_bucket *bucket;
size_t consumed = 0;
 
-   bucket = php_stream_bucket_new(stream, stream-readbuf + 
stream-readpos, stream-writepos - stream-readpos, 0, 0 TSRMLS_CC);
+   bucket = php_stream_bucket_new(stream, (char*) stream-readbuf 
+ stream-readpos, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2008-11-13 Thread Arnaud Le Blanc
lbarnaudFri Nov 14 06:00:48 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH: Fix proto line
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.30r2=1.58.2.6.2.15.2.31diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.30 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.31
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.30  Thu Nov 13 
05:47:47 2008
+++ php-src/ext/standard/streamsfuncs.c Fri Nov 14 06:00:48 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.30 2008/11/13 05:47:47 lbarnaud Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.31 2008/11/14 06:00:48 lbarnaud Exp $ 
*/
 
 #include php.h
 #include php_globals.h
@@ -1038,7 +1038,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool stream_context_get_params(resource context|resource stream)
+/* {{{ proto array stream_context_get_params(resource context|resource stream)
Get parameters of a file context */
 PHP_FUNCTION(stream_context_get_params)
 {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams stream_socket_pair.phpt

2008-11-04 Thread Arnaud Le Blanc
lbarnaudTue Nov  4 16:46:03 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/streams stream_socket_pair.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MDH: Avoids fclose() from complaining that stream_socket_pair() streams
  have not been closed
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.28r2=1.58.2.6.2.15.2.29diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.28 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.29
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.28  Tue Nov  4 
00:42:41 2008
+++ php-src/ext/standard/streamsfuncs.c Tue Nov  4 16:46:03 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.28 2008/11/04 00:42:41 lbarnaud Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.29 2008/11/04 16:46:03 lbarnaud Exp $ 
*/
 
 #include php.h
 #include php_globals.h
@@ -69,6 +69,11 @@
s1 = php_stream_sock_open_from_socket(pair[0], 0);
s2 = php_stream_sock_open_from_socket(pair[1], 0);
 
+   /* set the __exposed flag. 
+* php_stream_to_zval() does, add_next_index_resource() does not */
+   php_stream_auto_cleanup(s1);
+   php_stream_auto_cleanup(s2);
+
add_next_index_resource(return_value, php_stream_get_resource_id(s1));
add_next_index_resource(return_value, php_stream_get_resource_id(s2));
 }

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/stream_socket_pair.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/streams/stream_socket_pair.phpt
+++ php-src/ext/standard/tests/streams/stream_socket_pair.phpt
--TEST--
stream_socket_pair()
--SKIPIF--
?php
if (substr(PHP_OS, 0, 3) == 'WIN') die(skip: non windows test);
?
--FILE--
?php
$sockets = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, 0);
var_dump($sockets);
fwrite($sockets[0], bfoo);
var_dump(fread($sockets[1], strlen(bfoo)));
fclose($sockets[0]);
?
--EXPECTF--
array(2) {
  [0]=
  resource(%d) of type (stream)
  [1]=
  resource(%d) of type (stream)
}
string(3) foo



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug46024.phpt

2008-11-03 Thread Arnaud Le Blanc
lbarnaudTue Nov  4 00:42:41 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/streams bug46024.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH: Fixed bug #46024 (stream_select() doesn't return the correct number)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.27r2=1.58.2.6.2.15.2.28diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.27 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.28
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.27  Thu Oct 30 
15:53:18 2008
+++ php-src/ext/standard/streamsfuncs.c Tue Nov  4 00:42:41 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.27 2008/10/30 15:53:18 felipe Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.28 2008/11/04 00:42:41 lbarnaud Exp $ 
*/
 
 #include php.h
 #include php_globals.h
@@ -792,6 +792,12 @@
 
retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC);
if (retval  0) {
+   if (w_array != NULL) {
+   zend_hash_clean(Z_ARRVAL_P(w_array));
+   }
+   if (e_array != NULL) {
+   zend_hash_clean(Z_ARRVAL_P(e_array));
+   }
RETURN_LONG(retval);
}
}

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/bug46024.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/streams/bug46024.phpt
+++ php-src/ext/standard/tests/streams/bug46024.phpt
--TEST--
Bug #46024 stream_select() doesn't return the correct number
--SKIPIF--
?php if (!getenv('TEST_PHP_EXECUTABLE')) die(TEST_PHP_EXECUTABLE not 
defined); ?
--FILE--
?php
$php = getenv('TEST_PHP_EXECUTABLE'); 
$pipes = array();
$proc = proc_open(
$php -n -i
,array(0 = array('pipe', 'r'), 1 = array('pipe', 'w'))
,$pipes, dirname(__FILE__), array(), array('binary_pipes' = true)
);
var_dump($proc);
if (!$proc) {
exit(1);
}
$r = array($pipes[1]);
$w = array($pipes[0]);
$e = null;
$ret = stream_select($r, $w, $e, 1);
var_dump($ret === (count($r) + count($w)));
fread($pipes[0], 1);

$r = array($pipes[1]);
$w = array($pipes[0]);
$e = null;
$ret = stream_select($r, $w, $e, 1);
var_dump($ret === (count($r) + count($w)));


foreach($pipes as $pipe) {
fclose($pipe);
}
proc_terminate($proc);
if (defined('SIGKILL')) {
proc_terminate($proc, SIGKILL);
} else {
proc_terminate($proc);
}
proc_close($proc);
?
--EXPECTF--
resource(%d) of type (process)
bool(true)
bool(true)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug46426.phpt

2008-10-30 Thread Felipe Pena
felipe  Thu Oct 30 10:09:22 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/streams bug46426.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  - MFH: Fixed bug #46426 (3rd parameter offset of stream_get_contents not 
works for 0)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.24r2=1.58.2.6.2.15.2.25diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.25
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24  Sun Oct 26 
13:25:06 2008
+++ php-src/ext/standard/streamsfuncs.c Thu Oct 30 10:09:20 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.24 2008/10/26 13:25:06 felipe Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.25 2008/10/30 10:09:20 felipe Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -411,7 +411,7 @@
 
php_stream_from_zval(stream, zsrc);
 
-   if (pos  0  php_stream_seek(stream, pos, SEEK_SET)  0) {
+   if (pos = 0  php_stream_seek(stream, pos, SEEK_SET)  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to seek to 
position %ld in the stream, pos);
RETURN_FALSE;
}

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/bug46426.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/streams/bug46426.phpt
+++ php-src/ext/standard/tests/streams/bug46426.phpt
--TEST--
Bug #46426 (3rd parameter offset of stream_get_contents not works for 0)
--FILE--
?php

$tmp = tmpfile();

fwrite($tmp, 12345);

echo stream_get_contents($tmp, -1, 0);
echo \n;
echo stream_get_contents($tmp, -1, 1);
echo \n;
echo stream_get_contents($tmp, -1, 2);

@unlink($tmp);

?
--EXPECT--
12345
2345
345



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug46426.phpt

2008-10-30 Thread Hannes Magnusson
On Thu, Oct 30, 2008 at 11:09, Felipe Pena [EMAIL PROTECTED] wrote:
 felipe  Thu Oct 30 10:09:22 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/streams bug46426.phpt

  Modified files:
/php-src/ext/standard   streamsfuncs.c
  Log:
  - MFH: Fixed bug #46426 (3rd parameter offset of stream_get_contents not 
 works for 0)


 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.24r2=1.58.2.6.2.15.2.25diff_format=u
 Index: php-src/ext/standard/streamsfuncs.c
 diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24 
 php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.25
 --- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24  Sun Oct 26 
 13:25:06 2008
 +++ php-src/ext/standard/streamsfuncs.c Thu Oct 30 10:09:20 2008
 @@ -17,7 +17,7 @@
   +--+
  */

 -/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.24 2008/10/26 13:25:06 felipe Exp $ 
 */
 +/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.25 2008/10/30 10:09:20 felipe Exp $ 
 */

  #include php.h
  #include php_globals.h
 @@ -411,7 +411,7 @@

php_stream_from_zval(stream, zsrc);

 -   if (pos  0  php_stream_seek(stream, pos, SEEK_SET)  0) {
 +   if (pos = 0  php_stream_seek(stream, pos, SEEK_SET)  0) {

Isn't this a change of behavior?

Passing no 3rd argument used to mean don't seek anywhere, just keep
the position as it is, but now means seek to the start of the
stream because pos = 0 by default...

-Hannes

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug46426.phpt

2008-10-30 Thread Felipe Pena
Em Qui, 2008-10-30 às 14:35 +0100, Hannes Magnusson escreveu:
 On Thu, Oct 30, 2008 at 11:09, Felipe Pena [EMAIL PROTECTED] wrote:
  felipe  Thu Oct 30 10:09:22 2008 UTC
 
   Added files: (Branch: PHP_5_3)
 /php-src/ext/standard/tests/streams bug46426.phpt
 
   Modified files:
 /php-src/ext/standard   streamsfuncs.c
   Log:
   - MFH: Fixed bug #46426 (3rd parameter offset of stream_get_contents not 
  works for 0)
 
 
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.24r2=1.58.2.6.2.15.2.25diff_format=u
  Index: php-src/ext/standard/streamsfuncs.c
  diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24 
  php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.25
  --- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24  Sun Oct 26 
  13:25:06 2008
  +++ php-src/ext/standard/streamsfuncs.c Thu Oct 30 10:09:20 2008
  @@ -17,7 +17,7 @@
+--+
   */
 
  -/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.24 2008/10/26 13:25:06 felipe Exp 
  $ */
  +/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.25 2008/10/30 10:09:20 felipe Exp 
  $ */
 
   #include php.h
   #include php_globals.h
  @@ -411,7 +411,7 @@
 
 php_stream_from_zval(stream, zsrc);
 
  -   if (pos  0  php_stream_seek(stream, pos, SEEK_SET)  0) {
  +   if (pos = 0  php_stream_seek(stream, pos, SEEK_SET)  0) {
 
 Isn't this a change of behavior?
 
 Passing no 3rd argument used to mean don't seek anywhere, just keep
 the position as it is, but now means seek to the start of the
 stream because pos = 0 by default...
 
 -Hannes
 

Opss, you are right. Thanks for noticing that.

.phpt++

-- 
Regards,
Felipe Pena


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug46426.phpt

2008-10-30 Thread Felipe Pena
felipe  Thu Oct 30 14:34:25 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
/php-src/ext/standard/tests/streams bug46426.phpt 
  Log:
  - Fix the fix
  - Improved test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.25r2=1.58.2.6.2.15.2.26diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.25 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.26
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.25  Thu Oct 30 
10:09:20 2008
+++ php-src/ext/standard/streamsfuncs.c Thu Oct 30 14:34:25 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.25 2008/10/30 10:09:20 felipe Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.26 2008/10/30 14:34:25 felipe Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -411,7 +411,7 @@
 
php_stream_from_zval(stream, zsrc);
 
-   if (pos = 0  php_stream_seek(stream, pos, SEEK_SET)  0) {
+   if ((pos  0 || (pos == 0  ZEND_NUM_ARGS()  2))  
php_stream_seek(stream, pos, SEEK_SET)  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to seek to 
position %ld in the stream, pos);
RETURN_FALSE;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/bug46426.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/tests/streams/bug46426.phpt
diff -u php-src/ext/standard/tests/streams/bug46426.phpt:1.1.2.2 
php-src/ext/standard/tests/streams/bug46426.phpt:1.1.2.3
--- php-src/ext/standard/tests/streams/bug46426.phpt:1.1.2.2Thu Oct 30 
10:09:22 2008
+++ php-src/ext/standard/tests/streams/bug46426.phptThu Oct 30 14:34:25 2008
@@ -7,16 +7,28 @@
 
 fwrite($tmp, 12345);
 
-echo stream_get_contents($tmp, -1, 0);
+echo stream_get_contents($tmp, 2, 1);
+echo \n;
+echo stream_get_contents($tmp, -1);
 echo \n;
-echo stream_get_contents($tmp, -1, 1);
+echo stream_get_contents($tmp, -1, 0);
 echo \n;
 echo stream_get_contents($tmp, -1, 2);
+echo \n;
+echo stream_get_contents($tmp, 0, 0);
+echo \n;
+echo stream_get_contents($tmp, 1, 0);
+echo \n;
+echo stream_get_contents($tmp, -1);
 
 @unlink($tmp);
 
 ?
 --EXPECT--
+23
+45
 12345
-2345
 345
+
+1
+2345



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams stream_get_contents_001.phpt

2008-10-30 Thread Felipe Pena
felipe  Thu Oct 30 15:53:18 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/streams stream_get_contents_001.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  - Fixed memory leak when using offset out of range. (php_stream_copy_to_mem 
returns 0, but the empty string is alloced)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.26r2=1.58.2.6.2.15.2.27diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.26 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.27
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.26  Thu Oct 30 
14:34:25 2008
+++ php-src/ext/standard/streamsfuncs.c Thu Oct 30 15:53:18 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.26 2008/10/30 14:34:25 felipe Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.27 2008/10/30 15:53:18 felipe Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -416,18 +416,16 @@
RETURN_FALSE;
}
 
-   if ((len = php_stream_copy_to_mem(stream, contents, maxlen, 0))  0) {
-   
-   if (PG(magic_quotes_runtime)) {
+   len = php_stream_copy_to_mem(stream, contents, maxlen, 0);
+   
+   if (contents) {
+   if (len  PG(magic_quotes_runtime)) {
contents = php_addslashes(contents, len, newlen, 1 
TSRMLS_CC); /* 1 = free source string */
len = newlen;
}
-
RETVAL_STRINGL(contents, len, 0);
-   } else if (len == 0) {
-   RETVAL_EMPTY_STRING();
} else {
-   RETVAL_FALSE;
+   RETVAL_EMPTY_STRING();
}
 }
 /* }}} */

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/stream_get_contents_001.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/streams/stream_get_contents_001.phpt
+++ php-src/ext/standard/tests/streams/stream_get_contents_001.phpt
--TEST--
stream_get_contents() - Testing offset out of range
--FILE--
?php

$tmp = tmpfile();

fwrite($tmp, 12345);

echo stream_get_contents($tmp, 2, 5), --\n;
echo stream_get_contents($tmp, 2), --\n;
echo stream_get_contents($tmp, 2, 3), --\n;
echo stream_get_contents($tmp, 2, -1), --\n;

@unlink($tmp);

?
--EXPECT--
--
--
45--
--



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2008-10-26 Thread Felipe Pena
felipe  Sun Oct 26 13:25:06 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  - MFH: Fixed bug #46388 (stream_notification_callback inside of object 
destroys object variables)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.23r2=1.58.2.6.2.15.2.24diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.23 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.24
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.23  Tue Oct 21 
22:08:37 2008
+++ php-src/ext/standard/streamsfuncs.c Sun Oct 26 13:25:06 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.23 2008/10/21 22:08:37 lbarnaud Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.24 2008/10/26 13:25:06 felipe Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -829,12 +829,13 @@
INIT_ZVAL(zvs[i]);
ps[i] = zvs[i];
ptps[i] = ps[i];
+   MAKE_STD_ZVAL(ps[i]);
}

ZVAL_LONG(ps[0], notifycode);
ZVAL_LONG(ps[1], severity);
if (xmsg) {
-   ZVAL_STRING(ps[2], xmsg, 0);
+   ZVAL_STRING(ps[2], xmsg, 1);
} else {
ZVAL_NULL(ps[2]);
}
@@ -845,6 +846,9 @@
if (FAILURE == call_user_function_ex(EG(function_table), NULL, 
callback, retval, 6, ptps, 0, NULL TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed to call 
user notifier);
}
+   for (i = 0; i  6; i++) {
+   zval_ptr_dtor(ps[i]);
+   }
if (retval) {
zval_ptr_dtor(retval);
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2008-07-21 Thread Jani Taskinen
janiMon Jul 21 16:16:30 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH: sync
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.16r2=1.58.2.6.2.15.2.17diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.16 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.17
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.16  Fri Jul 11 
10:25:15 2008
+++ php-src/ext/standard/streamsfuncs.c Mon Jul 21 16:16:30 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.16 2008/07/11 10:25:15 tony2001 Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.17 2008/07/21 16:16:30 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -233,7 +233,9 @@
 PHP_FUNCTION(stream_socket_accept)
 {
double timeout = FG(default_socket_timeout);
-   zval *peername = NULL;
+   zval *zpeername = NULL;
+   char *peername = NULL;
+   int peername_len;
php_timeout_ull conv;
struct timeval tv;
php_stream *stream = NULL, *clistream = NULL;
@@ -241,7 +243,7 @@
 
char *errstr = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|dz, zstream, 
timeout, peername) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|dz, zstream, 
timeout, zpeername) == FAILURE) {
RETURN_FALSE;
}

@@ -252,20 +254,20 @@
tv.tv_sec = conv / 100;
tv.tv_usec = conv % 100;
 
-   if (peername) {
-   zval_dtor(peername);
-   ZVAL_NULL(peername);
+   if (zpeername) {
+   zval_dtor(zpeername);
+   ZVAL_NULL(zpeername);
}
 
if (0 == php_stream_xport_accept(stream, clistream,
-   peername ? Z_STRVAL_P(peername) : NULL,
-   peername ? Z_STRLEN_P(peername) : NULL,
+   zpeername ? peername : NULL,
+   zpeername ? peername_len : NULL,
NULL, NULL,
tv, errstr
TSRMLS_CC)  clistream) {
 
if (peername) {
-   Z_TYPE_P(peername) = IS_STRING;
+   ZVAL_STRINGL(zpeername, peername, peername_len, 0);
}
php_stream_to_zval(clistream, return_value);
} else {
@@ -286,6 +288,8 @@
php_stream *stream;
zval *zstream;
zend_bool want_peer;
+   char *name = NULL;
+   int name_len;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rb, zstream, 
want_peer) == FAILURE) {
RETURN_FALSE;
@@ -293,15 +297,15 @@

php_stream_from_zval(stream, zstream);
 
-   Z_TYPE_P(return_value) = IS_STRING;
-   
if (0 != php_stream_xport_get_name(stream, want_peer,
-   Z_STRVAL_P(return_value),
-   Z_STRLEN_P(return_value),
+   name,
+   name_len,
NULL, NULL
TSRMLS_CC)) {
RETURN_FALSE;
}
+
+   RETURN_STRINGL(name, name_len, 0);
 }
 /* }}} */
 
@@ -340,6 +344,8 @@
 {
php_stream *stream;
zval *zstream, *zremote = NULL;
+   char *remote_addr = NULL;
+   int remote_addr_len;
long to_read = 0;
char *read_buf;
long flags = 0;
@@ -354,7 +360,6 @@
if (zremote) {
zval_dtor(zremote);
ZVAL_NULL(zremote);
-   Z_STRLEN_P(zremote) = 0;
}
 
if (to_read = 0) {
@@ -365,20 +370,19 @@
read_buf = safe_emalloc(1, to_read, 1);

recvd = php_stream_xport_recvfrom(stream, read_buf, to_read, flags, 
NULL, NULL,
-   zremote ? Z_STRVAL_P(zremote) : NULL,
-   zremote ? Z_STRLEN_P(zremote) : NULL
+   zremote ? remote_addr : NULL,
+   zremote ? remote_addr_len : NULL
TSRMLS_CC);
 
if (recvd = 0) {
-   if (zremote  Z_STRLEN_P(zremote)) {
-   Z_TYPE_P(zremote) = IS_STRING;
+   if (zremote) {
+   ZVAL_STRINGL(zremote, remote_addr, remote_addr_len, 0);
}
read_buf[recvd] = '\0';
 
if (PG(magic_quotes_runtime)) {
Z_TYPE_P(return_value) = IS_STRING;
-   Z_STRVAL_P(return_value) = 
php_addslashes(Z_STRVAL_P(return_value),
-   Z_STRLEN_P(return_value), 
Z_STRLEN_P(return_value), 1 TSRMLS_CC);
+   

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2008-04-14 Thread Antony Dovgal
tony2001Mon Apr 14 07:49:00 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  fix ZTS build and sync with HEAD
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.11r2=1.58.2.6.2.15.2.12diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.11 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.12
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.11  Sun Apr 13 
22:35:27 2008
+++ php-src/ext/standard/streamsfuncs.c Mon Apr 14 07:49:00 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.11 2008/04/13 22:35:27 bjori Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.12 2008/04/14 07:49:00 tony2001 Exp $ 
*/
 
 #include php.h
 #include php_globals.h
@@ -850,7 +850,7 @@
}
 }
 
-static int parse_context_options(php_stream_context *context, zval *options)
+static int parse_context_options(php_stream_context *context, zval *options 
TSRMLS_DC)
 {
HashPosition pos, opos;
zval **wval, **oval;
@@ -874,7 +874,7 @@
}
 
} else {
-   zend_error(E_WARNING, options should have the form 
[\wrappername\][\optionname\] = $value);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, options 
should have the form [\wrappername\][\optionname\] = $value);
}
zend_hash_move_forward_ex(Z_ARRVAL_P(options), pos);
}
@@ -882,7 +882,7 @@
return ret;
 }
 
-static int parse_context_params(php_stream_context *context, zval *params)
+static int parse_context_params(php_stream_context *context, zval *params 
TSRMLS_DC)
 {
int ret = SUCCESS;
zval **tmp;
@@ -902,7 +902,7 @@
}
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), options, 
sizeof(options), (void**)tmp)) {
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
-   parse_context_options(context, *tmp);
+   parse_context_options(context, *tmp TSRMLS_CC);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
stream/context parameter);
}
@@ -988,7 +988,7 @@
 
if (options) {
/* handle the array syntax */
-   RETVAL_BOOL(parse_context_options(context, options) == SUCCESS);
+   RETVAL_BOOL(parse_context_options(context, options TSRMLS_CC) 
== SUCCESS);
} else {
php_stream_context_set_option(context, wrappername, optionname, 
zvalue);
RETVAL_TRUE;
@@ -1013,7 +1013,7 @@
RETURN_FALSE;
}
 
-   RETVAL_BOOL(parse_context_params(context, params) == SUCCESS);
+   RETVAL_BOOL(parse_context_params(context, params TSRMLS_CC) == SUCCESS);
 }
 /* }}} */
 
@@ -1034,7 +1034,7 @@
context = FG(default_context);

if (params) {
-   parse_context_options(context, params);
+   parse_context_options(context, params TSRMLS_CC);
}

php_stream_context_to_zval(context, return_value);
@@ -1055,7 +1055,7 @@
context = php_stream_context_alloc();

if (params) {
-   parse_context_options(context, params);
+   parse_context_options(context, params TSRMLS_CC);
}

php_stream_context_to_zval(context, return_value);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug44712.phpt

2008-04-13 Thread Hannes Magnusson
bjori   Sun Apr 13 22:35:27 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/streams bug44712.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  Fixed bug#44712 (stream_context_set_params segfaults on invalid arguments)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.10r2=1.58.2.6.2.15.2.11diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.10 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.11
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.10  Mon Mar 10 
22:12:36 2008
+++ php-src/ext/standard/streamsfuncs.c Sun Apr 13 22:35:27 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.10 2008/03/10 22:12:36 felipe Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.11 2008/04/13 22:35:27 bjori Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -901,7 +901,11 @@
context-notifier-dtor = user_space_stream_notifier_dtor;
}
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), options, 
sizeof(options), (void**)tmp)) {
-   parse_context_options(context, *tmp);
+   if (Z_TYPE_PP(tmp) == IS_ARRAY) {
+   parse_context_options(context, *tmp);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
stream/context parameter);
+   }
}

return ret;

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/bug44712.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/streams/bug44712.phpt
+++ php-src/ext/standard/tests/streams/bug44712.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/streams bug44712.phpt

2008-04-13 Thread Hannes Magnusson
OK if I merge to 5.2?

-Hannes

On Mon, Apr 14, 2008 at 12:35 AM, Hannes Magnusson [EMAIL PROTECTED] wrote:
 bjori   Sun Apr 13 22:35:27 2008 UTC

   Added files: (Branch: PHP_5_3)
 /php-src/ext/standard/tests/streams bug44712.phpt

   Modified files:
 /php-src/ext/standard   streamsfuncs.c
   Log:
   Fixed bug#44712 (stream_context_set_params segfaults on invalid arguments)


  
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.10r2=1.58.2.6.2.15.2.11diff_format=u
  Index: php-src/ext/standard/streamsfuncs.c
  diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.10 
 php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.11
  --- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.10  Mon Mar 10 
 22:12:36 2008
  +++ php-src/ext/standard/streamsfuncs.c Sun Apr 13 22:35:27 2008
  @@ -17,7 +17,7 @@
+--+
   */

  -/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.10 2008/03/10 22:12:36 felipe Exp 
 $ */
  +/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.11 2008/04/13 22:35:27 bjori Exp $ 
 */

   #include php.h
   #include php_globals.h
  @@ -901,7 +901,11 @@
 context-notifier-dtor = user_space_stream_notifier_dtor;
 }
 if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), options, 
 sizeof(options), (void**)tmp)) {
  -   parse_context_options(context, *tmp);
  +   if (Z_TYPE_PP(tmp) == IS_ARRAY) {
  +   parse_context_options(context, *tmp);
  +   } else {
  +   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
 stream/context parameter);
  +   }
 }

 return ret;

  
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/bug44712.phpt?view=markuprev=1.1
  Index: php-src/ext/standard/tests/streams/bug44712.phpt
  +++ php-src/ext/standard/tests/streams/bug44712.phpt



  --
  PHP CVS Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2008-02-03 Thread Ilia Alshanetsky
iliaa   Sun Feb  3 16:14:17 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  
  Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling
  encryption without crypto type)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.8r2=1.58.2.6.2.15.2.9diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.8 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.9
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.8   Mon Dec 31 
07:17:15 2007
+++ php-src/ext/standard/streamsfuncs.c Sun Feb  3 16:14:16 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.8 2007/12/31 07:17:15 sebastian Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.9 2008/02/03 16:14:16 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1328,6 +1328,9 @@
if (php_stream_xport_crypto_setup(stream, cryptokind, 
sessstream TSRMLS_CC)  0) {
RETURN_FALSE;
}
+   } else if (enable) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, When enabling 
encryption you must specify the crypto type);
+   RETURN_FALSE;
}
 
ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2007-11-23 Thread Stanislav Malyshev
stasFri Nov 23 19:48:56 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  fix proto
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.6r2=1.58.2.6.2.15.2.7diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.6 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.7
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.6   Tue Nov 20 
22:17:00 2007
+++ php-src/ext/standard/streamsfuncs.c Fri Nov 23 19:48:56 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.6 2007/11/20 22:17:00 johannes Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.7 2007/11/23 19:48:56 stas Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -389,7 +389,7 @@
 }
 /* }}} */
 
-/* {{{ proto long stream_get_contents(resource source [, long maxlen [, long 
offset]])
+/* {{{ proto string stream_get_contents(resource source [, long maxlen [, long 
offset]])
Reads all remaining bytes (or up to maxlen bytes) from a stream and returns 
them as a string. */
 PHP_FUNCTION(stream_get_contents)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c /ext/standard/tests/file bug43216.phpt

2007-11-08 Thread Dmitry Stogov
dmitry  Thu Nov  8 13:29:25 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/filebug43216.phpt 

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  Fixed bug #43216 (stream_is_local() returns false on file://)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.4r2=1.58.2.6.2.15.2.5diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.4 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.5
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.4   Wed Oct 10 
12:58:41 2007
+++ php-src/ext/standard/streamsfuncs.c Thu Nov  8 13:29:25 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.4 2007/10/10 12:58:41 jani Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.5 2007/11/08 13:29:25 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1364,7 +1364,7 @@
wrapper = stream-wrapper;
} else {
convert_to_string_ex(zstream);
-   wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), 
NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC);
+   wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), 
NULL, 0 TSRMLS_CC);
}
 
if(!wrapper) {

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug43216.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/bug43216.phpt
+++ php-src/ext/standard/tests/file/bug43216.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 12:44:46 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.2r2=1.58.2.6.2.15.2.3diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.2 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.3
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.2   Sun Oct  7 
05:22:07 2007
+++ php-src/ext/standard/streamsfuncs.c Wed Oct 10 12:44:46 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.2 2007/10/07 05:22:07 davidw Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.3 2007/10/10 12:44:46 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -608,7 +608,7 @@
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
-   int this_fd, ret = 0;
+   php_socket_t this_fd, ret = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
@@ -1399,8 +1399,8 @@
 
RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how 
TSRMLS_CC) == 0);
 }
-#endif
 /* }}} */
+#endif
 
 /*
  * Local variables:

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 12:58:42 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.3r2=1.58.2.6.2.15.2.4diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.3 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.4
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.3   Wed Oct 10 
12:44:46 2007
+++ php-src/ext/standard/streamsfuncs.c Wed Oct 10 12:58:41 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.3 2007/10/10 12:44:46 jani Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.4 2007/10/10 12:58:41 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -574,6 +574,7 @@
zval **elem;
php_stream *stream;
php_socket_t this_fd;
+   int cnt = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
@@ -598,9 +599,10 @@
if (this_fd  *max_fd) {
*max_fd = this_fd;
}
+   cnt++;
}
}
-   return 1;
+   return cnt ? 1 : 0;
 }
 
 static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
@@ -608,7 +610,8 @@
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
-   php_socket_t this_fd, ret = 0;
+   php_socket_t this_fd;
+   int ret = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php