[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
lbarnaudSat May 16 20:28:02 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: MFH: Fix warning when inner stream of a temp:// stream is closed before the stream ifself http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.20r2=1.8.2.6.2.21diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.20 php-src/main/streams/memory.c:1.8.2.6.2.21 --- php-src/main/streams/memory.c:1.8.2.6.2.20 Wed Dec 31 11:17:48 2008 +++ php-src/main/streams/memory.c Sat May 16 20:28:02 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.20 2008/12/31 11:17:48 sebastian Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.21 2009/05/16 20:28:02 lbarnaud Exp $ */ #define _GNU_SOURCE #include php.h @@ -563,6 +563,7 @@ stream = php_stream_alloc_rel(php_stream_temp_ops, self, 0, mode TEMP_STREAM_READONLY ? rb : w+b); stream-flags |= PHP_STREAM_FLAG_NO_BUFFER; self-innerstream = php_stream_memory_create_rel(mode); + php_stream_auto_cleanup(self-innerstream); // do not warn if innerstream is GC'ed before stream ((php_stream_memory_data*)self-innerstream-abstract)-owner_ptr = self-innerstream; return stream; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
felipe Sat Mar 15 10:28:54 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: Fixed bug #0 (st_blocks undefined under BeOS) http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.18r2=1.8.2.6.2.19diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.18 php-src/main/streams/memory.c:1.8.2.6.2.19 --- php-src/main/streams/memory.c:1.8.2.6.2.18 Mon Dec 31 07:20:15 2007 +++ php-src/main/streams/memory.c Sat Mar 15 10:28:53 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.18 2007/12/31 07:20:15 sebastian Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.19 2008/03/15 10:28:53 felipe Exp $ */ #define _GNU_SOURCE #include php.h @@ -234,6 +234,9 @@ #ifndef PHP_WIN32 ssb-sb.st_blksize = -1; +#endif + +#if !defined(PHP_WIN32) !defined(__BEOS__) ssb-sb.st_blocks = -1; #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
helly Thu Feb 22 23:26:03 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: - MFH Fix logic http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.16r2=1.8.2.6.2.17diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.16 php-src/main/streams/memory.c:1.8.2.6.2.17 --- php-src/main/streams/memory.c:1.8.2.6.2.16 Wed Feb 7 20:59:59 2007 +++ php-src/main/streams/memory.c Thu Feb 22 23:26:03 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.16 2007/02/07 20:59:59 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.17 2007/02/22 23:26:03 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -260,14 +260,14 @@ if (newsize = ms-fsize) { if (newsize ms-fpos) { ms-fpos = newsize; - } else { - ms-data = erealloc(ms-data, newsize); - memset(ms-data+ms-fsize, 0, newsize - ms-fsize); - ms-fsize = newsize; } + } else { + ms-data = erealloc(ms-data, newsize); + memset(ms-data+ms-fsize, 0, newsize - ms-fsize); ms-fsize = newsize; - return PHP_STREAM_OPTION_RETURN_OK; } + ms-fsize = newsize; + return PHP_STREAM_OPTION_RETURN_OK; } default: return PHP_STREAM_OPTION_RETURN_NOTIMPL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
helly Wed Feb 7 20:59:59 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: - MFH options/exports http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.15r2=1.8.2.6.2.16diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.15 php-src/main/streams/memory.c:1.8.2.6.2.16 --- php-src/main/streams/memory.c:1.8.2.6.2.15 Sat Feb 3 16:40:05 2007 +++ php-src/main/streams/memory.c Wed Feb 7 20:59:59 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.15 2007/02/03 16:40:05 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.16 2007/02/07 20:59:59 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -282,7 +282,7 @@ php_stream_memory_seek, php_stream_memory_cast, php_stream_memory_stat, - NULL /* php_stream_memory_set_option */ + php_stream_memory_set_option }; @@ -729,7 +729,7 @@ return stream; } -static php_stream_wrapper_ops php_stream_rfc2397_wops = { +PHPAPI php_stream_wrapper_ops php_stream_rfc2397_wops = { php_stream_url_wrap_rfc2397, NULL, /* close */ NULL, /* fstat */ @@ -742,7 +742,7 @@ NULL /* rmdir */ }; -php_stream_wrapper php_stream_rfc2397_wrapper ={ +PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper = { php_stream_rfc2397_wops, NULL, 1, /* is_url */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
helly Sat Jan 27 20:25:11 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: - MFH truncate support for mem/temp streams http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.12r2=1.8.2.6.2.13diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.12 php-src/main/streams/memory.c:1.8.2.6.2.13 --- php-src/main/streams/memory.c:1.8.2.6.2.12 Mon Jan 1 09:36:12 2007 +++ php-src/main/streams/memory.c Sat Jan 27 20:25:11 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.12 2007/01/01 09:36:12 sebastian Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.13 2007/01/27 20:25:11 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -241,6 +241,37 @@ } /* }}} */ +static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ +{ + php_stream_memory_data *ms = (php_stream_memory_data*)stream-abstract; + size_t newsize; + + switch(option) { + case PHP_STREAM_OPTION_TRUNCATE_API: + switch (value) { + case PHP_STREAM_TRUNCATE_SUPPORTED: + return PHP_STREAM_OPTION_RETURN_OK; + + case PHP_STREAM_TRUNCATE_SET_SIZE: + newsize = *(size_t*)ptrparam; + if (newsize = ms-fsize) { + if (newsize ms-fpos) { + ms-fpos = newsize; + } else { + ms-data = erealloc(ms-data, newsize); + memset(ms-data+ms-fsize, 0, newsize - ms-fsize); + ms-fsize = newsize; + } + ms-fsize = newsize; + return PHP_STREAM_OPTION_RETURN_OK; + } + } + default: + return PHP_STREAM_OPTION_RETURN_NOTIMPL; + } +} +/* }}} */ + php_stream_ops php_stream_memory_ops = { php_stream_memory_write, php_stream_memory_read, php_stream_memory_close, php_stream_memory_flush, @@ -248,7 +279,7 @@ php_stream_memory_seek, php_stream_memory_cast, php_stream_memory_stat, - NULL /* set_option */ + php_stream_memory_set_option }; @@ -266,7 +297,7 @@ self-mode = mode; self-owner_ptr = NULL; - stream = php_stream_alloc(php_stream_memory_ops, self, 0, mode TEMP_STREAM_READONLY ? r+b : w+b); + stream = php_stream_alloc_rel(php_stream_memory_ops, self, 0, mode TEMP_STREAM_READONLY ? rb : w+b); stream-flags |= PHP_STREAM_FLAG_NO_BUFFER; return stream; } @@ -493,6 +524,9 @@ } return PHP_STREAM_OPTION_RETURN_OK; default: + if (ts-innerstream) { + return php_stream_set_option(ts-innerstream, option, value, ptrparam); + } return PHP_STREAM_OPTION_RETURN_NOTIMPL; } } @@ -520,9 +554,9 @@ self-smax = max_memory_usage; self-mode = mode; self-meta = NULL; - stream = php_stream_alloc(php_stream_temp_ops, self, 0, mode TEMP_STREAM_READONLY ? r+b : w+b); + stream = php_stream_alloc_rel(php_stream_temp_ops, self, 0, mode TEMP_STREAM_READONLY ? rb : w+b); stream-flags |= PHP_STREAM_FLAG_NO_BUFFER; - self-innerstream = php_stream_memory_create(mode); + self-innerstream = php_stream_memory_create_rel(mode); ((php_stream_memory_data*)self-innerstream-abstract)-owner_ptr = self-innerstream; return stream; @@ -684,7 +718,7 @@ stream-ops = php_stream_rfc2397_ops; ts = (php_stream_temp_data*)stream-abstract; assert(ts != NULL); - ts-mode = mode mode[0] == 'r' ? TEMP_STREAM_READONLY : 0; + ts-mode = mode mode[0] == 'r' mode[1] != '+' ? TEMP_STREAM_READONLY : 0; ts-meta = meta; } efree(comma); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
helly Sat Jan 27 20:31:51 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: - Disable memory streams set option until 5.2.2 http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.13r2=1.8.2.6.2.14diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.13 php-src/main/streams/memory.c:1.8.2.6.2.14 --- php-src/main/streams/memory.c:1.8.2.6.2.13 Sat Jan 27 20:25:11 2007 +++ php-src/main/streams/memory.c Sat Jan 27 20:31:51 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.13 2007/01/27 20:25:11 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.14 2007/01/27 20:31:51 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -279,7 +279,7 @@ php_stream_memory_seek, php_stream_memory_cast, php_stream_memory_stat, - php_stream_memory_set_option + NULL /* php_stream_memory_set_option */ }; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
tony2001Thu Dec 21 00:47:02 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.9r2=1.8.2.6.2.10diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.9 php-src/main/streams/memory.c:1.8.2.6.2.10 --- php-src/main/streams/memory.c:1.8.2.6.2.9 Sat Nov 4 20:43:28 2006 +++ php-src/main/streams/memory.c Thu Dec 21 00:47:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.9 2006/11/04 20:43:28 rasmus Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.10 2006/12/21 00:47:02 tony2001 Exp $ */ #define _GNU_SOURCE #include php.h @@ -688,6 +688,7 @@ ts-mode = mode mode[0] == 'r' ? TEMP_STREAM_READONLY : 0; ts-meta = meta; } + efree(comma); return stream; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
tony2001Thu Dec 21 01:18:28 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.10r2=1.8.2.6.2.11diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.10 php-src/main/streams/memory.c:1.8.2.6.2.11 --- php-src/main/streams/memory.c:1.8.2.6.2.10 Thu Dec 21 00:47:02 2006 +++ php-src/main/streams/memory.c Thu Dec 21 01:18:28 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.10 2006/12/21 00:47:02 tony2001 Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.11 2006/12/21 01:18:28 tony2001 Exp $ */ #define _GNU_SOURCE #include php.h @@ -673,7 +673,6 @@ if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) { /* store data */ php_stream_temp_write(stream, comma, ilen TSRMLS_CC); - efree(comma); php_stream_temp_seek(stream, 0, SEEK_SET, newoffs TSRMLS_CC); /* set special stream stuff (enforce exact mode) */ vlen = strlen(mode); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
rasmus Sat Nov 4 20:43:28 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: Mark memory streams as is_url http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.8r2=1.8.2.6.2.9diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.8 php-src/main/streams/memory.c:1.8.2.6.2.9 --- php-src/main/streams/memory.c:1.8.2.6.2.8 Thu Jun 29 14:40:49 2006 +++ php-src/main/streams/memory.c Sat Nov 4 20:43:28 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.8 2006/06/29 14:40:49 bjori Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.9 2006/11/04 20:43:28 rasmus Exp $ */ #define _GNU_SOURCE #include php.h @@ -708,7 +708,7 @@ php_stream_wrapper php_stream_rfc2397_wrapper ={ php_stream_rfc2397_wops, NULL, - 0, /* is_url */ + 1, /* is_url */ }; /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
tony2001Tue Jun 6 14:09:12 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: MFH: don't leak when decoding failed http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.6r2=1.8.2.6.2.7diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.6 php-src/main/streams/memory.c:1.8.2.6.2.7 --- php-src/main/streams/memory.c:1.8.2.6.2.6 Tue May 23 22:31:25 2006 +++ php-src/main/streams/memory.c Tue Jun 6 14:09:12 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.6 2006/05/23 22:31:25 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.7 2006/06/06 14:09:12 tony2001 Exp $ */ #define _GNU_SOURCE #include php.h @@ -661,6 +661,7 @@ if (base64) { comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, ilen); if (!comma) { + zval_ptr_dtor(meta); php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, rfc2397: unable to decode); return NULL; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams memory.c
helly Sun May 14 19:15:31 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams memory.c Log: - MFH No need to have this controlled by allow_url_fopen http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.3r2=1.8.2.6.2.4diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.3 php-src/main/streams/memory.c:1.8.2.6.2.4 --- php-src/main/streams/memory.c:1.8.2.6.2.3 Sun May 14 01:42:03 2006 +++ php-src/main/streams/memory.c Sun May 14 19:15:31 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.3 2006/05/14 01:42:03 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.4 2006/05/14 19:15:31 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -701,7 +701,7 @@ php_stream_wrapper php_stream_rfc2397_wrapper ={ php_stream_rfc2397_wops, NULL, - 1, /* is_url */ + 0, /* is_url */ }; /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php