Commit Graph

535 Commits

Author SHA1 Message Date
Xinchen Hui
942809909e Cleanup resource handling APIs 2015-02-02 13:23:16 +08:00
Stanislav Malyshev
141b14454c Merge branch 'PHP-5.6'
* PHP-5.6:
  Use better constant since MAXHOSTNAMELEN may mean shorter name
  use right sizeof for memset

Conflicts:
	ext/sockets/sockaddr_conv.c
	ext/standard/dns.c
2015-01-31 21:50:08 -08:00
Stanislav Malyshev
6a960b6d1b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Use better constant since MAXHOSTNAMELEN may mean shorter name
  use right sizeof for memset
2015-01-31 21:48:40 -08:00
Stanislav Malyshev
af1f867308 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Use better constant since MAXHOSTNAMELEN may mean shorter name
  use right sizeof for memset
2015-01-31 21:48:14 -08:00
Stanislav Malyshev
41bdd6e7cc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add mitigation for CVE-2015-0235 (bug #68925)
  Add mitigation for CVE-2015-0235 (bug #68925)
2015-01-31 19:12:20 -08:00
Stanislav Malyshev
882a375dba Add mitigation for CVE-2015-0235 (bug #68925) 2015-01-31 19:10:52 -08:00
Stanislav Malyshev
457367e0b6 Add mitigation for CVE-2015-0235 (bug #68925) 2015-01-31 19:04:55 -08:00
Anatol Belski
6895cf6e69 nmake install missing header 2015-01-30 09:24:18 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
3ca0ca1548 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (102 commits)
  fix dir separator in test
  fix TS build
  fix TS build
  Better fix for bug #68446
  Revert "Merge remote-tracking branch 'origin/PHP-5.6'"
  Revert NEWS and set test to XFAIL
  Revert "Fix bug #68446 (bug with constant defaults and type hints)"
  Improved zend_hash_clean() and added new optimized zend_symtable_clean()
  Use inline version of zval_ptr_dtor()
  Added new optimized zend_array_destroy() function
  Moved i_zval_ptr_dtor() from zend_execute.h to zend_variables.h
  fix REGISTER_NS_*_CONSTANT macros
  Removed useless assert. EG(uninitialized_zval) can't be refcounted.
  Use specialized destructors when types of zvals are known.
  move tests into proper place
  Improved assignment to object property
  Reuse zend_assign_to_variable() in zend_std_write_property()
  cleanup comments from svn/cvs era
  fix dir separator in test
  fork test for windows
  ...
2014-11-26 08:17:35 +01:00
Stanislav Malyshev
529e195778 Merge branch 'pull-request/898'
* pull-request/898:
  add php_create_socket/php_destroy_socket PHP_SOCKETS_API to abel to create socket ressource in other ext
2014-11-23 15:23:01 -08:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Rasmus Lerdorf
96c5c1ef59 Fix skipif test here 2014-11-10 10:42:57 -08:00
Rasmus Lerdorf
bff7dc70d8 Fix skipif test here 2014-11-10 10:42:17 -08:00
Rasmus Lerdorf
1e5077d1e8 Fix skipif test here 2014-11-10 10:41:18 -08:00
Mathieu CARBONNEAUX
a0909f0a12 add php_create_socket/php_destroy_socket PHP_SOCKETS_API to abel to create socket ressource in other ext 2014-11-10 12:31:21 +01:00
Anatol Belski
c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski
08b2638275 convert ext/sockets to work with the static tsrm cache pointer 2014-10-05 20:48:32 +02:00
Anatol Belski
d624b0d5eb Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (26 commits)
  Micro optimization
  Drop unused INIT_STRING opcode
  Drop unused RAISE_ABSTRACT_ERROR opcode
  CT substitute unqualified true/false/null in namespaces
  Fix a couple compile warnings
  fix test filename
  one more test to illustrate transfer of an arbitrary data amount throug pipes
  fix tests on linux
  better test cleanup
  Use more readable inline functions
  increase the polling period to not to break existing behaviours
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever
  Fixed segfault
  Set an LDAP error code when failing ldap_bind due to null bytes
  Fix segmentation fault in debug_backtrace()
  Drop support for GMP 4.1
  Make gmp_setbit and gmp_clrbit return values consistent
  removed *.dsw and *.dsp files
  Opcache compatibility for coalesce operator
  ...
2014-10-01 01:33:46 +02:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +02:00
Anatol Belski
169701a64c cleanup TSRMLS_FETCH in ext/sockets 2014-09-26 21:09:15 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Florian MARGAINE
8eb7e7bf7f Merge branch 'master' into issue-67910
Conflicts:
	README.PARAMETER_PARSING_API
	ext/gmp/tests/001.phpt
2014-09-20 10:09:21 +02:00
Florian MARGAINE
cf0303e782 Replaces php5 with php7, without whitespace changes. 2014-09-20 10:01:44 +02:00
Nikita Popov
37aaccad7d Use inline functions for most of smart_str
smart_str_free_ex no longer exists, always use smart_str_free instead.

smart_str_alloc no longer requires a newlen variable to be in scope,
instead it returns the new length.
2014-09-19 23:39:07 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Nikita Popov
e06f5f0df8 Drop some unsafe-looking casting code from ext/socket
ZVAL_COPY before convert_to_string is probably not right.
2014-09-05 11:35:41 +02:00
Xinchen Hui
8002e2c06a Fixed discards qualifiers from pointer target type 2014-09-05 09:31:05 +08:00
Anatol Belski
a3f82ae0ee fix expected warning in test 2014-08-31 14:02:31 +02:00
Anatol Belski
6db8d4f829 's' works with size_t round 3 2014-08-27 20:49:36 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
202e8db1dc fixed several long vs zend_long casts 2014-08-26 11:26:53 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
70de6180d5 fixes to %pd format usage 2014-08-24 02:35:34 +02:00
Anatol Belski
2da1c805ec ported ext/sockets 2014-08-19 13:22:27 +02:00
Anatol Belski
63d3f0b844 basic macro replacements, all at once 2014-08-19 08:07:31 +02:00
Xinchen Hui
f7f411e4e2 It's okey for use a stack value here (deleted immediately after use) 2014-08-14 12:26:45 +08: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
1222f51ebd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
2014-06-18 00:14:18 +03: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
Xinchen Hui
3cbdcdc2c8 Fixed several tests failes 2014-05-18 12:02:54 +08: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
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Felipe Pena
37897e258d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  - Fixed bug #66381 (__ss_family was changed on AIX 5.3)
2014-01-01 09:56:49 -02: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
f0cf312d8c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  added missing prototype
2013-12-11 14:16:07 +01:00
Anatol Belski
edf601a41f added missing prototype 2013-12-11 14:15:40 +01:00
Felipe Pena
a2f478cd94 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  - Fixed bug #65923 (ext/socket assumes AI_V4MAPPED is defined)
2013-11-30 11:40:42 -02:00
Felipe Pena
78f69a2b4f - Fixed bug #65923 (ext/socket assumes AI_V4MAPPED is defined) 2013-11-30 11:39:57 -02:00
Rasmus Lerdorf
259c74654c Merge branch 'PHP-5.5'
* PHP-5.5:
  Trivial Coverity fix
2013-10-19 17:56:21 -07:00
Rasmus Lerdorf
4a205092f7 Trivial Coverity fix 2013-10-19 17:55:34 -07:00
Michael Wallner
bc16dfda1f Merge branch 'PHP-5.5'
* PHP-5.5:
  fix bug #65808 	the socket_connect() won't work with IPv6 address
  5.4.22-dev now
2013-10-02 15:56:09 +02:00
Michael Wallner
2ba3926815 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix bug #65808 	the socket_connect() won't work with IPv6 address
  5.4.22-dev now

Conflicts:
	configure.in
	ext/sockets/sockets.c
	main/php_version.h
2013-10-02 15:55:38 +02:00
Michael Wallner
9209c19f8f fix bug #65808 the socket_connect() won't work with IPv6 address 2013-10-02 15:19:25 +02:00
Anatol Belski
c6651942ce Merge branch 'PHP-5.5'
* PHP-5.5:
  fix header include
  new NEWS for next release
2013-07-18 15:29:17 +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
2443df37fd Merge branch 'PHP-5.5'
* PHP-5.5:
  NEWS for 710150c and e2744f1
  socket: support unix paths in the abstract namespace
  socket: fix bug #65260 (SCM_RIGHTS)
2013-07-16 00:03:00 +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
Gustavo Lopes
e2744f1aa3 socket: fix bug #65260 (SCM_RIGHTS)
The data for messages of type SOL_SOCKET/SCM_RIGHTS was not being
passed correctly. There were actually two bugs: (1) the number of file
descriptors being passed was being read incorrectly (the length of the
cmsg array was being read instead of that of its 'data' element), as a
result it was generally being reported as always three elements
('level', 'type' and 'data') and (2) the allocated block for writing
the file descriptors was being acessed incorrectly because a 1-based
counter was being used as if it was 0-based.

Any of these two bugs would probably be enough to cause heap
corruption.
2013-07-15 23:57:49 +02:00
Veres Lajos
b79b13b4ef less serious compatAbility fixes 2013-07-15 00:21:39 -07:00
Veres Lajos
d17e8ac32f less serious compatAbility fixes 2013-07-15 00:19:39 -07:00
Veres Lajos
227556c6a2 less serious compatAbility fixes 2013-07-15 00:17:35 -07:00
Stanislav Malyshev
e02b41d25c Merge branch 'PHP-5.5'
* PHP-5.5:
  Implements feature Bug #63472 ability to set SO_BINDTODEVICE on socket.
2013-06-23 15:26:30 -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
bc656cde04 Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed error handling for ext/sockets under win
2013-05-16 19:29:42 +02: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
ab38bf1931 Merge branch 'PHP-5.5'
* PHP-5.5:
  Fix bug #64506: fix build with --disable-ipv6
2013-05-08 19:57:23 +02:00
Gustavo Lopes
6f3c3862ca Fix bug #64506: fix build with --disable-ipv6 2013-05-08 19:56:40 +02:00
Sara Golemon
e836f8e38f Oops 2013-04-30 19:43:52 -07:00
Sara Golemon
e217db8e69 Harden loopback tests
These tests depend on being able to bind port 31337.
Try a range of ports until one binds or we give up trying.
2013-04-30 19:30:55 -07:00
Xinchen Hui
082741814a skip if no IPv6 support 2013-03-05 17:18:13 +08:00
Xinchen Hui
e5d0dc24d2 Fix tests temporary
seems IPV6_PKTINFO are not avaiable in some OS
2013-03-05 16:56:00 +08:00
Xinchen Hui
1978dae309 Skip test on Apple 2013-03-05 14:02:28 +08:00
Xinchen Hui
3f67d5ae43 Revert "Fixed Bug #64340 (sockets tests failed) Patch by Reeze"
build break, will only leave the test script fix first

This reverts commit f2246f352f.
2013-03-05 13:58:20 +08:00
Xinchen Hui
46e612ada4 Merge branch 'PHP-5.4' into PHP-5.5 2013-03-03 11:25:29 +08:00
Xinchen Hui
9bda6a25a5 Fix test (skip on unable to create socket) 2013-03-03 11:24:45 +08:00
Xinchen Hui
f2246f352f Fixed Bug #64340 (sockets tests failed) Patch by Reeze
Add __APPLE_USE_RFC_3542 for OS X 10.7 because IPv6 options are incompatible with RFC 2292.
2013-03-03 10:51:04 +08: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
8771c265a4 Fix test on Windows.
Windows complains of invalid parameters because the socket is not bound.
The test expected the error to be EAGAIN/EWOULDBLOCK. Moved the call down,
after the socket is bound.
2013-02-03 02:03:00 +01: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
03b1da5d7a php_strerror in ext/sockets renamed in 5.5 2013-02-02 18:39:47 +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