Commit Graph

66 Commits

Author SHA1 Message Date
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Kalle Sommer Nielsen
1063c8346b MFT: VC10 build support 2009-12-03 11:50:32 +00:00
Felipe Pena
7c989115c2 MFH:
- Added check for EWOULDBLOCK
- Using EWOULDBLOCK instead of EAGAIN by portability issues
(Related to #46917)
2009-01-07 20:21:46 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Pierre Joye
2620304003 - MFH:
- drop bindlib usage on windows
 - inet_pton, inet_ntop and inet_aton are always available (VC9 uses the CRT implementation, VC6 our own)
2008-08-23 19:22:10 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Elizabeth Marie Smith
4e339842fc Fix build on MSVC 2008 - channeling Wez 2007-10-09 21:53:44 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +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
foobar
ec940d4d5a - Fixed cacheing bug in PHP_SOCKADDR_SA_LEN macro
- Removed duplicate sa_len check from configure.in
- Unified the sockaddr tests into PHP_SOCKADDR_CHECKS macro
2005-07-14 00:12:26 +00:00
Ilia Alshanetsky
b36d4ae02c Added bindto socket context option. 2005-06-14 02:39:42 +00:00
Wez Furlong
99e290f882 Fix for Bug #24189: possibly unsafe select(2) usage.
We avoid the problem by using poll(2).

On systems without poll(2) (older bsd-ish systems, and win32), we emulate
poll(2) using select(2) and check for valid descriptors before attempting
to access them via the descriptor sets.

If an out-of-range descriptor is detected, an E_WARNING is raised suggesting
that PHP should be recompiled with a larger FD_SETSIZE (and also with a
suggested value).

Most uses of select(2) in the source are to poll a single descriptor, so
a couple of handy wrapper functions have been added to make this easier.

A configure option --enable-fd-setsize has been added to both the unix and
win32 builds; on unix we default to 16384 and on windows we default to 256.
Windows FD_SETSIZE imposes a limit on the maximum number of descriptors that
can be select()ed at once, whereas the unix FD_SETSIZE limit is based on the
highest numbered descriptor; 256 should be plenty for PHP scripts under windows
(the default OS setting is 64).

The win32 specific parts are untested; will do that now.
2004-09-17 12:44:56 +00:00
Hartmut Holzgraefe
b8f7d9f9f5 wrap all PHPAPI prototypes into BEGIN_EXTERN_C/END_EXTERN_C blocks
(else they won't be usable from C++ extensions)
2004-02-20 08:04:30 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Wez Furlong
12b0501f55 Counteract brain-death in Apache headers
(they #define strtoul to something that will break compilation,
and it successfully breaks the win32 IPv6 headers)
2003-12-18 11:26:00 +00:00
Wez Furlong
6b679cd6ef fix ipv6 stuff under vc6 2003-12-06 10:32:35 +00:00
Wez Furlong
dbb152b96a Detect and enable IPv6 support under win32.
The ws2tcpip.h header links to IPv6 functions dynamically
and the generated binary will run on win98 and later.
2003-12-06 00:00:31 +00:00
Wez Furlong
5e4eac57bd Export these so that ftp extension can be build as shared ext. 2003-12-02 23:13:43 +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
Edin Kadribasic
6e2743023b Win32 build fixes for openssl 2003-06-15 23:34:46 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Wez Furlong
349ce76f96 Tidy up stupid signed/unsigned issues with win32 by introducing a php_socket_t typedef. 2003-02-28 21:03:36 +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
foobar
08b5f6b2b9 - No need to include the ssl headers elsewhere but in ext/openssl
# ext/ftp doesn't use streams yet so it needs to include them.
2003-02-28 07:25:15 +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
foobar
8e3f23e3c0 ws fixes + missing $Id$ tags, headers added 2003-02-19 08:40:19 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Wez Furlong
f8486bc344 Fix for #19508 by poleson@verio.net. 2002-10-29 14:57:12 +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
0bcd2ccb2c A much better probable fix for #16114. 2002-10-13 23:43:21 +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
9d5bab5a0d EOF related fixes. 2002-10-05 10:59:35 +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
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
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
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
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
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
14a3911866 fix for bug #16168 2002-03-19 17:49:02 +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
effa6e8daa tidy up the headers (streams related) 2002-03-17 13:29:44 +00:00