Commit Graph

434 Commits

Author SHA1 Message Date
Stanislav Malyshev
dcd1cd8002 with unicode buffers, positions are in uchars 2008-06-08 18:21:59 +00:00
Antony Dovgal
41c60bab79 fix invalid free in Unicode filter 2008-05-20 07:48:04 +00:00
Greg Beaver
2b41209dfb MFB: fix erroneous use of php_resolve_path in _php_stream_wrapper_open_ex - this breaks require/include for all extensions that intercept zend_resolve_path 2008-04-28 22:40:10 +00:00
Greg Beaver
e8ac7c11d1 MFB: Fixed potentially confusing error message on failure when no errors are logged 2008-04-28 22:37:45 +00:00
Greg Beaver
b34cf3d86f MFB do not scan include_path with faulty plain_wrapper-based include_path fopen
# _fopen_with_path_rel probably needs to call out to regular php_stream_open, for exts that use it (it is exported)
2008-04-13 22:19:23 +00:00
Dmitry Stogov
977cc79398 Added ability to use stream wrappers in include_path 2008-03-27 10:33:52 +00:00
Antony Dovgal
4c7b5a89ba Change streams to not use mmap() when reading files (aka copying to memory).
There are two problems with mmap() in this case:
1) there is no performance gain since we allocate the memory anyways;
2) memcpy() may crash if somebody truncates this file at the same moment
(see http://dev.daylessday.org/diff/mmap.phps for example);

It seems to work fine with fpassthru(), though why it is so should be investigated.

Thanks to Andrey Vasilishin for the report and Anight for pressing this through =)
2008-03-24 16:28:08 +00:00
Marcus Boerger
384d50b37b - Settle to 4 MB, see internals@ archives 2008-03-21 19:37:32 +00:00
Marcus Boerger
12a66e0d1c - Fix comment 2008-03-21 18:20:51 +00:00
Marcus Boerger
a70a882df4 - Increase max mmap size to 8 MB 2008-03-21 17:12:38 +00:00
Felipe Pena
af9b1c3376 MFB: Fixed bug #44440 (st_blocks undefined under BeOS) 2008-03-15 10:34:12 +00:00
Andrey Hristov
af5a93e552 char **error_message was passed but not used. This causes problems in cases
of getaddrinfo() failure, because the upper layers don't get the error.
  initialize a variable because we were reading initialized in case of error.
