Commit Graph

315 Commits

Author SHA1 Message Date
Chris Wright
afc24da436 Remove cURL close policy related constants
These options don't do anything and they never have.

Refs:
  http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCLOSEPOLICY
  http://curl.haxx.se/mail/lib-2006-11/0301.html
2014-02-26 17:48:14 +00:00
Daniel Lowrey
a031dc06d9 Add openssl.cafile ini check when loading cainfo 2014-02-25 09:59:13 -07:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Adam Harvey
fba290c061 Allow CURLOPT_FOLLOWLOCATION to be used with open_basedir.
Newer versions of libcurl prevent file:// location response headers by default,
which means that the open_basedir check is unnecessary — the fact
CURLOPT_REDIR_PROTOCOLS can't set CURLPROTO_FILE with open_basedir enabled
means that there's no possibility of breaching the open_basedir restriction,
and this allows HTTP redirects to be followed automatically.

Implements FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or
safe_mode).
2013-09-10 11:42:42 -07:00
Christopher Jones
19476f51f2 Merge branch 'PHP-5.5'
* PHP-5.5:
  Reduce (some more) compile noise of 'unused variable' and 'may be used uninitialized' warnings.
  Update NEWS
2013-08-19 17:18:28 -07:00
Christopher Jones
d5979c88ea Reduce (some more) compile noise of 'unused variable' and 'may be used
uninitialized' warnings.
2013-08-19 17:17:54 -07:00
Adam Harvey
2a46fc0470 Merge branch 'PHP-5.5'
* PHP-5.5:
  Track created curl_slist structs by option so they can be updated in situ.

Conflicts:
	ext/curl/interface.c
2013-08-19 12:19:13 -07:00
Adam Harvey
69f12ad582 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Track created curl_slist structs by option so they can be updated in situ.

Conflicts:
	ext/curl/interface.c
2013-08-19 12:16:36 -07:00
Adam Harvey
aa7d3d8e6d Track created curl_slist structs by option so they can be updated in situ.
At present, when curl_setopt() is called with an option that requires the
creation of a curl_slist, we simply push the new curl_slist onto a list to be
freed when the curl handle is freed. This avoids a memory leak, but means that
repeated calls to curl_setopt() on the same handle with the same option wastes
previously allocated memory on curl_slist structs that will no longer be read.

This commit changes the zend_llist that was previously used to track the lists
to a HashTable keyed by the option number, which means that we can simply
update the hash table each time curl_setopt() is called.

Fixes bug #65458 (curl memory leak).
2013-08-19 12:01:04 -07:00
Felipe Pena
802a25e0c9 Merge branch 'PHP-5.5'
* PHP-5.5:
  - Fixed typo on condition
2013-06-25 21:53:42 -03:00
Felipe Pena
623386d799 - Fixed typo on condition 2013-06-25 21:53:20 -03:00
Pierrick Charron
74394733ed Merge branch 'PHP-5.5'
* PHP-5.5:
  Remove curl wrappers
2013-04-23 17:01:50 -04:00
Pierrick Charron
b79e65f268 Remove curl wrappers 2013-04-23 17:01:17 -04:00
Xinchen Hui
2794d455ea Merge branch 'PHP-5.5' 2013-04-04 19:31:21 +08:00
Xinchen Hui
01ca2bf8c3 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	ext/curl/interface.c
2013-04-04 19:31:14 +08:00
Xinchen Hui
185e5e15ae s ,CURL_WRAPPERS_ENABLE,CURL_WRAPPERS_ENABLED, 2013-04-04 19:28:17 +08:00
Xinchen Hui
bd6a90dac7 Merge branch 'PHP-5.5' 2013-04-03 10:17:49 +08:00
Xinchen Hui
6ace9c646b Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	ext/curl/interface.c
2013-04-03 10:15:41 +08:00
Xinchen Hui
d7f709a032 Add CURL_WRAPPERS_ENABLE constant
see http://news.php.net/php.internals/66871
2013-04-03 10:09:51 +08:00
Anatol Belski
9a85dca7a5 Merge branch 'PHP-5.5'
* PHP-5.5:
  fix free vs. curl_free
