summaryrefslogtreecommitdiff
path: root/main/streams
Commit message (Collapse)AuthorAgeFilesLines
* Fix #76735: Incorrect message in fopen on invalid modeChristoph M. Becker2020-09-231-3/+1
| | | | | | | | We have to log errors in `stream_opener` callbacks to the wrapper's error log, because otherwise we may pick up an unrelated `errno` or a most generic message. Closes GH-6187.
* Fix #76943: Inconsistent stream_wrapper_restore() errorsChristoph M. Becker2020-09-221-6/+7
| | | | | | | | | | | | | If restoring of any not registered built-in wrapper is requested, the function is supposed to fail with a warning, so we have to check this condition first. Furthermore, to be able to detect whether a built-in wrapper has been changed, it is not sufficient to check whether *any* userland wrapper has been registered, but rather whether the specific wrapper has been modified. Closes GH-6183.
* Fix #79423: copy command is limited to size of file it can copyChristoph M. Becker2020-09-221-1/+17
| | | | | | | | | Passing `NULL` as `lpFileSizeHigh` to `GetFileSize()` gives wrong results for files larger than 0xFFFFFFFF bytes. We fix this by using `GetFileSizeEx()`, and let the mapping fail, if the file size is too large for the architecture. Closes GH-5319.
* Fix #80067: Omitting the port in bindto setting errorsChristoph M. Becker2020-09-111-4/+0
| | | | | | | | | | | | A recent commit[1] which fixed a memory leak introduced a regression regarding the formerly liberal handling of IP addresses to bind to. We fix this by reverting that commit, and fix the memory leak where it actually occurs. In other words, this fix is less intrusive than the former fix. [1] <http://git.php.net/?p=php-src.git;a=commit;h=0b8c83f5936581942715d14883cdebddc18bad30> Closes GH-6104.
* Fix #80048: Bug #69100 has not been fixed for WindowsChristoph M. Becker2020-09-031-8/+4
| | | | | | We fix the erroneous length calculation on Windows, too. Closes GH-6067.
* Handle bindto errortwosee2020-07-291-0/+4
| | | | Closes GH-5903.
* Fixed bug #79468dinosaur2020-04-141-0/+6
| | | | Close the stream filter resources when removing them from the stream.
* Fix #78210: Invalid pointer addressChristoph M. Becker2020-03-111-0/+6
| | | | | | | | | | | | | | | | | | | This is actually about three distinct issues: * If an empty string is passed as $address to `stream_socket_sendto()`, the `sa` is not initialized, so we must not pass it as `addr` to `php_stream_xport_sendto()`. * On POSIX, `recvfrom()` truncates messages which are too long to fit into the specified buffer (unless `MSG_PEEK` is given), discards the excessive bytes, and returns the buffer length. On Windows, the same happens, but `recvfrom()` returns `SOCKET_ERROR` with the error code `WSAEMSGSIZE`. We have to catch this for best POSIX compatibility. * In `php_network_parse_network_address_with_port()`, we have to zero `in6` (not only its alias `sa`) to properly support IPv6. Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
* Fixed bug #78902liudaixiao2020-01-231-2/+9
|
* Check for exception after applying stream filtersNikita Popov2019-10-081-1/+7
| | | | | | | | This makes the stream opening actually fail, and avoids assertion failures when we tokenize with EG(exception) set. Also avoid throwing an additional warning after an exception has already been thrown.
* Merge branch 'PHP-7.2' into PHP-7.3Joe Watkins2019-10-032-6/+0
|\ | | | | | | | | * PHP-7.2: Fix #76859 stream_get_line skips data if used with data-generating filter
| * Fix #76859 stream_get_line skips data if used with data-generating filterKonstantin Kopachev2019-10-032-6/+0
| | | | | | | | | | | | | | | | | | stream_get-line repeatedly calls php_stream_fill_read_buffer until enough data is accumulated in buffer. However, when stream contains filters attached to it, then each call to fill buffer essentially resets buffer read/write pointers and new data is written over old. This causes stream_get_line to skip parts of data from stream This patch fixes such behavior, so fill buffer call will append.
* | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-07-291-1/+6
|\ \ | |/
| * Fix bug #78326Albert Casademont2019-07-291-1/+6
| | | | | | | | | | Similar to what fread() does, truncate the stream_get_contents() result if the original buffer was way too large.
* | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-07-171-9/+6
|\ \ | |/
| * Fixed bug #69100Nikita Popov2019-07-171-9/+6
| |
* | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-03-041-18/+35
|\ \ | |/ | | | | | | * PHP-7.2: Fix bug #77630 - safer rename() procedure
| * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-03-041-18/+35
| |\ | | | | | | | | | | | | * PHP-7.1: Fix bug #77630 - safer rename() procedure
| | * Fix bug #77630 - safer rename() procedureStanislav Malyshev2019-03-041-17/+34
| | | | | | | | | | | | | | | | | | | | | In order to rename safer, we do the following: - set umask to 077 (unfortunately, not TS, so excluding ZTS) - chown() first, to set proper group before allowing group access - chmod() after, even if chown() fails
| | * Sync leading and final newlines in source code filesPeter Kokot2018-10-142-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | * year++Xinchen Hui2018-01-0218-18/+18
| | |
* | | Merge branch 'PHP-7.2' into PHP-7.3Xinchen Hui2019-02-251-1/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fixed bug #77664 (Segmentation fault when using undefined constant in custom wrapper)
| * | Fixed bug #77664 (Segmentation fault when using undefined constant in custom ↵Xinchen Hui2019-02-251-1/+4
| | | | | | | | | | | | wrapper)
* | | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-02-111-1/+1
|\ \ \ | |/ /
| * | Fix bug #51068 (glob:// do not support current path relative)Ahmed Abdou2019-02-111-1/+1
| | | | | | | | | | | | Fix DirectoryIterator glob://* current path relative queries
* | | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-02-111-0/+2
|\ \ \ | |/ /
| * | Fix #77552: Uninitialized buffer in stat functionsjohnstevenson2019-02-111-0/+2
| | |
| * | Sync leading and final newlines in source code filesPeter Kokot2018-10-142-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| * | year++Xinchen Hui2018-01-0218-18/+18
| | |
* | | Simplify assignment on 64-bitAnatol Belski2018-11-171-2/+1
| | |
* | | Fix error conditionAnatol Belski2018-10-301-2/+2
| | |
* | | Fixed bug #77081 ftruncate() changes seek pointer in c modeAnatol Belski2018-10-301-3/+4
| | |
* | | Make php_plain_files_wrapper to be writable (workaround for swoole)Dmitry Stogov2018-10-242-2/+3
| | |
* | | Sync leading and final newlines in source code filesPeter Kokot2018-10-142-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* | | Fixed bug #76803 ftruncate changes file pointerAnatol Belski2018-08-281-0/+9
| | |
* | | Removed useless IS_UNDEF checksDmitry Stogov2018-07-311-2/+2
| | |
* | | Replace obsolete AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEVPeter Kokot2018-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autoconf 2.50 released in 2001 has made several macros obsolete. Instead of the AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV the new AC_CHECK_MEMBERS should be used. When checking for the presence of stat struct members st_blkzize and st_rdev the new AC_CHECK_MEMBERS macro defines new constants HAVE_STRUCT_STAT_ST_BLKSIZE and HAVE_STRUCT_STAT_ST_RDEV. Old constants HAVE_ST_BLKSIZE and HAVE_ST_RDEV need to be replaced respectively in PHP code (this patch) and in PHP extenstions if they use them. PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require 2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which are all greater than above mentioned 2.50 version.
* | | Fix typos in code commentsPeter Kokot2018-07-251-1/+1
| | |
* | | Remove unused Git attributes identPeter Kokot2018-07-2518-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | | Use zval_ptr_dtor() instead of zval_dtor() in internal functions that ↵Dmitry Stogov2018-07-051-1/+1
| | | | | | | | | | | | destroy new created object (This is safer and produces less code)
* | | Avoid useless stream buffer copying and workaround with chunk_size manipulation.Dmitry Stogov2018-06-141-1/+3
| | |
* | | Fixed bug #76422 ftruncate fails on files > 2GBAnatol Belski2018-06-091-0/+22
| | |
* | | Removed "dead" code (zend_hash_update() never fails)Dmitry Stogov2018-06-012-7/+4
| | |
* | | Removed useless zval_ptr_dtor()Dmitry Stogov2018-05-291-17/+16
| | |
* | | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-285-12/+12
| | | | | | | | | | | | where we sure about string persistence.
* | | zend_fcall_info_cache.calling_scope is not used by zend_call_function() and ↵Dmitry Stogov2018-05-031-1/+0
| | | | | | | | | | | | | | | | | | doesn't have to be initialized. It's used only as a result of zend_is_callable() in forward_static_call and spl_autoload.
* | | Use int instead of integer in protoGabriel Caruso2018-02-021-1/+1
| | |
* | | year++Xinchen Hui2018-01-0218-18/+18
| | |
* | | zend_fcall_info_cache.initialized is removed (zend_fcall_info_cache is ↵Dmitry Stogov2017-12-271-1/+0
| | | | | | | | | | | | initialized if zend_fcall_info_cache.function_handler is set).
* | | Use cheaper APIXinchen Hui2017-12-181-1/+1
| | |