1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00
Commit Graph

140 Commits

Author SHA1 Message Date
Anatol Belski 231a311ecb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  increase the polling period to not to break existing behaviours
2014-09-29 17:28:27 +02:00
Anatol Belski 46aa2c396b increase the polling period to not to break existing behaviours 2014-09-29 17:27:24 +02:00
Anatol Belski 87a37f4090 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #51800 proc_open on Windows hangs forever
2014-09-29 16:27:33 +02:00
Anatol Belski 0c982798e0 Fixed bug #51800 proc_open on Windows hangs forever
This loop can block for some minutes, theoretically. Practially
however, this is a 99% non issue for a normal use case. This is
required because read() is synchronous. The PHP streams API wants
to fill its internal buffers, therefore it might try to read some
more data than user has demanded. Also, for a case where we want
to read X bytes, but neither enough data nor EOF arrives, read()
will block until it could fill the buffer. If a counterpart station
runs slowly or delivers not all the data at once, read() would
still be waiting. If we quit too early, we possibly could loose
some data from the pipe. Thus it has to emulate the read()
behaviour, but obviously not completely, just to some grade.

Reading big data amount is for sure an issue on any platforms, it
depends on the pipe buffer size, which is controlled by the system.
On Windows, the buffer size seems to be way too small, which causes
buffer congestion and a dead lock. It is essential to read the pipe
descriptors simultaneously and possibly in the same order as the
opposite writes them.

Thus, this will work with smaller buffer data sizes passed through
pipes. As MSDN states, anonymous pipes don't support asynchronous
operations. Neither anonymous pipes do support select() as they are
not SOCKETs but file descriptors. Consequently - bigger data sizes
will need a better solution based on threads. However it is much
more expencive. Maybe a better solution could be exporting a part
of the internal doing as a userspace function which could perform
some kind of lookahead operation on the pipe descriptor.

This is just the first stone, depending on the user feedback we
might go for further improvements in this area.
2014-09-29 16:24:34 +02:00
Michael Wallner deee0011e1 restore API compatibility 2014-07-03 20:40:41 +02:00
Michael Wallner 438b6c5258 finish 2014-07-03 20:40:40 +02:00
Michael Wallner 11e401ab59 refactor _php_stream_fopen_{temporary_,tmp}file() 2014-07-03 20:40:40 +02:00
Anatol Belski 62f6c5853f Fixes to various stream cast on win64
This fixes further issues on win64 with casts from the streams.
Sockets/descriptors handling was unitized. This has an impact only on
win64, php_socket_t otherwise can be feed back to int datatype.
2014-03-19 06:33:46 +01:00
Xinchen Hui c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui 47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Michael Wallner 9ea2489f5c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #61645 (fopen and O_NONBLOCK)
  fix possibly uninitialized value
2013-12-06 10:33:47 +01:00
Michael Wallner a48d82d238 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #61645 (fopen and O_NONBLOCK)
  fix possibly uninitialized value