2008-03-10 19:55:43 +00:00
Ilia Alshanetsky
94ee2269d6 MFB: Fixed bug #44233 (MSG_PEEK undefined under BeOS R5) 2008-02-27 00:30:49 +00:00
Marcus Boerger
7671f2ec4a - Get rid of overoptimization 2008-01-30 23:43:05 +00:00
Greg Beaver
184e934511 use correct macro 2008-01-13 22:55:02 +00:00
Greg Beaver
e54eb5513e clarify error message on why opening a stream wrapper failed for allow_url_include/allow_url_fopen, add test for allow_url_fopen 2008-01-12 15:50:17 +00:00
Sebastian Bergmann
9b620d50b4 Bump copyright year, 2 of 2. 2007-12-31 07:12:20 +00:00
Antony Dovgal
21fb4c1030 apply correct fix for bug #43522
fix Unicode streams too this time
2007-12-29 10:50:12 +00:00
Ilia Alshanetsky
d963eaffcc MFB: Fixed bug #43522 (stream_get_line() eats additional characters) 2007-12-10 14:19:20 +00:00
Jani Taskinen
4fc4814012 - Fixed bug #43365 (Several enums have trailing commas) 2007-11-26 10:58:28 +00:00
Marcus Boerger
c26e0d8ee7 - MFB ws 2007-11-06 10:54:29 +00:00
Jani Taskinen
13171134f8 - Nuke unused variables 2007-11-01 17:32:10 +00:00
Jani Taskinen
eb1a26c8b2 - Fixed bug #43137 (rmdir() and rename() do not clear statcache) 2007-10-31 13:22:18 +00:00
Yiduo (David) Wang
95da0dc570 Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:15:07 +00:00
Antony Dovgal
277eb1feee ucnv_toUnicode() in ICU 3.8 requires target buffer size to be even, otherwise it bails out with U_ILLEGAL_ARGUMENT_ERROR
this commit fixes endless loop (due to the absence of error catching) and also fixes the cause of the error
2007-10-02 17:09:22 +00:00
Stanislav Malyshev
201388e5ab fix proto 2007-08-16 23:53:40 +00:00
Dmitry Stogov
11c5577116 Fixed EOF handling in case of reading from file opened in write only mode. 2007-07-25 16:34:27 +00:00
Dmitry Stogov
9343c54040 Fixed bug #41984 (Hangs on large SoapClient requests) 2007-07-24 14:25:07 +00:00
Jani Taskinen
562a0629e4 - Fix compile warnings 2007-07-21 01:41:55 +00:00
Jani Taskinen
97abf9d5dc - Fixed bugs #36796, #36918, #41371 (stream_set_blocking() does not work) 2007-07-17 13:27:38 +00:00
Dmitry Stogov
eb5dab85c9 Unicode support 2007-07-11 15:17:59 +00:00
Dmitry Stogov
922f3d5512 Fixed wrong warning 2007-07-11 14:32:54 +00:00
Sascha Schumann
ad31680f34 - fix concurrent reader/writer use case
(we read, while the other process writes -> if we don't try
   read we won't notice that the file has been growing.)
2007-07-10 20:13:29 +00:00
Dmitry Stogov
f766275b7a Added ability to create local or remote (URL) user streams
Local user streams must not be able to open(), URLs if allow_url_include is off
Implemented new function stream_is_local()
[
- stream_wrapper_register() extended with additional optional argument "flags"
  of type long. This time only one flag is implemented - STREAM_IS_URL, that
  means that userstream wrapper is remote (URL). By default stream is local.
- stream_is_local() is a new function that accepts stream and tell if this
  stream is local or remote (URL)
]
2007-07-03 10:22:55 +00:00
Ilia Alshanetsky
e844eaedbb MFB 2007-05-29 21:06:04 +00:00
Ilia Alshanetsky
66526cee92 MFB 2007-05-28 23:00:25 +00:00
Scott MacVicar
b0856d961f Fixed bug #41390 (Clarify error message with invalid protocol scheme syntax) 2007-05-15 13:01:47 +00:00
Dmitry Stogov
0ddb071abb Fixed bug #41304 (compress.zlib temp files left) 2007-05-08 12:08:41 +00:00
Dmitry Stogov
2918cda494 Fixed crash on win32 in case of negative size 2007-04-18 14:23:35 +00:00
Dmitry Stogov
98423baf13 Fixed crash 2007-04-18 13:53:32 +00:00
Dmitry Stogov
2908322c14 WIN64 support 2007-04-16 09:43:53 +00:00
Dmitry Stogov
8610b4f6cf Fixed 64-bit support 2007-04-09 15:39:16 +00:00
Sara Golemon
98e832d29e Fix handling over overridden file:// wrapper 2007-03-06 20:04:05 +00:00
Marcus Boerger
bf8ea04c13 - Missed to add [ to meta char check 2007-03-03 23:56:43 +00:00
Marcus Boerger
c7faeb736a - Allow to retrieve flags with php_glob_stream_get_count()
- Detect meta chars in pathand switch to append mode so that path can
  actually changes for each entry
2007-03-03 23:41:10 +00:00
Marcus Boerger
ce1d14eae8 - Allow to get number of entries of a glob stream 2007-03-03 23:04:57 +00:00
Marcus Boerger
3f5e89cf31 - Provide access to pattern used in glob 2007-03-03 21:38:25 +00:00
Marcus Boerger
0c52e058b0 - php_stream_is() requires php_glob_stream_ops to be public
- little bit of additional whitespace
2007-03-03 20:56:45 +00:00
Marcus Boerger
01220f548f - Add glob stream wrapper 2007-03-03 20:41:12 +00:00
Marcus Boerger
ff3a914147 -A stream wrapper might only allow directory access 2007-03-03 18:59:53 +00:00
Sara Golemon
3b00d29d5a Add retry for interrupted reads and graceful handling for failed retries 2007-02-23 23:08:40 +00:00
Marcus Boerger
bbfce40c49 - Fix logic 2007-02-22 23:25:36 +00:00
Antony Dovgal
30dacafa72 implement PHP_STREAM_FLAG_NO_CLOSE and avoid hacks in plain wrapper 2007-02-21 21:56:45 +00:00
Antony Dovgal
be4b75b136 improve php_userstreamop_seek()
check for errors in stream_seek() and return correct status
2007-02-13 19:50:13 +00:00
Andi Gutmans
7b6523c8e6 - Make sure to be ANSI C compliant 2007-02-05 05:15:49 +00:00
Marcus Boerger
67206a2cbf - Fix mem/temp stream exports and readonlyissue 2007-02-03 14:45:54 +00:00
Marcus Boerger
93918c7a7c - Add option support for temp/memory stream (adds ftruncate support) 2007-01-27 15:17:23 +00:00
Sara Golemon
cc1b19cf0e Expand allow_url_fopen/allow_url_include functionality 2007-01-24 21:43:47 +00:00
Nuno Lopes
22fbaf2d6c MFB: use only 2 bits 2007-01-18 16:06:28 +00:00
Marcus Boerger
1c60406349 - Add more unicode stuff 2007-01-16 20:36:04 +00:00
Marcus Boerger
99bd9f758a - Help streams debugging 2007-01-15 22:19:33 +00:00
Antony Dovgal
902e6583d9 add trailing '\0' to stream hashes 2007-01-15 17:06:52 +00:00
Antony Dovgal
3868c1533e include \0 to the hash
it does matter because we use these strings in phpinfo()
2007-01-15 14:59:40 +00:00
Marcus Boerger
25095070cf - Use relay to aid debugging 2007-01-14 19:13:34 +00:00
Marcus Boerger
672eae9c90 - Fix readonly mode to 'rb' 2007-01-14 19:09:55 +00:00
Sara Golemon
53333166fc Add convenience function for openeing files with unicode names 2007-01-10 22:43:17 +00:00
Sebastian Bergmann
3717df72ae Bump year. 2007-01-01 09:29:37 +00:00
Dmitry Stogov
1ed6591f8a Fixed heap overflow 2006-12-25 13:11:48 +00:00
Antony Dovgal
b07ab323ad apply correct fix (aka "oops!") 2006-12-21 01:18:14 +00:00
Antony Dovgal
7a6b75e8ac don't leak on error 2006-12-21 01:07:52 +00:00
Antony Dovgal
50791bce76 fix potential leak 2006-12-21 00:46:51 +00:00
Dmitry Stogov
938f3d6efa Added function stream_socket_shutdown(). It is a wraper for system shutdown() function, that shut downs part of a full-duplex connection 2006-12-19 08:59:26 +00:00
Antony Dovgal
9ed4f515d1 fix #39673 (file_get_contents causes bus error on certain offsets) 2006-11-29 11:10:49 +00:00
Antony Dovgal
8373efc9b9 fix #39551 (Segfault with stream_bucket_new in user filter)
also fixes several segfaults and leaks
add test
2006-11-21 15:47:44 +00:00
Hannes Magnusson
9da991dd50 MFB: Fix ftruncate() with negative size 2006-11-16 16:08:09 +00:00
Dmitry Stogov
6850e95c3e Removed unnecessary ftell() calls (one call for each included PHP file) 2006-11-10 13:18:46 +00:00
Dmitry Stogov
c39eecf9ae Disabled reading from stream (calls to read()) after EOF 2006-11-10 13:10:28 +00:00
Dmitry Stogov
b71309f4a2 Removed unnecessary checks for ISREG file and corresponding stat() calls on Wind
ows
2006-11-10 10:55:43 +00:00
Antony Dovgal
e2070c4360 eliminate a couple of compile warnings 2006-11-09 01:06:45 +00:00
Rasmus Lerdorf
d566d5553f Mark memory streams as is_url 2006-11-04 20:44:02 +00:00
Dmitry Stogov
d73bf1d322 Fixed mkdir("/tmp/foo//bar/log", 0777, true) 2006-10-19 09:49:56 +00:00
Sara Golemon
d9423de12e Bugfix 38648: Don't assume all buckets are part of a brigade 2006-10-11 23:07:30 +00:00
Antony Dovgal
729ed6eafc fix crash when parsing invalid hostnames/IPs 2006-10-11 12:53:38 +00:00
Hannes Magnusson
176b72284c Error message clean up
(patch by Matt W (php_lists -AT- realpain.com))
2006-10-08 13:34:24 +00:00
Antony Dovgal
d38bf75b69 int -> size_t 2006-10-03 23:22:21 +00:00
Ilia Alshanetsky
15e5832c26 MFB: Last set of zend_hash_init() optimizations 2006-10-03 19:52:34 +00:00
Sara Golemon
fa71abf4a2 Unused label, now how the heck did it get there? 2006-10-02 18:13:56 +00:00
Dmitry Stogov
eb1e643690 Fixed wrong pipe detection code 2006-09-28 07:26:19 +00:00
Sara Golemon
f8fdb67056 PHP6 Updates for popen() and related functionality 2006-09-24 20:33:14 +00:00
Sara Golemon
3191ed0e85 Update stream_copy_to_stream() for PHP6 2006-09-22 19:54:30 +00:00
Sara Golemon
3f56da6eba Add INI controlled default stream encoding (unicode.stream_encoding).
Add convenience function stream_defualt_encoding() for setting it.
2006-09-19 20:36:48 +00:00
Dmitry Stogov
128548a5c0 Disabled autoconversion of hash keys (from string to unicode) for PHP arrays 2006-09-19 10:38:31 +00:00
Antony Dovgal
e264e460a4 fix double free(), add test 2006-09-15 07:26:19 +00:00
Dmitry Stogov
a9f035d5c1 *** empty log message *** 2006-09-14 09:59:23 +00:00
Ilia Alshanetsky
504078c64e MFB: Fixed bug #37779 (empty include_path leads to search for files
inside /).
2006-09-12 15:49:02 +00:00
Antony Dovgal
d13d452523 fix coverity issue #197
"I can't think of a reason to pass a NULL buf" (c) Wez
2006-09-10 13:01:28 +00:00
Ilia Alshanetsky
22206ebf22 MFB: Fixed bug #38661 (mixed-case URL breaks url-wrappers). 2006-09-03 16:33:02 +00:00
Antony Dovgal
144cca7be3 fix #38199 (fclose() unable to close STDOUT and STDERR) 2006-08-28 17:14:13 +00:00
Dmitry Stogov
d824f02ce1 Fixed bug #38488 (Access to "php://stdin" and family crashes PHP on win32) 2006-08-22 06:15:45 +00:00
Antony Dovgal
a4a561dc72 fix #38450 (constructor is not called for classes used in userspace stream wrappers) 2006-08-14 15:00:04 +00:00