]> TLD Linux GIT Repositories - packages/php.git/blobdiff - php-curl-limit-speed.patch
- PHP_5_4 branch from PLD
[packages/php.git] / php-curl-limit-speed.patch
diff --git a/php-curl-limit-speed.patch b/php-curl-limit-speed.patch
new file mode 100644 (file)
index 0000000..8348dd4
--- /dev/null
@@ -0,0 +1,30 @@
+--- php-5.2.5.orig/ext/curl/interface.c        2008-03-26 17:05:19.000000000 +0100
++++ php-5.2.5/ext/curl/interface.c     2008-03-26 17:09:05.000000000 +0100
+@@ -462,6 +462,14 @@
+       REGISTER_CURL_CONSTANT(CURLOPT_TCP_NODELAY);
+ #endif
+       REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES);
++
++/* Added constants to support limiting the transfer speed in PHP */
++/* Fixed by Tijnema (admin@tijnema.info) */
++#if LIBCURL_VERSION_NUM > 0x070fff /* CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE are available since curl 7.16.0 */
++      REGISTER_CURL_CONSTANT(CURLOPT_MAX_SEND_SPEED_LARGE);
++      REGISTER_CURL_CONSTANT(CURLOPT_MAX_RECV_SPEED_LARGE);
++#endif
++
+       REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFMODSINCE);
+       REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE);
+       REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD);
+@@ -1288,6 +1296,12 @@
+ #if LIBCURL_VERSION_NUM > 0x070b01 /* CURLOPT_TCP_NODELAY is available since curl 7.11.2 */
+               case CURLOPT_TCP_NODELAY:
+ #endif
++/* Added case options to support limiting the transfer speed in PHP */
++/* Fixed by Tijnema (admin@tijnema.info) */
++#if LIBCURL_VERSION_NUM > 0x070fff /* CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE are available since curl 7.16.0 */
++              case CURLOPT_MAX_SEND_SPEED_LARGE:
++              case CURLOPT_MAX_RECV_SPEED_LARGE:
++#endif
+                       convert_to_long_ex(zvalue);
+                       error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
+                       break;