Commit Graph

274 Commits

Author SHA1 Message Date
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Felipe Pena
5967fb194f - Fixed bug #66381 (__ss_family was changed on AIX 5.3) 2014-01-01 09:55:14 -02:00
Anatol Belski
d8dd4d9b02 fix header include
stddef.h is needed to have offsetof macros on windows (at least)
2013-07-18 15:28:20 +02:00
Gustavo Lopes
710150ccb7 socket: support unix paths in the abstract namespace
Those starting with '\0'.
2013-07-15 23:57:51 +02:00
Veres Lajos
227556c6a2 less serious compatAbility fixes 2013-07-15 00:17:35 -07:00
Stanislav Malyshev
1beb24bd6f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Implements feature Bug #63472 ability to set SO_BINDTODEVICE on socket.

Conflicts:
	ext/sockets/sockets.c
2013-06-23 15:26:14 -07:00
Damjan Cvetko
a0b4348abc Implements feature Bug #63472 ability to set SO_BINDTODEVICE on socket. 2013-06-23 15:20:54 -07:00
Anatol Belski
d565e8f0eb Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed error handling for ext/sockets under win
2013-05-16 19:29:25 +02:00
Anatol Belski
8dec06ea2a Fixed error handling for ext/sockets under win
WSAGetLastError() must be the very next call after a socket
function had an invalid return. Any function call inbetween
will clear the error information.
2013-05-16 19:23:31 +02:00
Gustavo Lopes
8687332e08 Fix bug #64506: fix build with --disable-ipv6 2013-05-08 19:58:27 +02:00
Gustavo Lopes
59ec22b370 sendrecvmsg_shutdown function moved to mshutdown
The function php_socket_sendrecvmsg_shutdown() should have been called in
MSHUTDOWN, not RSHUTDOWN.

Bug only on TSRM builds.

Should fix bug #64287.
2013-02-24 03:50:38 +01:00
Gustavo Lopes
189fbfd53b Fix ext/sockets build with phpize
Fixes bug #64285
2013-02-24 00:49:25 +01:00
Gustavo Lopes
91538e4e13 Cleanup some multicast code; fix for mac os x?
When I moved some stuff from sockets.c to multicast.c, I did not copy
some conditional defines for systems without the RFC 3678 API.

I moved such defines to multicast.h so both sockets.c and multicast.c
can benefit from them and I prefixed them with PHP_ so that it's less
confusing: now PHP_MCAST_* are defined to either the MCAST_* RFC 3678
APIs or to legacy APIs and MCAST_* always mean the (possibly undefined)
system definitions.
2013-02-17 22:42:58 +01:00
Gustavo Lopes
0110662ae9 Move macro back to .c file
Because it depends on a static function on that .c file.
2013-02-02 18:32:38 +01:00
Gustavo Lopes
7066cc7267 send/recvmsg() support for Windows 2013-02-02 16:38:09 +01:00
Gustavo Lopes
bd580db373 Build fixes; accept names for if_index 2013-02-02 16:38:08 +01:00
Gustavo Lopes
66ea024587 Support sticky IPV6_PKTINFO 2013-02-02 16:38:08 +01:00
Gustavo Lopes
b18bd8904e Rename some functions for consistency 2013-02-02 16:38:07 +01:00
Gustavo Lopes
51394f76a5 Move some multicast stuff to multicast.c 2013-02-02 16:38:07 +01:00
Gustavo Lopes
51e65667f5 Register extra MSG_* constants 2013-02-02 16:38:06 +01:00
Gustavo Lopes
131245474b Redactor to expose socket_import_file_descriptor() 2013-02-02 16:38:06 +01:00
Gustavo Lopes
b3effa60c7 Improve imported socket family detection
Also added constant SO_FAMILY.
2013-02-02 16:38:06 +01:00
Gustavo Lopes
806a6e6399 Add IPV6_UNICAST_HOPS option constant. 2013-02-02 16:38:05 +01:00
Gustavo Lopes
5e51c85143 Wrap recvmsg() and sendmsg()
This introduces two new functions:

int socket_recvmsg(resource $socket, array &$msghdr, int $flags)
int socket_sendmsg(resource $socket, array $msghdr, int $flags)

