Commit Graph

27 Commits

Author SHA1 Message Date
Michael Wallner
5b277c4da0 add backlock socket context option for stream_socket_server(),
which had a hardcoded backlog of 5 at two occurrances
2010-03-11 16:37:24 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Felipe Pena
f61a06350a - Switching to TSRMLS_FETCH version 2009-11-16 10:36:27 +00:00
Felipe Pena
5411bb32a8 - Fixed bug #49936 (crash with ftp stream in php_stream_context_get_option())
(patch by Pierrick)
2009-11-15 20:30:57 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Ilia Alshanetsky
1b8a85415d Fixed Bug #39396 (stream_set_blocking crashes on Win32). 2007-02-24 15:48:40 +00:00
Antony Dovgal
7ad1c3c5f2 MFH: add trailing '\0' to stream hashes 2007-01-15 17:07:08 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Dmitry Stogov
03312cc0d9 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:58:58 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Wez Furlong
b7182e85c7 Fix the return value check too 2004-10-11 01:40:41 +00:00
Wez Furlong
7cb4e769ff check the correct flag for async connect 2004-10-11 01:30:19 +00:00
Wez Furlong
ae7285d658 Misc sendto/recvfrom tweaks that have been pending here for a while... 2004-07-31 10:56:55 +00:00
Wez Furlong
a44838e8a3 Fix a bug in the persistent socket liveness checks and feof(); they were
using the default socket timeout of 60 seconds before returning the socket
to the calling script.  The reason they were using that value is that the
same code is used for feof(), so the fix is allowing the caller to
indicate the timeout value for liveness checks.

A possible remaining issue now is that 0 second timeout[1] for pfsockopen
is possibly too short; it's impossible to specify a sane value for all
possible uses, so maybe we need a stream context or an .ini option to
control this, or maybe use the timeout value that was passed to
pfsockopen().

# [1] by timeout, I mean the time that PHP will wait for data on a
# persistent socket before deciding if a new connection should be made;
# NOT the timeout while waiting for a new connection to be established.
2004-02-04 22:46:44 +00:00
Wez Furlong
e1ae61802b Fix segfault for scripts like this:
<?php
pfsockopen("foo");
pfsockopen("foo");
?>
Where the transport fails to connect (since args are bogus);
the problem was that the persistent stream entry was not
correctly freed.
2004-01-27 22:40:44 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Wez Furlong
ab11c8c5ba MFB fix for #25597 2003-12-20 20:25:55 +00:00
Wez Furlong
37f135ceef Add stream_socket_sendto and stream_socket_recvfrom which work very much
like sendto() and recvfrom() syscalls.
2003-11-29 21:46:50 +00:00
Wez Furlong
3ee72aa5be port "liveness" checks and a couple of other things from the 4.3 branch.
Liveness checks are used to validate persistent socket connects when they
are re-used.
2003-11-27 17:39:01 +00:00
Wez Furlong
49228bd5e2 more size_t -> socklen_t.
Noticed by tychay@php.net
2003-07-02 21:11:35 +00:00
Wez Furlong
c0c20ef6f6 Fix for mips compiler 2003-06-28 11:06:11 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Wez Furlong
1b53a2d12e New user-space functions:
. stream_socket_client() - similar to fsockopen(), but more powerful.
  . stream_socket_server() - Creates a server socket.
  . stream_socket_accept() - Accept a client connection.
  . stream_socket_get_name() - Get local or remote name of socket.

Tidy up some leaks and debug printfs.
Move more streams functions into streamsfuncs.c and streamsfuncs.h.
2003-02-28 19:53:21 +00:00
Wez Furlong
203068d055 Fixup build for win32 2003-02-27 18:06:31 +00:00
Wez Furlong
fd61f69077 Another big commit (tm).
Main Changes:
- Implement a socket transport layer for use by all code that needs to open
  some kind of "special" socket for network or IPC.
- Extensions can register (and override) transports.
- Implement ftruncate() on streams via the ioctl-alike option interface.
- Implement mmap() on streams via the ioctl-alike option interface.
- Implement generic crypto API via the ioctl-alike option interface.
  (currently only supports OpenSSL, but could support other SSL toolkits,
  and other crypto transport protocols).

Impact:
- tcp sockets can be overloaded by the openssl capable sockets at runtime,
  removing the link-time requirement for ssl:// and https:// sockets and
  streams.
- checking stream types using PHP_STREAM_IS_SOCKET is deprecated, since
  there are now a range of possible socket-type streams.

Working towards:
- socket servers using the new transport layer
- mmap support under win32
- Cleaner code.

# I will be updating the win32 build to add the new files shortly
# after this commit.
2003-02-27 17:43:38 +00:00