Commit Graph

144 Commits

Author SHA1 Message Date
Sander Roobol
a207b641e5 Fix proto and #20137 2002-10-28 18:00:30 +00:00
Sterling Hughes
62d10bc969 make one-line read work on win32...
# The implementation of this function is brain-dead, but at least
# now its brain-dead on win32 too... ;-)
2002-10-28 03:05:04 +00:00
Rasmus Lerdorf
2ca6f26918 Kill warning 2002-10-04 18:01:52 +00:00
Jason Greene
06ad8620db Fix thread safety issue 2002-09-30 02:09:42 +00:00
Jason Greene
a8ca9932f4 Implement contstants on win32
@Implement platform independant socket error constants, which benefits error handling
2002-09-23 03:34:21 +00:00
Jason Greene
565492248a Fix crash bug and memory leak in vectors
#still need to revisit how these are done, i.e. they are not binary safe
2002-09-10 04:12:55 +00:00
foobar
f05db43a68 Fix bug: #19212 2002-09-04 14:30:36 +00:00
Jason Greene
b3a1998386 @socket_recvfrom is now binary safe (Jason)
Zero the structure so that when the tcp layer of the OS decides to ignore it,
we do not think we are getting a value
2002-08-28 06:15:13 +00:00
Jason Greene
1ce75e3a63 Implement socket errno values for UNIX based platforms.
They are all prefixed with SOCKET_ to preserve name space
Win32 will follow...
2002-08-25 23:28:42 +00:00
Jason Greene
980feb5e98 Nuke warnings on strict compilers 2002-08-16 14:23:27 +00:00
Jason Greene
0cd2d8bd38 Remove sleep workaround, and fix the actual win32 memory leak which
was occurring in the error reporting system. The reason why sleepex appeared
to be working was because it suppressed EWOULDBLOCK errors in the example
(which was non-blocking)
@Fix win32 memory leak in /ext/sockets that would occur on any error condition
@Fix host resolution error messages on win32
2002-07-07 07:01:17 +00:00
Markus Fischer
c15d83b9ed - Fix proto. 2002-06-25 06:24:45 +00:00
Harald Radi
a3c79eca49 workaround for a win32 memleak
# this definitely has to be revisited !
# maybe we should use winsock2 and overlapped IO
2002-06-15 16:04:59 +00:00
Harald Radi
f7bdde218e workaround for a win32 memleak
# this definitely has to be revisited !
# maybe we should use winsock2 and overlapped IO
2002-06-15 15:58:16 +00:00
Sascha Schumann
226e1ed246 As far as I can tell, the AC_CHECK_MEMBER could not succeed,
because it does not include <sys/socket.h> which is necessary
for the definition of struct msghdr.  This include file is not
part of ac_includes_default.

Regardless, AC_CHECK_MEMBER is a autoconf-2.5x macro and thus we
expand it here for 2.13 compatibility.
2002-05-12 17:28:12 +00:00
Jason Greene
969d7e5a82 Fix build on IRIX for both mips and gcc 2002-05-12 07:22:47 +00:00
Jason Greene
cfb285a391 Fix overflow 2002-05-08 15:30:04 +00:00
Jason Greene
d4b11fb33f Fix 10830, and 17074
FreeBSD requires the exact length of the socket type
2002-05-07 18:47:17 +00:00
Jason Greene
89c59569ba socket_write() should just use the standard socket error macro so that errors will be consistent if the macro ever changes 2002-05-02 16:45:22 +00:00
Markus Fischer
07efbff856 - Update protos for socket_read() and socket_write().
- Set last_error in socket_write().
2002-05-01 16:38:22 +00:00
Markus Fischer
ae5bc7c0f6 - Update protos for getpeer/getsock-name. 2002-05-01 16:08:50 +00:00
Jason Greene
38a6325178 Fix BYREF_FORCE that was not being read
Fix error message
2002-05-01 15:14:49 +00:00
Markus Fischer
1a5501ddfd - Rename setopt and getopt to set_option and get_option, provide alias. 2002-05-01 11:08:08 +00:00
Markus Fischer
a2fbdad20e - Fix couple of problems with socket_create_pair():
- Force fourth argument to be passed by reference
  - Since the argument is modified there is no need to force it to be an array
    since it's destroyed anyway
  - Only modify the argument if socketpair() was successfully
  - Fix string modified for error message message
  - Set global last_error when socketpair() fails
