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

1666 Commits

Author SHA1 Message Date
Ilia Alshanetsky 4b83b189fe Fixed bug #19971 (optimized the file() function).
The file() function is now also binary safe.
2002-10-18 20:39:49 +00:00
Wez Furlong 7de1f45aaa Revert my last bogus commit.
Change the comparison to something that is less likely to inspire me to
make the same mistake again...
2002-10-18 17:14:32 +00:00
Wez Furlong e0c0264935 Improve EOF detection. Fixes #19970. 2002-10-18 12:15:04 +00:00
Ilia Alshanetsky 5ce6d653b8 Fixed bug #19921. (memory leak introduced by me in rev 1.492) 2002-10-16 16:52:08 +00:00
Sebastian Bergmann 9f158fc9c0 Revert. Again. 2002-10-16 14:53:34 +00:00
Sebastian Bergmann 49e106d3d3 Patch by Urs Gehrig <urs@circle.ch>. 2002-10-16 07:37:28 +00:00
Wez Furlong 2f6952c936 Nope, that last one wasn't a leak in main/streams.c, it was
file_get_contents misinterpreting the result...
2002-10-15 16:45:26 +00:00
Wez Furlong fa1f06b69f Fix mem leak for zero-byte files. 2002-10-15 16:38:11 +00:00
Wez Furlong 842b5554e0 Some buffer paranoia.
Also, make feof() detection safer (ala recent changes to zlib extension).
2002-10-15 16:04:46 +00:00
Ilia Alshanetsky bf51192d67 Fixed possible memory leaks. 2002-10-15 02:05:27 +00:00
Wez Furlong 6890f98e70 Fix leak, and avoid initialization problems where retval is re-used
within a function.
2002-10-15 01:57:19 +00:00
Sebastian Bergmann 64a22c8a3e Revert to 1.34. 2002-10-14 16:14:18 +00:00
Sebastian Bergmann 276b314ed3 Whitespace fixes. 2002-10-14 05:56:03 +00:00
Sebastian Bergmann 2e68e0beba Fix Win32 build. 2002-10-14 05:54:15 +00:00
Wez Furlong 106631fce1 *cough*
Fix inverted logic for the assert.
2002-10-14 05:38:50 +00:00
Wez Furlong 86e60a2d7a @- fgets($fp) (with no length parameter) now uses a buffer as long as the
@  the next line available from the $fp. Previously, there was a 1KB limit.
@  (Wez)
2002-10-14 02:28:35 +00:00
Wez Furlong be5606504c Implement better SSL error handling. 2002-10-14 01:27:43 +00:00
Wez Furlong 483f355d30 Fix stream_eof result interpretation (and thus the user-streams test). 2002-10-14 00:16:02 +00:00
Wez Furlong 2d97f4d4c7 Remove some old code. 2002-10-13 23:43:46 +00:00
Wez Furlong 0bcd2ccb2c A much better probable fix for #16114. 2002-10-13 23:43:21 +00:00
Wez Furlong bc0948bbda Probable fix for #16114 2002-10-13 23:21:05 +00:00
Wez Furlong 5f7c347f17 Fix a nasty nasty bug:
When not enough data to satisfy a read was found in the buffer, fgets modifies
the buf pointer to point to the position to store the next chunk.  It then
returned the modified buf pointer, instead of a pointer to the start of the
buffer.

Also added some infrastructure for making fgets grow the buffer on-demand to
the correct line-size.  Since streams uses reasonable chunk sizes, the
performance of the realloc's should be pretty good; in the best case, the line
is already found completely in the buffer, so the returned buffer will be
allocated to precisely the correct size.

In the worst case, where the buffer only contains part of the line, we get a
realloc per buffer fill. The reallocs are either the size of the remainder
of the line, or the chunk_size (if the buffer sill does not contain a complete
line).  Each realloc adds an extra byte for a NUL terminator.

