]> git.pld-linux.org Git - packages/php.git/blob - php-curl-limit-speed.patch
Release 41 (by relup.sh)
[packages/php.git] / php-curl-limit-speed.patch
1 diff -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)
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);
19 @@ -1371,6 +1379,12 @@ static int _php_curl_setopt(php_curl *ch
20                 case CURLOPT_REDIR_PROTOCOLS:
21                 case CURLOPT_PROTOCOLS:
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);
30  #if LIBCURL_VERSION_NUM >= 0x71304
31                         if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
This page took 0.042374 seconds and 3 git commands to generate.