[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/streams.c branches/PHP_5_4/main/streams/streams.c trunk/main/streams/streams.c
cataphract Thu, 08 Mar 2012 12:39:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=324021 Log: - Oops committed old version of the patch in r324020. Fixed. See bug #61253. Bug: https://bugs.php.net/61253 (Assigned) Wrappers opened with errors concurrency problem Changed paths: U php/php-src/branches/PHP_5_3/main/streams/streams.c U php/php-src/branches/PHP_5_4/main/streams/streams.c U php/php-src/trunk/main/streams/streams.c Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c === --- php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-03-08 12:30:59 UTC (rev 324020) +++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-03-08 12:39:48 UTC (rev 324021) @@ -201,7 +201,7 @@ err_buf_p = zend_llist_get_next_ex(err_list, &pos), i++) { strcat(msg, *err_buf_p); if (i < count - 1) { - l += brlen; + strcat(msg, br); } } Modified: php/php-src/branches/PHP_5_4/main/streams/streams.c === --- php/php-src/branches/PHP_5_4/main/streams/streams.c 2012-03-08 12:30:59 UTC (rev 324020) +++ php/php-src/branches/PHP_5_4/main/streams/streams.c 2012-03-08 12:39:48 UTC (rev 324021) @@ -210,7 +210,7 @@ err_buf_p = zend_llist_get_next_ex(err_list, &pos), i++) { strcat(msg, *err_buf_p); if (i < count - 1) { - l += brlen; + strcat(msg, br); } } Modified: php/php-src/trunk/main/streams/streams.c === --- php/php-src/trunk/main/streams/streams.c2012-03-08 12:30:59 UTC (rev 324020) +++ php/php-src/trunk/main/streams/streams.c2012-03-08 12:39:48 UTC (rev 324021) @@ -210,7 +210,7 @@ err_buf_p = zend_llist_get_next_ex(err_list, &pos), i++) { strcat(msg, *err_buf_p); if (i < count - 1) { - l += brlen; + strcat(msg, br); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/main/streams/ streams.c
cataphract Sun, 08 May 2011 19:59:42 + Revision: http://svn.php.net/viewvc?view=revision&revision=310844 Log: - Merged to 5.3 change in trunk in _php_stream_free. This prevents the segfault in the testcase for bug #53624. The testcase still has to be fixed though, because it only works as intended on Windows. Bug: http://bugs.php.net/53624 (Closed) NULL also works for $row Changed paths: U php/php-src/branches/PHP_5_3/main/streams/streams.c Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c === --- php/php-src/branches/PHP_5_3/main/streams/streams.c 2011-05-08 19:35:02 UTC (rev 310843) +++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2011-05-08 19:59:42 UTC (rev 310844) @@ -355,7 +355,12 @@ /* If not called from the resource dtor, remove the stream from the resource list. */ if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && remove_rsrc) { - zend_list_delete(stream->rsrc_id); + /* zend_list_delete actually only decreases the refcount; if we're +* releasing the stream, we want to actually delete the resource from +* the resource list, otherwise the resource will point to invalid memory. +* In any case, let's always completely delete it from the resource list, +* not only when PHP_STREAM_FREE_RELEASE_STREAM is set */ + while (zend_list_delete(stream->rsrc_id) == SUCCESS) {} } /* Remove stream from any context link list */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/streams.c trunk/main/streams/streams.c
cataphract Sun, 01 May 2011 04:16:28 + Revision: http://svn.php.net/viewvc?view=revision&revision=310682 Log: - Fixed accidental change. Changed paths: U php/php-src/branches/PHP_5_3/main/streams/streams.c U php/php-src/trunk/main/streams/streams.c Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c === --- php/php-src/branches/PHP_5_3/main/streams/streams.c 2011-05-01 03:57:01 UTC (rev 310681) +++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2011-05-01 04:16:28 UTC (rev 310682) @@ -427,7 +427,7 @@ stream->orig_path = NULL; } -# if defined(PHP_WIN32_) +# if defined(PHP_WIN32) OutputDebugString(leakinfo); # else fprintf(stderr, "%s", leakinfo); Modified: php/php-src/trunk/main/streams/streams.c === --- php/php-src/trunk/main/streams/streams.c2011-05-01 03:57:01 UTC (rev 310681) +++ php/php-src/trunk/main/streams/streams.c2011-05-01 04:16:28 UTC (rev 310682) @@ -503,7 +503,7 @@ stream->orig_path = NULL; } -# if defined(PHP_WIN32_) +# if defined(PHP_WIN32) OutputDebugString(leakinfo); # else fprintf(stderr, "%s", leakinfo); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/streams.c trunk/main/streams/streams.c
pajoye Tue, 18 May 2010 19:39:39 + Revision: http://svn.php.net/viewvc?view=revision&revision=299466 Log: - #51854, fix logic (patch by Tjerk) Bug: http://bugs.php.net/51854 (Open) stream_set_read_buffer() not working as expected Changed paths: U php/php-src/branches/PHP_5_3/main/streams/streams.c U php/php-src/trunk/main/streams/streams.c Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c === --- php/php-src/branches/PHP_5_3/main/streams/streams.c 2010-05-18 18:45:12 UTC (rev 299465) +++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2010-05-18 19:39:39 UTC (rev 299466) @@ -1186,7 +1186,7 @@ /* try to match the buffer mode as best we can */ if (value == PHP_STREAM_BUFFER_NONE) { stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - } else { + } else if (stream->flags & PHP_STREAM_FLAG_NO_BUFFER) { stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; } ret = PHP_STREAM_OPTION_RETURN_OK; Modified: php/php-src/trunk/main/streams/streams.c === --- php/php-src/trunk/main/streams/streams.c2010-05-18 18:45:12 UTC (rev 299465) +++ php/php-src/trunk/main/streams/streams.c2010-05-18 19:39:39 UTC (rev 299466) @@ -1186,7 +1186,7 @@ /* try to match the buffer mode as best we can */ if (value == PHP_STREAM_BUFFER_NONE) { stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - } else { + } else if (stream->flags & PHP_STREAM_FLAG_NO_BUFFER) { stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; } ret = PHP_STREAM_OPTION_RETURN_OK; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/main/streams/ streams.c
tony2001 Thu, 08 Apr 2010 09:56:18 + Revision: http://svn.php.net/viewvc?view=revision&revision=297689 Log: fix build Changed paths: U php/php-src/branches/PHP_5_3/main/streams/streams.c Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c === --- php/php-src/branches/PHP_5_3/main/streams/streams.c 2010-04-08 09:01:21 UTC (rev 297688) +++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2010-04-08 09:56:18 UTC (rev 297689) @@ -598,7 +598,7 @@ if (size == 0) { break; } -__debugbreak(); + if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) { toread = stream->ops->read(stream, buf, size TSRMLS_CC); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/streams.c trunk/main/streams/streams.c
pajoye Thu, 08 Apr 2010 07:55:35 + Revision: http://svn.php.net/viewvc?view=revision&revision=297684 Log: - WS Changed paths: U php/php-src/branches/PHP_5_3/main/streams/streams.c U php/php-src/trunk/main/streams/streams.c Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c === --- php/php-src/branches/PHP_5_3/main/streams/streams.c 2010-04-08 07:50:05 UTC (rev 297683) +++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2010-04-08 07:55:35 UTC (rev 297684) @@ -95,7 +95,7 @@ stream->context TSRMLS_CC); stream->context = NULL; } - + return 0; } @@ -157,7 +157,7 @@ msg[0] = '\0'; for (i = 0; i < wrapper->err_count; i++) { strcat(msg, wrapper->err_stack[i]); -if (i < wrapper->err_count - 1) { +if (i < wrapper->err_count - 1) { strcat(msg, br); } } @@ -263,7 +263,7 @@ if (FAILURE == zend_hash_update(&EG(persistent_list), (char *)persistent_id, strlen(persistent_id) + 1, (void *)&le, sizeof(le), NULL)) { - + pefree(ret, 1); return NULL; } @@ -329,7 +329,7 @@ /* make sure everything is saved */ _php_stream_flush(stream, 1 TSRMLS_CC); - + /* If not called from the resource dtor, remove the stream from the resource list. */ if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && remove_rsrc) { zend_list_delete(stream->rsrc_id); @@ -403,7 +403,7 @@ pefree(stream->orig_path, stream->is_persistent); stream->orig_path = NULL; } - + # if defined(PHP_WIN32) OutputDebugString(leakinfo); # else @@ -474,7 +474,7 @@ } else { flags = stream->eof ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC; } - + /* wind the handle... */ for (filter = stream->readfilters.head; filter; filter = filter->next) { status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags TSRMLS_CC); @@ -482,7 +482,7 @@ if (status != PSFS_PASS_ON) { break; } - + /* brig_out becomes brig_in. * brig_in will always be empty here, as the filter MUST attach any un-consumed buckets * to its own brigade */ @@ -491,7 +491,7 @@ brig_outp = brig_swap; memset(brig_outp, 0, sizeof(*brig_outp)); } - + switch (status) { case PSFS_PASS_ON: /* we get here when the last filter in the chain has data to pass on. @@ -598,7 +598,7 @@ if (size == 0) { break; } - +__debugbreak(); if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) { toread = stream->ops->read(stream, buf, size TSRMLS_CC); } else { @@ -717,7 +717,7 @@ } else { readptr = buf; avail = buf_len; - } + } /* Look for EOL */ if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { @@ -828,7 +828,7 @@ } else { /* XXX: Should be fine to always read chunk_size */ size_t toread; - + if (grow_mode) { toread = stream->chunk_size; } else { @@ -945,7 +945,7 @@ stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position TSRMLS_CC); } - + while (count > 0) { towrite = count; if (towrite > stream->chunk_size) @@ -958,7 +958,7 @@ buf += justwrote; count -= justwrote; didwrite += justwrote; - + /* Only screw with the buffer if we can seek, otherwise we lose data * buffered from fifos and sockets */ if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { @@ -1119,11 +1119,11 @@ if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { int ret; - + if (stream->writefilters.head) { _php_stream_flush(stream, 0 TSRMLS_CC); } - + switch(whence) { case SEEK_CUR: offset = stream->position + offset; @@ -1191,7 +1191,7 @@ } ret = PHP_STREAM_OPTION_RETURN_OK; break; - + default: ; } @@ -1244,7 +1244,7 @@ int min_room = CHUNK_SIZE / 4; php_stream_statbuf ssbuf; - if (maxlen == 0) { + if (maxlen == 0) { return 0; } @@ -1343,8 +1343,8 @@ php_stream_mmap_unmap_ex(src, mapped); *len = mapped; - - /* we've got at least 1 byte to read. + + /* we've got at least 1 byte to read. * less than 1 is an error */ if (mapped > 0) { @@ -1393,7 +1393,7 @@ *len = haveread; - /* we've got at least 1 byte to read. + /* we've got at least 1 byte to read. * less than 1 is an error */ if (haveread > 0 || src->eof) { @@ -1403,7 +1403,7 @@ } /* Returns the number of bytes moved. - * Returns 1 when source len is 0. + * Returns 1 when source len is 0. * Deprecated in favor of php_stream_copy_to_stream_ex() */ ZEND_ATTRIBUTE_DEPRECATED PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC) @@ -1457,7 +1457,7 @@ return ( zend_hash_init(&url_stream_wrappers_hash, 0, NULL, NULL, 1) == SUCCESS - && + && zend_hash_init(php_get_stream_filters_hash_global(), 0, NULL, NULL, 1) == SUCC