I think this will perform quite well using the default chunk size of 8K.
2002-10-13 22:52:33 +00:00
Wez Furlong 70b796b143 (php_socket_errno) win32 errno compatible macro.
(php_socket_strerror) win32 compatible strerror replacement.
Add an E_NOTICE when a socket write fails.
2002-10-13 22:01:40 +00:00
Shane Caraveo 96b9c0a523 make php_import_environment_variables overwritable so fastcgi can correctly
set $_ENV.
2002-10-13 08:38:09 +00:00
Wez Furlong 4308a399b9 paranoia 2002-10-12 02:56:34 +00:00
Wez Furlong 258aa4d239 Write in blocks of the current chunk_size for a stream.
Should resolve problems with network writes.
2002-10-12 02:31:42 +00:00
Edin Kadribasic 9f4abb7ae4 Revert Stig's patch. Windows build should work again. 2002-10-11 09:20:38 +00:00
Sebastian Bergmann 5f56185a62 Break it again (after 4.3.0-pre1 :-) 2002-10-10 19:08:13 +00:00
Andrei Zmievski 3b32aa7d33 Back to 4.3.0-dev. 2002-10-10 19:07:12 +00:00
Sebastian Bergmann f2155df039 Revert to revision 1.13 for 4.3.0-pre1. 2002-10-10 17:45:36 +00:00
Andrei Zmievski bb4aefacd0 Update to 4.3.0-pre1. 2002-10-10 17:34:12 +00:00
foobar 8f92778136 revert version here too.. 2002-10-08 19:44:04 +00:00
Stig Bakken 231efd186f * make these variables configurable from environment on Windows:
PEAR_INSTALLDIR           PHP_BINDIR      PHP_CONFIG_FILE_PATH
  PHP_CONFIG_FILE_SCAN_DIR  PHP_DATADIR     PHP_EXTENSION_DIR
  PHP_INCLUDE_PATH          PHP_LIBDIR      PHP_LOCALSTATEDIR
  PHP_PREFIX                PHP_SYSCONFDIR
2002-10-08 01:04:52 +00:00
Stefan Esser 46f4a07d1c Closing protected variables hole 2002-10-07 11:23:24 +00:00
Zeev Suraski 1143a7023c Whitespace 2002-10-07 11:21:06 +00:00
Sascha Schumann 88b2d8bb8f stdio buffers data in user land. By calling fflush(3), this
data is sent to the kernel using write(2). fsync'ing a
file descriptor is not required -- writing to a fd has the same
affect as calling fflush after each fwrite.
2002-10-07 03:12:06 +00:00
Wez Furlong 510f3b0305 Try to ensure that we return the number of bytes requested during fread(). 2002-10-06 23:27:53 +00:00
Zeev Suraski df55f35798 Revert the implicit_flush mess.
Do not revert it again under any circumstances!

Yasuo/anybody else - if there are issues with implicit_flush, please inform
me and I will fix them.
2002-10-06 12:02:53 +00:00
Zeev Suraski de36720e0e Begin the cleanup - remove ob_flush_all() 2002-10-06 09:06:24 +00:00
Andrei Zmievski f7ef0ccd17 Change HEAD version to 4.4.0-dev. 2002-10-05 20:37:12 +00:00
Wez Furlong 9d5bab5a0d EOF related fixes. 2002-10-05 10:59:35 +00:00
Wez Furlong 077fe52d8b This seems to resolve the issues with fgets.
I've moved EOF detection into the streams layer; a stream reader
implementation should set stream->eof when it detects EOF.
Fixed test for user streams - it still fails but that is due to an output
buffering bug.
2002-10-05 10:35:13 +00:00
Brian France 3340e82508 Fixed a problem where opendir with <path>/ and having <path>/ in
open_basedir ini option didn't work.  It was removing the trailing
        slashes and then addeding it back to only one of the string,
        now it adds it back to to both if needed.
2002-10-04 22:16:16 +00:00
Sascha Schumann bfd2a857b2 Fix EOF cases
Noticed by: Ilia
2002-10-04 19:48:59 +00:00
Sascha Schumann 1918011c01 Interrupt loop, if the stream op fails. 2002-10-04 19:36:09 +00:00
Sascha Schumann 5e97e66abb Nuke warning 2002-10-04 19:20:13 +00:00
Sascha Schumann a4ec211e9e Add a few notes 2002-10-04 19:08:43 +00:00
Wez Furlong 9c5883bdf6 replace dont_block with a flag. 2002-10-04 18:59:34 +00:00
Ilia Alshanetsky 08645d53c0 Fixed bug #19746 2002-10-04 18:44:47 +00:00
Sascha Schumann 4f7e6dadd8 Improve the general behaviour of stream_gets and fix its semantics
with regard to sockets. The behaviour should be aligned with PHP 4.2 now.
This has been verified to some degree.

If the underlying stream operations block when no new data is readable,
we need to take extra precautions.

If there is buffered data available, we check for a EOL. If it exists,
we pass the data immediately back to the caller. This saves a call
to the read implementation and will not block where blocking
is not necessary at all.

If the stream buffer contains more data than the caller requested,
we can also avoid that costly step and simply return that data.
2002-10-04 18:21:40 +00:00