Commit Graph

26 Commits

Author SHA1 Message Date
Anatol Belski
63d3f0b844 basic macro replacements, all at once 2014-08-19 08:07:31 +02:00
Dmitry Stogov
b108267f2c Merge branch 'master' into phpng
* master: (41 commits)
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  NEWS
  Fix Request #67453 Allow to unserialize empty data.
  Update copyright year to 2014
  Update copyright year for re2c generated files
  Update copyright year to 2014
  Update copyright year for re2c files as well
  Fix patch for bug #67436
  fix failed test
  Fix test on modern distro where old unsecure algo are disabled in openssl config. Testing recent algo should be enough to check this function.
  Added tests for bug 67436
  Fixed wrong XFAIL test - already fixed
  Fix typo in Bug #67406 NEWS entry
  Fix typo in Bug #67406 NEWS entry
  ...

Conflicts:
	Zend/zend_compile.c
	ext/session/session.c
	ext/standard/array.c
	ext/standard/http_fopen_wrapper.c
	tests/classes/bug63462.phpt
2014-06-18 17:50:27 +04:00
Lior Kaplan
728c554f93 Update copyright year to 2014 2014-06-18 00:12:33 +03:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Pierre Joye
c0bd24b502 Z_TYPE_PP > Z_TYPE_P 2014-05-17 05:44:26 +02:00
Xinchen Hui
489da59b08 Refactoring socket (only compilable now) 2014-05-17 10:23:46 +08:00
Gustavo Lopes
8687332e08 Fix bug #64506: fix build with --disable-ipv6 2013-05-08 19:58:27 +02:00
Gustavo Lopes
6f3c3862ca Fix bug #64506: fix build with --disable-ipv6 2013-05-08 19:56:40 +02:00
Gustavo Lopes
af1b90d62b Fix bug and hopefully build on WinSDK 6.1
There build was failing on rmtools on the sockets extension for two reasons:

  1. IPV6_TCLASS and IPV6_RECVTCLASS not being defined. These are probably
  recent additions to SDK. Windows 7 doesn't event seem to have complete
  support for IPV6_TCLASS, not accepting in WSASendMsg(). The parts that
  needed this constant were not guarded by #ifdefs. They are now.

  2. The constants EWOULDBLOCK and EINPROGRESS not being defined. These
  were only defined in php_network.h, outside of the extension, and not
  all source files included this header. Nevertheless, a macro defined in
  php_sockets.h needed these constants. When this macro was used in files
  that did not include php_network.h, the compilation would fail.
  Surprisingly, the build did not fail when using the 7.1 Windows SDK
  (more likely, the CRT headers used in VC10), as somehow errno.h was
  being included through some other standard header. This would make the
  constant EWOULDBLOCK defined; however, it would be defined to the wrong
  value. In the winsock context, WSAEWOULDBLOCK should be used instead.
  Because we have difficulty using Windows-only constants in the code, we
  (re)define EWOULDBLOCK to WSAEWOULDBLOCK. This has the obvious
  disavantage we may miss problems like this again in the future.
2013-02-03 01:36:14 +01:00
Gustavo Lopes
7066cc7267 send/recvmsg() support for Windows 2013-02-02 16:38:09 +01:00
Gustavo Lopes
95f8d34f9c Revert "Payload of HOPLIMIT/TCLASS are 8-bit"
This reverts commit 61a5ec7381ba5388a52926779fe3f58af0caea83.

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.
2013-02-02 16:38:08 +01:00
Gustavo Lopes
f10baf14ed Payload of HOPLIMIT/TCLASS are 8-bit 2013-02-02 16:38:08 +01:00
Gustavo Lopes
bd580db373 Build fixes; accept names for if_index 2013-02-02 16:38:08 +01:00
Gustavo Lopes
4414b33abd Refactoring: move stuff to new conversions.c 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
8fb1aa6184 Destroy ancillary registry on shutdown 2013-02-02 16:38:07 +01:00
Gustavo Lopes
5bf7b08efd Check return of fstat() 2013-02-02 16:38:07 +01:00
Gustavo Lopes
190a0ed713 Fix build on Mac OS X
By deactivating unsupported features on this OS.
2013-02-02 16:38:07 +01:00
Gustavo Lopes
7fc4671df9 Add test for CMSG_CREDENTIALS message 2013-02-02 16:38:06 +01:00
Gustavo Lopes
a85d7f28f6 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.
2013-02-02 16:38:06 +01:00
Gustavo Lopes
17540788ad Added missing return statements 2013-02-02 16:38:06 +01:00
Gustavo Lopes
73ab2385cb Support for IPV6_HOPLIMIT and IPV6_TCLASS 2013-02-02 16:38:05 +01:00
Gustavo Lopes
b27c22d627 Fix bug in from_zval_write_control_array() 2013-02-02 16:38:05 +01:00
Gustavo Lopes
b06f00477c Fix bug converting zval sockaddr
The bug ocurred when the family was not specified but was instead guessed.
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