Commit Graph

85 Commits

Author SHA1 Message Date
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Wez Furlong
90c478664a A Simple fix for Bug #12360 (fsockopen timeout doesn't work).
Analysis:
On systems with HAVE_GETADDRINFO and IPV6 support, php_hostconnect would
attempt to connect to each possible address that matched the requested IP.

If the remote host:port combination are dropping packets this would cause the
first connection to timeout (after waiting for the full timeout duration).

PHP would then attempt the second address and wait the full duration again.

Solution:
If the first connection attempt times out, abort the connection loop.
2002-12-22 13:55:45 +00:00
Wez Furlong
f8486bc344 Fix for #19508 by poleson@verio.net. 2002-10-29 14:57:12 +00:00
Ilia Alshanetsky
ec400b8d16 Silence compile warning, when compiling --with-openssl. 2002-10-19 17:05:08 +00:00
Ilia Alshanetsky
8ca0b28b6a Fixed a typo. 2002-10-19 16:50:07 +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
Wez Furlong
be5606504c Implement better SSL error handling. 2002-10-14 01:27:43 +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
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
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
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
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
Wez Furlong
9509c20941 remove chunk size setting code (it's now in streams.c).
Move timeout setting code.
2002-09-28 22:12:23 +00:00
Wez Furlong
696e0a2301 Implement persistent streams. (for pfsockopen).
Juggle some includes/definitions.
Tidy up streams use in ext/standard/file.c
2002-09-25 15:25:12 +00:00
Wez Furlong
c74b9faca5 Implement a default_socket_timeout and auto_detect_line_endings ini options.
Also move user_agent from BG to FG.
2002-09-23 18:12:39 +00:00
Wez Furlong
4d8a07d529 Implement read buffering in streams.
Eliminate similar code from network.c.
Implement fgets equivalent at the streams level, which can detect
the mac, dos and unix line endings and handle them appropriately.
The default behaviour is unix (and dos) line endings.
An ini option to control this behaviour will follow.
# Don't forget to make clean!
# I've done some testing but would appreciate feedback from
# people with scripts/extensions that seek around a lot.
2002-09-23 01:47:04 +00:00
Stefan Esser
714eb8069a made new ssl activate function the default. 2002-09-12 21:52:09 +00:00
Anantha Kesari H Y
1e09610f45 NetWare related changes/modifications 2002-09-09 11:23:11 +00:00
Stefan Esser
cbf5e3ca06 Added possibility to reuse an old SSL session id.
Ugly but needed for f.e.: debians ftpd-ssl
2002-09-08 22:26:11 +00:00
Sebastian Bergmann
e8b50bc834 Fix ZTS build. 2002-08-25 22:17:56 +00:00
Marcus Boerger
a1f7bb12f1 use php_error_docref() 2002-08-25 18:45:02 +00:00
Wez Furlong
5f9a5a7c8e Remove php_stream_sock_set_blocking and replace with
php_stream_set_option which can be used in a similar way as ioctl()
to set options for streams.

Current options include buffering and blocking support.

o Buffer control is support for stdio based streams.
o Blocking/non-blocking is supported for stdio and socket based streams.
2002-08-19 22:59:10 +00:00
Stig Venaas
fcc0380588 Added --enable-ipv6 and only look up AAAA in DNS when enabled 2002-08-17 13:56:39 +00:00
Dan Kalowsky
4feff54879 Correcting as per discussion with Iliaa and Edin on efnet://#php.bugs 2002-08-13 14:56:50 +00:00
Dan Kalowsky
1027dfcdd1 Bug Fix #16113, as reflective of a php-dev convo between wez and iliaa 2002-08-13 14:39:03 +00:00
Wez Furlong
94be838dc1 More verbosity when activating SSL on a socket fails. 2002-08-11 11:25:24 +00:00
Sebastian Bergmann
7c08781d50 Fix ZTS builds. 2002-08-10 03:03:03 +00:00
Wez Furlong
ccb5c84b6c Centralize some blocking socket related code.
# It's been a while since I wrote this!
2002-08-09 21:02:36 +00:00
Jason Greene
a64eceef59 Switch streams socket abstraction to use a timeval structure instead of an
integer to allow subsecond timeouts.

This supports the previous behavior of fsockopen()
Fixes bug #16261
2002-07-22 18:46:26 +00:00
Jason Greene
217ef0d115 Fix feof() on win32
Bug #18436
2002-07-19 20:34:35 +00:00
foobar
887e1ffe57 ws fix 2002-07-19 16:22:36 +00:00
Jason Greene
c6a36d585b @Impelemented timeout functionality, and fixed error handling of fsockopen() on win32
Also fixed error handling on unix (micropatch)

Closes Bug #14740
2002-06-11 03:55:28 +00:00
Wez Furlong
0989e7bb41 Remove this; it should not have been commited 2002-04-30 00:20:34 +00:00
Wez Furlong
37411dd674 Implement context option setting API.
Add/amend debugging code for sockets.
Add a flag that will help the http wrapper optimize itself when
it is not being used for include/require.
2002-04-30 00:16:00 +00:00
Wez Furlong
928bae9cf8 Make scheme part decoding rfc2396 compliant.
Change zlib:// and bzip2:// to compress.zlib:// and compress.bzip2://
Tidy up old socket/network code/comments.
2002-04-19 10:06:41 +00:00
Wez Furlong
ca6b88ef46 should not be there 2002-04-15 20:12:29 +00:00
Wez Furlong
50cf12ce4c Some minor tweaks and debugging for sockets. 2002-04-15 20:11:12 +00:00
Wez Furlong
e1d0a14790 Implement stream context and status notification system.
Bump the BC for zlib notice to a warning
# See my RFC to php-dev a few days ago
2002-04-10 22:42:32 +00:00
Wez Furlong
2539cbc74c Phase 3 of OO wrapper cleanup
# What was phase 2?
2002-03-28 00:49:00 +00:00
Wez Furlong
14a3911866 fix for bug #16168 2002-03-19 17:49:02 +00:00
Wez Furlong
67231e25e4 make feof more useful on network streams 2002-03-19 03:49:03 +00:00
Wez Furlong
33906e934a Fix for bug #10001: a timeout event prevents further reads.
The Bug DB has a patch that should be applied to fsock.c on the
4.2 branch.
2002-03-18 20:13:50 +00:00
Wez Furlong
48e902bacd Fix for bugs #16148, #11199, #10092:
fread from socket will never free memory.
This patch should also be applied to php_sockread_internal in
fsock.c in the 4.2 branch.
2002-03-18 19:42:19 +00:00
Wez Furlong
c9d5e13738 TSRMLS related work on streams, as discussed with Zeev.
# Should be the last "broad" commit for a while
# Don't forget to make clean ; make
2002-03-18 18:54:32 +00:00
Wez Furlong
d2d8762267 Streams now make more use of the memory manager, so tracking down
leaking streams should be easier.
# I hate these big commits
2002-03-17 22:50:59 +00:00
Wez Furlong
436e339bc7 Fix for Bug #16121: make unix socket names binary safe.
# Could be applied to 4.2 branch, but I don't have a working copy, and
# I don't think it's amazingly critical.
2002-03-17 13:19:27 +00:00
Wez Furlong
bed04279c3 Hopefully fix resource usage so that we have no leaks and don't segfault. 2002-03-16 14:39:51 +00:00