]> git.pld-linux.org Git - packages/php.git/blame - php-curl-limit-speed.patch
Rediff patches.
[packages/php.git] / php-curl-limit-speed.patch
CommitLineData
f9fed404
AM
1diff -urNp -x '*.orig' php-5.2.17.org/ext/curl/interface.c php-5.2.17/ext/curl/interface.c
2--- php-5.2.17.org/ext/curl/interface.c 2021-10-23 19:05:53.836458431 +0200
3+++ php-5.2.17/ext/curl/interface.c 2021-10-23 19:05:56.283125097 +0200
4@@ -481,6 +481,14 @@ PHP_MINIT_FUNCTION(curl)
b73449d9
KT
5 REGISTER_CURL_CONSTANT(CURLOPT_TCP_NODELAY);
6 #endif
7 REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES);
8+
9+/* Added constants to support limiting the transfer speed in PHP */
10+/* Fixed by Tijnema (admin@tijnema.info) */
11+#if LIBCURL_VERSION_NUM > 0x070fff /* CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE are available since curl 7.16.0 */
12+ REGISTER_CURL_CONSTANT(CURLOPT_MAX_SEND_SPEED_LARGE);
13+ REGISTER_CURL_CONSTANT(CURLOPT_MAX_RECV_SPEED_LARGE);
14+#endif
15+
16 REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFMODSINCE);
17 REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE);
18 REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD);
f9fed404
AM
19@@ -1371,6 +1379,12 @@ static int _php_curl_setopt(php_curl *ch
20 case CURLOPT_REDIR_PROTOCOLS:
21 case CURLOPT_PROTOCOLS:
b73449d9
KT
22 #endif
23+/* Added case options to support limiting the transfer speed in PHP */
24+/* Fixed by Tijnema (admin@tijnema.info) */
25+#if LIBCURL_VERSION_NUM > 0x070fff /* CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE are available since curl 7.16.0 */
26+ case CURLOPT_MAX_SEND_SPEED_LARGE:
27+ case CURLOPT_MAX_RECV_SPEED_LARGE:
28+#endif
29 convert_to_long_ex(zvalue);
f9fed404
AM
30 #if LIBCURL_VERSION_NUM >= 0x71304
31 if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
This page took 0.081015 seconds and 4 git commands to generate.