From c0d060f5c02db168f1de895b41afffbc6e3cacfb Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 3 Jan 2014 11:04:26 +0800 Subject: Bump year --- main/php_streams.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index f9b94337d2..f3c9879144 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | -- cgit v1.2.1 From 47c902777297ce895aa915c13efdb00881af3669 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 3 Jan 2014 11:06:16 +0800 Subject: Bump year --- main/php_streams.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 5acf942e43..b0ecff07ad 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | -- cgit v1.2.1 From c081ce628f0d76d44784d7bb8e06428b06142ac0 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 3 Jan 2014 11:08:10 +0800 Subject: Bump year --- main/php_streams.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index c9732b4848..aa4c05c54f 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | -- cgit v1.2.1 From f4cfaf36e23ca47da3e352e1c60909104c059647 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Feb 2014 10:04:30 +0400 Subject: Use better data structures (incomplete) --- main/php_streams.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index aa4c05c54f..f3e887fade 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -191,12 +191,12 @@ struct _php_stream { php_stream_wrapper *wrapper; /* which wrapper was used to open the stream */ void *wrapperthis; /* convenience pointer for a instance of a wrapper */ - zval *wrapperdata; /* fgetwrapperdata retrieves this */ + zval wrapperdata; /* fgetwrapperdata retrieves this */ int fgetss_state; /* for fgetss to handle multiline tags */ int is_persistent; char mode[16]; /* "rwb" etc. ala stdio */ - int rsrc_id; /* used for auto-cleanup */ + zend_resource *res; /* used for auto-cleanup */ int in_free; /* to prevent recursion during free */ /* so we know how to clean it up correctly. This should be set to * PHP_STREAM_FCLOSE_XXX as appropriate */ @@ -242,17 +242,17 @@ PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, END_EXTERN_C() #define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) -#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->rsrc_id +#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->res->handle #if ZEND_DEBUG /* use this to tell the stream that it is OK if we don't explicitly close it */ # define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } /* use this to assign the stream to a zval and tell the stream that is * has been exported to the engine; it will expect to be closed automatically * when the resources are auto-destructed */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); (stream)->__exposed++; } +# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->res); (stream)->__exposed++; } #else # define php_stream_auto_cleanup(stream) /* nothing */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); } +# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->res); } #endif #define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) -- cgit v1.2.1 From 40e053e7f333b5fc3f4c75c964600666810cc969 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 13 Feb 2014 17:54:23 +0400 Subject: Use better data structures (incomplete) --- main/php_streams.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index f3e887fade..f434e6db75 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -249,10 +249,10 @@ END_EXTERN_C() /* use this to assign the stream to a zval and tell the stream that is * has been exported to the engine; it will expect to be closed automatically * when the resources are auto-destructed */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->res); (stream)->__exposed++; } +# define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; } #else # define php_stream_auto_cleanup(stream) /* nothing */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->res); } +# define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); } #endif #define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) -- cgit v1.2.1 From 5adeaa147d273e9adcde44c7dbc06b44a9f1d845 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 24 Feb 2014 18:12:30 +0800 Subject: Refactoring php_stream_copy_to_mem to return zend_string --- main/php_streams.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index f434e6db75..ad16d4b74f 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -61,7 +61,7 @@ END_EXTERN_C() * the ultimate ancestor, which is useful, because there can be several layers of calls */ #define php_stream_alloc_rel(ops, thisptr, persistent, mode) _php_stream_alloc((ops), (thisptr), (persistent), (mode) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_copy_to_mem_rel(src, buf, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC TSRMLS_CC) +#define php_stream_copy_to_mem_rel(src, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC TSRMLS_CC) #define php_stream_fopen_rel(filename, mode, opened, options) _php_stream_fopen((filename), (mode), (opened), (options) STREAMS_REL_CC TSRMLS_CC) @@ -440,9 +440,8 @@ PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size /* read all data from stream and put into a buffer. Caller must free buffer * when done. */ -PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen, - int persistent STREAMS_DC TSRMLS_DC); -#define php_stream_copy_to_mem(src, buf, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_CC TSRMLS_CC) +PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC TSRMLS_DC); +#define php_stream_copy_to_mem(src, maxlen, persistent) _php_stream_copy_to_mem((src), (maxlen), (persistent) STREAMS_CC TSRMLS_CC) /* output all data from a stream */ PHPAPI size_t _php_stream_passthru(php_stream * src STREAMS_DC TSRMLS_DC); @@ -546,7 +545,7 @@ PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_st PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRMLS_DC); PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC); -PHPAPI const char *php_stream_locate_eol(php_stream *stream, const char *buf, size_t buf_len TSRMLS_DC); +PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TSRMLS_DC); #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC TSRMLS_CC) #define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC TSRMLS_CC) -- cgit v1.2.1 From 0fe209e317cb48133c087c693203376465ca4053 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 2 Mar 2014 22:47:59 +0800 Subject: Refactor _php_stream_scandir to avoid memleak --- main/php_streams.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index ad16d4b74f..39a4a961e7 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -348,11 +348,11 @@ PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_ #define php_stream_closedir(dirstream) php_stream_close((dirstream)) #define php_stream_rewinddir(dirstream) php_stream_rewind((dirstream)) -PHPAPI int php_stream_dirent_alphasort(const char **a, const char **b); -PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b); +PHPAPI int php_stream_dirent_alphasort(const zend_string **a, const zend_string **b); +PHPAPI int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b); -PHPAPI int _php_stream_scandir(const char *dirname, char **namelist[], int flags, php_stream_context *context, - int (*compare) (const char **a, const char **b) TSRMLS_DC); +PHPAPI int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, + int (*compare) (const zend_string **a, const zend_string **b) TSRMLS_DC); #define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare) TSRMLS_CC) PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); -- cgit v1.2.1 From 1c427513160eb88d5b73b2883c48eaf204ad20f4 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 5 Mar 2014 11:41:21 +0800 Subject: Refactor stream_get_record to return zend_string --- main/php_streams.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 39a4a961e7..7e9b6a6c26 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -322,7 +322,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, #define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC) #define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC) -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, const char *delim, size_t delim_len TSRMLS_DC); +PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len TSRMLS_DC); /* CAREFUL! this is equivalent to puts NOT fputs! */ PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC); -- cgit v1.2.1 From 180de35bce168ff0fd6521b3fd377b56701c5dc6 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 11 Apr 2014 18:07:25 +0800 Subject: Refactor libxml (incompleted) --- main/php_streams.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 7e9b6a6c26..a0550a2356 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -255,8 +255,8 @@ END_EXTERN_C() # define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); } #endif -#define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) -#define php_stream_from_zval_no_verify(xstr, ppzval) (xstr) = (php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) +#define php_stream_from_zval(xstr, pzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (pzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) +#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((pzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) BEGIN_EXTERN_C() PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed); -- cgit v1.2.1 From a18cec1b865994735e5b4ab757ccc1a14f8607ff Mon Sep 17 00:00:00 2001 From: Boro Sitnikovski Date: Mon, 14 Apr 2014 10:02:11 +0200 Subject: Fix bug #65701: Do not use cache for file file copy --- main/php_streams.h | 1 + 1 file changed, 1 insertion(+) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index f3c9879144..2e4a3a2a18 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -377,6 +377,7 @@ END_EXTERN_C() /* Flags for url_stat method in wrapper ops */ #define PHP_STREAM_URL_STAT_LINK 1 #define PHP_STREAM_URL_STAT_QUIET 2 +#define PHP_STREAM_URL_STAT_NOCACHE 4 /* change the blocking mode of stream: value == 1 => blocking, value == 0 => non-blocking. */ #define PHP_STREAM_OPTION_BLOCKING 1 -- cgit v1.2.1 From 449f3e645232055760c8ccca77498f83b88f5486 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 31 Jul 2014 10:53:31 +0400 Subject: Fixed resource leak --- main/php_streams.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 2a142b99c2..fac15ce3e4 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -202,9 +202,7 @@ struct _php_stream { * PHP_STREAM_FCLOSE_XXX as appropriate */ int fclose_stdiocast; FILE *stdiocast; /* cache this, otherwise we might leak! */ -#if ZEND_DEBUG int __exposed; /* non-zero if exposed as a zval somewhere */ -#endif char *orig_path; php_stream_context *context; @@ -243,17 +241,12 @@ END_EXTERN_C() #define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) #define php_stream_get_resource_id(stream) ((php_stream *)(stream))->res->handle -#if ZEND_DEBUG /* use this to tell the stream that it is OK if we don't explicitly close it */ -# define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } +#define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } /* use this to assign the stream to a zval and tell the stream that is * has been exported to the engine; it will expect to be closed automatically * when the resources are auto-destructed */ -# define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; } -#else -# define php_stream_auto_cleanup(stream) /* nothing */ -# define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); } -#endif +#define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; } #define php_stream_from_zval(xstr, pzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (pzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) #define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((pzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) -- cgit v1.2.1 From 417ed16d11d2d7376b1a74028c42cd87818bfffb Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 7 Aug 2014 15:55:37 +0400 Subject: Make stream->context indirect trough zend_resource (stream->ctx->ptr). Fixed ext/standard/tests/streams/bug61115.phpt --- main/php_streams.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index fac15ce3e4..38215a67b0 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -205,7 +205,7 @@ struct _php_stream { int __exposed; /* non-zero if exposed as a zval somewhere */ char *orig_path; - php_stream_context *context; + zend_resource *ctx; int flags; /* PHP_STREAM_FLAG_XXX */ /* buffer */ @@ -228,6 +228,9 @@ struct _php_stream { struct _php_stream *enclosing_stream; /* this is a private stream owned by enclosing_stream */ }; /* php_stream */ +#define PHP_STREAM_CONTEXT(stream) \ + ((php_stream_context*) ((stream)->ctx ? ((stream)->ctx->ptr) : NULL)) + /* state definitions when closing down; these are private to streams.c */ #define PHP_STREAM_FCLOSE_NONE 0 #define PHP_STREAM_FCLOSE_FDOPEN 1 -- cgit v1.2.1 From 8ee2a4a9b5de682c0b37670e1f4f86242b1650ce Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 16 Aug 2014 11:16:11 +0200 Subject: first shot on merging the core fro the int64 branch --- main/php_streams.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 38215a67b0..229f8f49e0 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -103,8 +103,18 @@ typedef struct _php_stream_filter php_stream_filter; #include "streams/php_stream_context.h" #include "streams/php_stream_filter_api.h" +#ifdef _WIN64 +# define php_fstat _fstat64 +# define php_stat_fn _stat64 +typedef struct __stat64 php_stat_t; +#else +# define php_fstat fstat +# define php_stat_fn stat +typedef struct stat php_stat_t; +#endif + typedef struct _php_stream_statbuf { - struct stat sb; /* regular info */ + zend_stat_t sb; /* regular info */ /* extended info to go here some day: content-type etc. etc. */ } php_stream_statbuf; @@ -123,7 +133,7 @@ typedef struct _php_stream_ops { const char *label; /* label for this ops structure */ /* these are optional */ - int (*seek)(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC); + int (*seek)(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC); int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC); int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); int (*set_option)(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); @@ -209,11 +219,11 @@ struct _php_stream { int flags; /* PHP_STREAM_FLAG_XXX */ /* buffer */ - off_t position; /* of underlying stream */ + zend_off_t position; /* of underlying stream */ unsigned char *readbuf; size_t readbuflen; - off_t readpos; - off_t writepos; + zend_off_t readpos; + zend_off_t writepos; /* how much data to read when filling buffer */ size_t chunk_size; @@ -279,11 +289,11 @@ PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC); #define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE TSRMLS_CC) #define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT TSRMLS_CC) -PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC); +PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TSRMLS_DC); #define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET TSRMLS_CC) #define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence) TSRMLS_CC) -PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC); +PHPAPI zend_off_t _php_stream_tell(php_stream *stream TSRMLS_DC); #define php_stream_tell(stream) _php_stream_tell((stream) TSRMLS_CC) PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC); -- cgit v1.2.1 From 4d997f63d98c663b2d9acccd3655572652f61c7d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 20:22:49 +0200 Subject: master renames phase 3 --- main/php_streams.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 229f8f49e0..1daa0d9d67 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -106,11 +106,11 @@ typedef struct _php_stream_filter php_stream_filter; #ifdef _WIN64 # define php_fstat _fstat64 # define php_stat_fn _stat64 -typedef struct __stat64 php_stat_t; +typedef struct __stat64 zend_stat_t; #else # define php_fstat fstat # define php_stat_fn stat -typedef struct stat php_stat_t; +typedef struct stat zend_stat_t; #endif typedef struct _php_stream_statbuf { -- cgit v1.2.1 From 455741fce3c4f4392deb97775cba7a39f6490271 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 20:57:25 +0200 Subject: master renames phase 4 --- main/php_streams.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 1daa0d9d67..ad9ea92c1c 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -26,6 +26,8 @@ #endif #include #include +#include "zend.h" +#include "zend_stream.h" BEGIN_EXTERN_C() PHPAPI int php_file_le_stream(void); @@ -103,16 +105,6 @@ typedef struct _php_stream_filter php_stream_filter; #include "streams/php_stream_context.h" #include "streams/php_stream_filter_api.h" -#ifdef _WIN64 -# define php_fstat _fstat64 -# define php_stat_fn _stat64 -typedef struct __stat64 zend_stat_t; -#else -# define php_fstat fstat -# define php_stat_fn stat -typedef struct stat zend_stat_t; -#endif - typedef struct _php_stream_statbuf { zend_stat_t sb; /* regular info */ /* extended info to go here some day: content-type etc. etc. */ -- cgit v1.2.1 From 32be79dcfa1bc5af8682d9f512da68c5b3e2cbf3 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Sat, 23 Aug 2014 01:40:19 +0100 Subject: Fix stream_select() issue with OpenSSL buffer Ensure data from OpenSSL internal buffer has been transfered to PHP stream buffer before a select() emulation operation is performed Addresses bug #65137 https://bugs.php.net/bug.php?id=65137 Conflicts: ext/openssl/xp_ssl.c --- main/php_streams.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 2e4a3a2a18..89b877fdb1 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -301,6 +301,9 @@ PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t coun #define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC) #define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC) +PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC); +#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC) + #ifdef ZTS PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #else -- cgit v1.2.1 From 25f5ba94aca1e89ee5f0c66513e58826afa3b853 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 31 Aug 2014 11:45:11 -0400 Subject: remove a few gcc format attributes from some printf-like functions Since now PHP's printf-like functions have many custom specifiers, the amount of false-positives wasnt worth it --- main/php_streams.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 9a6e84dfe6..ecc6557f63 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -299,9 +299,9 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_ #define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC) #ifdef ZTS -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); #else -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); +PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); #endif /* php_stream_printf macro & function require TSRMLS_CC */ @@ -560,9 +560,9 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS /* pushes an error message onto the stack for a wrapper instance */ #ifdef ZTS -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5); +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); #else -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); #endif #define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ -- cgit v1.2.1 From fdd1e96f3e90895134c4082bde8cad475378deac Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 3 Sep 2014 15:22:08 +0200 Subject: Revert "remove a few gcc format attributes from some printf-like functions" This reverts commit 25f5ba94aca1e89ee5f0c66513e58826afa3b853. --- main/php_streams.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index ecc6557f63..9a6e84dfe6 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -299,9 +299,9 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_ #define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC) #ifdef ZTS -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); +PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #else -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); +PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); #endif /* php_stream_printf macro & function require TSRMLS_CC */ @@ -560,9 +560,9 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS /* pushes an error message onto the stack for a wrapper instance */ #ifdef ZTS -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5); #else -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #endif #define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ -- cgit v1.2.1 From d0cb715373c3fbe9dc095378ec5ed8c71f799f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Fri, 19 Sep 2014 18:33:14 +0200 Subject: s/PHP 5/PHP 7/ --- main/php_streams.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 9a6e84dfe6..34d7676f09 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ -- cgit v1.2.1 From 7b8222aa44bbab9928afd57adb1bc04cf291d46c Mon Sep 17 00:00:00 2001 From: Ferenc Kovacs Date: Wed, 15 Oct 2014 19:33:31 +0200 Subject: Revert "Merge branch 'PHP-5.4' into PHP-5.5" This reverts commit 30a73658c63a91c413305a4c4d49882fda4dab3e, reversing changes made to 7fac56e0729385bbd2bb040f06a20a697d9de5fd. --- main/php_streams.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index e90976cdca..d1efa71988 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -297,9 +297,6 @@ PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t coun #define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC) #define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC) -PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC); -#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC) - #ifdef ZTS PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #else -- cgit v1.2.1