The arrays representing struct msghdr follow the native counterpart
closely: structs are mapped to arrays, fields to array elements whose
key is the name of the field without the prefix (e.g. "name" instead
of "msg_name") and array are mapped to sequential numeric PHP arrays.

Right now the only type of ancillary data supported is fot the
level/type pair IPPROTO_IPV6/IPV6_PKTINFO.

I also refactored out the name resolution functions and made
sockets_strerror() a global function.
2013-02-02 16:38:05 +01:00
Gustavo Lopes
e8f0e863ae Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix wrong blocking state being set
  Fix tests (Windows)
  Remove a Windows only warning
  Move & improve PHP_SOCKET_ERROR def
  Move some declarations to sockets.c
  Fix overbroad skipif include
2013-02-02 15:32:03 +01:00
Gustavo Lopes
ac6342bbc0 Fix wrong blocking state being set 2013-02-02 15:29:18 +01:00
Gustavo Lopes
9283b8aea4 Move & improve PHP_SOCKET_ERROR def 2013-02-02 15:29:11 +01:00
Gustavo Lopes
97d656fc82 Move some declarations to sockets.c 2013-02-02 14:06:23 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Lars Strojny
575b983703 Merge branch 'PHP-5.4' into PHP-5.5 2012-12-02 19:42:25 +01:00
Igor Wiedler
ec2a132f9c Bug #49341: Add SO_REUSEPORT support for socket_set_option()
This is a BSD-only feature, and it will only be available on BSD.
On other platforms the constant will simply not be set.
2012-12-02 18:56:57 +01:00
Anatoliy Belsky
bc9f8030c7 Fixed sockets ext build on win 2012-11-13 14:53:32 +01:00
Gustavo Lopes
e7e57aea0a Use if_nametoindex in Vista
I missed this instance in bf19838c.
2012-10-23 11:52:31 +02:00
Felipe Pena
074d361d64 - Fix the fix (typo s/AIX/_AIX/g) 2012-05-21 08:54:59 -03:00
Felipe Pena
ffe8303f24 - Fixed bug #62025 (__ss_family was changed on AIX 5.3) 2012-05-20 19:37:20 -03:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Gustavo André dos Santos Lopes
5759a440f8 - Small ajustments to some multicast options. 2011-11-26 17:48:52 +00:00
Felipe Pena
4168e0dfe4 - Fixed bug #60048 (sa_len a #define on IRIX)
patch by: china at thewrittenword dot com
2011-10-13 22:56:05 +00:00
Felipe Pena
4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Gustavo André dos Santos Lopes
7a402242bc - Fixed bug #55111 (sockets extension fails to compile on Mac OSX). 2011-07-02 12:03:32 +00:00
Gustavo André dos Santos Lopes
f99938c6ee - Fixed socket_import_stream returning NULL on some errors and FALSE on others 2011-06-28 10:27:29 +00:00
Gustavo André dos Santos Lopes
bc9c089f3a - Fixed ext/sockets build on Mac OS X (hopefully).
- Improvements in the multicast tests.
- Very light refactoring in sockets.c.
2011-06-11 20:20:50 +00:00
Felipe Pena
b60f6774dc - Fix the fix
# Arghh, copy and paste error :(
2011-05-24 00:10:00 +00:00
Felipe Pena
70f4069138 - Fixed stack buffer overflow in socket_connect().
Found by: Mateusz Kocielski, Marek Kroemeke and Filip Palian
2011-05-24 00:05:50 +00:00
Pierre Joye
27c0221dc9 - not used on win 2011-03-30 09:46:56 +00:00
Pierre Joye
f7249e7c5c - fix build, should fix that code too on non win (wondering if that part was working at all) 2011-03-30 09:46:20 +00:00
Pierre Joye
38bbbe3417 - attempt to fix build, 1st error 2011-03-30 09:42:21 +00:00
Gustavo André dos Santos Lopes
0de2e61cab - Added socket_import_stream().
- Fixed socket_strerror.phpt
- Made php_set_sock_blocking return FAILURE on fcntl error.
- Made socket_set_block()/socket_set_nonblock() emit warning on error.
2011-03-22 00:44:23 +00:00
Gustavo André dos Santos Lopes
c9d397d59f - Adding copyright headers to the new files, gotta do something about the
windows line endings too, but I'm separating the commits.
2011-03-20 02:03:29 +00:00