2013-12-06 10:33:10 +01:00
Michael Wallner b5f5bff965 Fixed bug #61645 (fopen and O_NONBLOCK)
if a mode like "rn" was passed to fopen(), then
php_stream_parse_fopen_modes() would assign O_WRONLY to
flags, because O_NONBLOCK tainted flags for the r/w/+ check
2013-12-06 10:29:24 +01:00
Anatol Belski cf6ab0e915 applied and fixed the original patch
initial work on the patch import done
2013-10-17 10:40:43 +02:00
Andrey Hristov 92d27ccb05 Constify streams API and a few other calls down the rabbit hole.
(`char *` to `const char *` for parameters and few return values)
In a few places int len moved to size_t len.
2013-07-30 12:49:36 +02:00
Xinchen Hui a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui 0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Mateusz Kocielski 4d600bda70 * fixed bug #60704 unlink() bug with some files path
Reviewed by: rasmus@
2012-02-14 14:14:30 +00:00
Felipe Pena 8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena 4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov 4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Dmitry Stogov e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Stanislav Malyshev fa78f7a4c0 retore open_basedir check for unlink 2011-07-31 22:43:21 +00:00
Stanislav Malyshev 2f1752cb49 retore open_basedir check for unlink 2011-07-31 22:43:21 +00:00
Pierre Joye fc8afdf178 - Fixed bug 55124, recursive mkdir fails with current (dot) directory in path 2011-07-26 17:44:20 +00:00
Pierre Joye db25201ffb - Fixed bug 55124, recursive mkdir fails with current (dot) directory in path 2011-07-26 17:44:20 +00:00
Stanislav Malyshev f9088156f4 implement streams metadata API per RFC 2011-05-25 21:03:55 +00:00
Stanislav Malyshev 5c9080d3a6 implement streams metadata API per RFC 2011-05-25 21:03:55 +00:00
Gustavo André dos Santos Lopes a3a5157286 - PHP_STREAM_OPTION_WRITE_BUFFER no longer disables the read buffer of a plain
stream when 0 is given as the value.
- PHP_STREAM_OPTION_WRITE_BUFFER no longer changes the chunk size in socket
  streams.
- Added stream_set_chunk_size() function.
- Some signedness fixes.
- Test for commit r308474, now that it's possible to actually test it.
2011-02-19 01:28:37 +00:00
Adam Harvey 2b4fb94e8e Fix bug #53913 (Streams functions assume HAVE_GLOB is defined). Patch by Chris
Jones.
2011-02-04 10:47:41 +00:00
Pierre Joye 657c934513 - don't continue if no valid option value 2011-01-20 07:38:00 +00:00
Felipe Pena 0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Gustavo André dos Santos Lopes d37e1ea243 - Renamed php_stream_rep_nonstand_mode to
php_stream_mode_sanitize_fdopen_fopencookie, made it not
  exported and movied it from php_streams.h to
  php_streams_int.h.
2010-11-05 18:53:48 +00:00
Gustavo André dos Santos Lopes 0a35133524 - Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails
with streams opened with, inter alia, the 'xb' mode).
2010-11-05 01:29:08 +00:00
Pierre Joye ada5423308 - WS 2010-09-01 10:16:48 +00:00
Pierre Joye dec8593fac - add lstat support for Windows 2010-09-01 09:49:53 +00:00
Kalle Sommer Nielsen dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Pierre Joye acc6609a27 - get the right error on windows 2010-02-21 17:44:25 +00:00
Pierre Joye 658e86b847 - prevent unexpectable behaviors (for the user) with invalid path 2010-02-07 20:15:58 +00:00
Pierre Joye b7aee13069 - removed debug breakpoint and improve inline comment 2010-01-27 02:03:41 +00:00
Pierre Joye 6925763347 - prevent bad things to happen when invalid path are passed to MoveFileEx 2010-01-27 01:18:43 +00:00
Pierre Joye 573c33b3b7 - [DOC] #45986, bad file descriptor warning when rename is used with invalid path, add php_win32_docref2_from_error to display system error for non posix api 2010-01-26 20:04:03 +00:00
Sebastian Bergmann 9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Antony Dovgal 42d05a5c02 remove automatic file unlocking on shutdown and/or stream close
(make it win32-specific for 5_2, as discussed with Ilia)
2009-12-25 20:34:59 +00:00
Johannes Schlüter 473d75475a Fix #50063 (safe_mode_include_dir fails) 2009-11-12 15:05:03 +00:00
Mikko Koppanen 3fd12260aa MFH: Added support for passing O_NONBLOCK to the underlying open() system call 2009-04-11 11:44:15 +00:00
Ilia Alshanetsky aaa5361c90 Adjust condition 2009-02-10 16:14:18 +00:00
Ilia Alshanetsky 2b531b5149 MFB: typo fix 2009-02-10 14:21:27 +00:00
Ilia Alshanetsky 986a933c82 MFB: Added path truncation E_NOTICE to let people now when path resolving
caused the file path to be truncated.
2009-02-10 14:18:46 +00:00
Sebastian Bergmann 08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00