Gustavo Lopes [Sat, 2 Feb 2013 15:40:25 +0000 (16:40 +0100)]
Merge branch 'sendrecvmsg_rebase_55' into PHP-5.5
* sendrecvmsg_rebase_55: (31 commits)
Fix multicast.c not defining errno on Windows
Fix non-Windows build
send/recvmsg() support for Windows
Remove some pre-vista code
Revert "Payload of HOPLIMIT/TCLASS are 8-bit"
Ensure memory is initialized
Payload of HOPLIMIT/TCLASS are 8-bit
Fix buf in string -> int conv.
Build fixes; accept names for if_index
Refactoring: move stuff to new conversions.c
Support sticky IPV6_PKTINFO
Rename some functions for consistency
Destroy ancillary registry on shutdown
Move some multicast stuff to multicast.c
Fix mcast_ipv6_send test
Check return of fstat()
Fix build on Mac OS X
Register extra MSG_* constants
Add test for CMSG_RIGHTS
Add test for CMSG_CREDENTIALS message
...
I checked Linux and OpenBSD and both use integers to write the
IPV6_TCLASS messages and they don't force any endianness. This is
despite RFC 3542 explicitly saying the first byte of cmsg_data will
have the result. In any case, it doesn't make any difference in
little-endian archs.
Gustavo Lopes [Sun, 4 Nov 2012 23:38:23 +0000 (00:38 +0100)]
Added support for AF_UNIX messages
Added constants: SCM_RIGHTS, SCM_CREDENTIALS and SO_PASSCRED.
The function socket_cmsg_space() was modified to support message types with
variable size. Its new signature is:
int socket_cmsg_space(int $level, int $type, int $n)
where $n is the number of repetable elements that the message is composed of.
Gustavo Lopes [Thu, 1 Nov 2012 19:38:42 +0000 (20:38 +0100)]
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.
Gustavo Lopes [Sat, 2 Feb 2013 14:32:03 +0000 (15:32 +0100)]
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
Gustavo Lopes [Sat, 2 Feb 2013 14:31:44 +0000 (15:31 +0100)]
Merge branch 'sockets_54_improv' into PHP-5.4
* sockets_54_improv:
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
Remi Collet [Fri, 1 Feb 2013 18:23:25 +0000 (19:23 +0100)]
Fixed bug #64128 buit-in web server is broken on ppc64.
fdset management using bit operator is broken on non-x86 arch
and cause built-in server the enter an infinite loop of "select"
and never handle any request.
Nikita Popov [Fri, 1 Feb 2013 17:33:26 +0000 (18:33 +0100)]
Fix segfault when cloning generator with properties
Rule of thumb: Always implement the object clone handler rather
than the object storage clone handler. Actually I think we should
drop the latter. It's nearly never usable.
Daniel Lowrey [Wed, 30 Jan 2013 19:45:31 +0000 (14:45 -0500)]
Added ssl context option, "disable_compression"
The CRIME attack vector exploits TLS compression. This patch adds a stream context option
allowing servers to disable TLS compression for versions of OpenSSL >= 1.0.0 (which first
introduced the SSL_OP_NO_COMPRESSION option). A summary rundown of the CRIME attack can
be found at https://community.qualys.com/blogs/securitylabs/2012/09/14/crime-information-leakage-attack-against-ssltls
Thanks to @DaveRandom for pointing out the relevant section of code.
Nikita Popov [Wed, 30 Jan 2013 22:52:02 +0000 (23:52 +0100)]
Fix potential segfault when finally in a generator is run during shutdown
If a generator is destroyed in a finally block it will resume the generator to run that finally
block before freeing the generator. This was done in the object storage free handler.
Running user code in the free handler isn't safe though because the free handlers may be run
during request shutdown, already after several key components have been shut down.
This is avoided by doing the finally handling in the dtor handler. These handlers are run at the
start of the shutdown sequence.
ALeX Kazik [Fri, 18 Jan 2013 16:13:39 +0000 (17:13 +0100)]
Implemented Feature #60524 (sys_temp_dir)
Added a new configuration directive which allows it to change the
temporary directory, the default behavior is unchanged.
This is a useful option if you use all/some hosts inside of one .ini file
with sections and want to change the temp dir per user (maybe it's not
allowed to write outside the users home directory). Since the TMPDIR
variable affects the whole php that way can not be used for this scenario.