2013-02-17 20:29:58 +01:00
Anatol Belski
432d59ab55 fix free vs. curl_free 2013-02-17 20:29:20 +01:00
Stanislav Malyshev
24447dca5d post-5.5 changes for bug #46439 as described in the RFC 2013-01-28 22:26:59 -08:00
Stanislav Malyshev
a9d013bb02 Implement fix for bug #46439 - add CURLFile class for safer uploads 2013-01-28 22:22:59 -08:00
Pierrick Charron
f85e5950ab Improve resource management for curl handle
Previous implementation was using its own refcounting (uses field of
the php_curl struct). zend_list_add/remove already implements its own
refcount, so we don't need to use an other one.
2013-01-05 11:07:59 -05:00
Pierrick Charron
343a9199bb Remove passwd handler from struct when not needed
CURLOPT_PASSWDFUNCTION was removed in cURL 7.15.5, the passwd field
will not be used for version greater than this one
2013-01-01 21:12:02 -05: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
Pierrick Charron
722b8fb80e Add new curl options
Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION,
CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE,
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL.
2012-12-28 00:51:04 -05:00
Pierrick Charron
8b67981b67 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed #63859 Memory leak when reusing curl-handle
2012-12-27 13:37:11 -05:00
Pierrick Charron
ac3d227e28 Fixed #63859 Memory leak when reusing curl-handle
When CURLOPT_POSTFIELDS is called more than once on the same
curl handle, php/curl did not free the memory of the previous
post data. This commit will fix the problem unless the curl
handle was previously duplicated using the curl_copy_handle()
function in which case we can not know if the post data is
still in use or not by any curl handle
2012-12-27 13:31:55 -05:00
Pierrick Charron
33f44af1a7 New curl_pause() function
Add the curl_pause function (binding of curl_easy_pause).
Using this function, you can explicitly mark a running connection
to get paused, and you can unpause a connection that was
previously paused.
2012-12-23 17:13:49 -05:00
Pierrick Charron
4b4f3db731 Support for curl_strerror and curl_multi_strerror
Add the support for both curl_strerror and curl_multi_strerror.
Those function will return a string describing the error code
passed in the argument errornum
2012-12-23 15:45:39 -05:00
Pierrick Charron
64595a5d1a Add curl_multi_setopt and clean curl_share_setopt
curl_multi_setopt is now available and supports CURLMOPT_PIPELINING
and CURLMOPT_MAXCONNECTS
2012-12-23 14:59:41 -05:00
Pierrick Charron
ee453541ed Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Update NEWS file
  Fixed segfault due to libcurl connection caching
2012-12-22 19:10:35 -05:00
Pierrick Charron
b10a3b9466 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed segfault due to libcurl connection caching
2012-12-22 19:04:45 -05:00
Pierrick Charron
a2b6d9c104 Fixed segfault due to libcurl connection caching
Libcurl is doing connection caching. When easy handle is cleaned up,
if the handle was previously used by the curl_multi_api, the connection
remains open un the curl multi handle is cleaned up. Some protocols are
sending content like the FTP one, and libcurl try to use the
WRITEFUNCTION or the HEADERFUNCTION. Since structures used in those
callback are freed, we need to use an other callback to which avoid
segfaults.

Libcurl commit d021f2e8a00 fix this issue and should be part of 7.28.2
2012-12-22 19:03:24 -05:00
Pierrick Charron
e3c88d16b4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Update NEWS file
  Fixed bug #63352 (Can't enable hostname validation when using curl stream wrappers)
  CURL >= 7.28.0 no longer support value 1 for CURLOPT_SSL_VERIFYHOST)
2012-12-21 19:27:51 -05:00
Pierrick Charron
5499c7d201 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Update NEWS file
  Fixed bug #63352 (Can't enable hostname validation when using curl stream wrappers)
  CURL >= 7.28.0 no longer support value 1 for CURLOPT_SSL_VERIFYHOST)

Conflicts:
	ext/curl/interface.c
	ext/curl/tests/bug63363.phpt
2012-12-21 19:24:28 -05:00
Pierrick Charron
517f800277 CURL >= 7.28.0 no longer support value 1 for CURLOPT_SSL_VERIFYHOST)
Fixed bug #63795
2012-12-21 19:10:55 -05:00
Xinchen Hui
6b0299aafc Merge branch 'PHP-5.4' into PHP-5.5 2012-11-21 12:30:54 +08:00
Xinchen Hui
e54970aaf1 Unused variable copystr
copystr is declared again blow
2012-11-21 12:30:03 +08:00
John Jawed (JJ)
f68f31f121 Notice if CURLOPT_SSL_VERIFYHOST is set to true 2012-10-25 16:00:02 -04:00
John Jawed (JJ)
3b85d09de7 Notice if CURLOPT_SSL_VERIFYHOST is set to true 2012-10-25 12:22:23 -07:00
Pierrick Charron
70713a27b6 Add CURLOPT_READDATA which was removed by mistake
I did a check and this is the only one which was removed by mistake.
No other constants are available in 5.4 branch and not in master
2012-09-22 10:05:52 -04:00
Felipe Pena
dd9478e6c8 - Fixed compiler warnings 2012-08-27 08:56:54 -03:00
Pierrick Charron
101fd2d3fd Fix bad version for CURLINFO_CERTINFO
CURLINFO_CERTINFO is available since 7.19.1. The cURL extension
allow to use it since this same version but the internal function
create_certinfo used internally for CURLINFO_CERTINFO usage
is only usable for version greater than 7.19.1 which will cause
problem if the user is using the 7.19.1 cURL version
2012-08-26 09:03:45 -04:00
Pierrick Charron
9ab45d3edb Add missing constants in cURL 2012-08-25 01:21:17 -04:00
Pierrick Charron
e5ff3f18f5 Update bad versions for cURL constants
This was updated according to the cURL symbol tables located here :
http://curl.haxx.se/libcurl/c/symbols-in-versions.html
2012-08-24 18:04:16 -04:00
Pierrick Charron
4c83ecc754 Fixed bug #62912 (CURLINFO_PRIMARY_IP is not exposed)
CURLINFO_PRIMARY_* and CURLINFO_LOCAL_* where available in curl_getinfo
but the constant itself was not exposed to php userland
2012-08-24 10:16:40 -04:00
Pierrick Charron
2118ab9ab4 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62839
2012-08-16 14:51:28 -04:00