2002-05-01 10:41:10 +00:00
Markus Fischer
7ee9e9d9e5 - Add SOMAXCONN constant. 2002-05-01 09:25:26 +00:00
Markus Fischer
cc4ff9c3ac - WS fixes 2002-05-01 07:35:01 +00:00
Jason Greene
9a841d116b Changed socket_select to force reference copy, the older code would modify all references
@Fixed a bug in socket_select() that could cause unexpected behavior when using a statement
@ like $w=$e=array($sock);
@This change unfortunately prevents the use of constant values(NULL) for the socket array paramaters.
@Instead use a temporary variable or an expression with the leftmost member being a temporary variable.
@ ex. socket_select($w, $r, $e=NULL, 10);

Also fix small memory leak.
2002-05-01 04:46:59 +00:00
Markus Fischer
a369d06bea - Forgot to update proto 2002-04-30 22:03:51 +00:00
Markus Fischer
c1c1ee9f6e - Allow resetting the module global last_error too. 2002-04-30 22:01:06 +00:00
Markus Fischer
8cf30c79ff - Fix WS and CS a bit 2002-04-29 15:06:48 +00:00
Markus Fischer
c970490d28 - Store last errno in the module global 'last_error' implicitely
- Set the global 'last_error' explicitely for functions which can't return an
  error withing a single socket context (socket_create and socket_select)
- Modified socket_last_error() to return global modules last
  error if no socket resource is given
- Added a couple of more E_WARNING messages in case something
  goes foobar so the user isn't left alone in the dark.
2002-04-29 14:52:29 +00:00
Sascha Schumann
5cba3a99c2 extension converted automatically to PHP_NEW_EXTENSION. Manually confirmed 2002-03-12 16:44:00 +00:00
Jason Greene
cd4954b7b5 Fix WS 2002-03-11 01:24:42 +00:00
Jason Greene
494d2d0d5a Fix build on win32 2002-03-09 06:41:19 +00:00
Jason Greene
3c9c83640f Fixed bug where NULL specified in sec was not waiting infinately as it should
Fixed bug where socket_select was not producing an error message on error
Fixed bug where -1 was getting returned instead of FALSE in socket_recv(),
socket_send(), socket_sendto(), and socket_select()
2002-03-09 04:37:54 +00:00
Jason Greene
165a97c90f Sockets Rework Patch 3 of 3
Nuked all fd code
Rewrote socket_select to use arrays instead of the fd code
(This has the side-effect of fixing quite a few bugs)
2002-03-06 20:19:09 +00:00
Jason Greene
e228b16885 Socket Rework Patch 2
Redesigned socket_recv() as outlined on php-dev
Modified socket_last_error() to no longer clear the error
Added socket_clear_error()
Fixed socket_set_nonblock()
Added socket_set_block()
Fixed a proto
Saved 1 byte of RAM : )
2002-03-06 05:21:56 +00:00
Jason Greene
7d7b1ae9b5 Style Improvement 2002-03-05 03:45:23 +00:00
Jason Greene
c6c7380d88 Style mismatch: Jon's catch 2002-03-04 15:02:23 +00:00
Jason Greene
03baef7a3d Patch 1 of 3 (2 in 3 still in progress) of sockets rework
Abstracted string -> ipv4 value conversion which unifies all functions
Standardized Host Lookups
Fixed Broken host error values
Fixed error detection in sendmsg
Added some safety struct zeroing
Modified bind to consitentlyy use sockaddr_storage(not just for AF_UNIX)
#Note this could potentially break the build on other platforms, as I have
#not tested them yet (Will soon though)
2002-03-04 05:27:04 +00:00
Jason Greene
0a2438b057 Fix parse string
(Since arg6 is initialized at null this still catches the wrong param condition)
2002-02-15 17:33:08 +00:00
Frank M. Kromann
d036b10062 Fixing release and debug build on Win32 2002-02-13 23:27:45 +00:00
Jon Parise
539114339c Use socklen_t (instead of int) where appropriate. 2002-01-27 07:06:09 +00:00
Jon Parise
d7523c883b Because php_network.h includes <sys/socket.h>, it must be included after
_XPG4_2 is defined.

This fixes the build under Solaris 8.
2002-01-27 06:55:10 +00:00
Markus Fischer
98220d2a82 - Correct some protos. 2002-01-09 16:51:53 +00:00
Sterling Hughes
4afe145a10 Changed proto via Georg Richter's request. 2002-01-08 06:06:58 +00:00
Stig Venaas
6e1878b0fc Added some consts for arguments in network.c declarations. Moved
php_sockaddr_storage to php_network.h and added check for struct
sockaddr_storage
2002-01-06 11:54:19 +00:00
Jason Greene
2807e1742f Add myself as a maintainer 2001-12-14 05:58:28 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Hartmut Holzgraefe
7a3c3e85ad proto fix 2001-12-06 19:18:41 +00:00