[41478] trunk/base/src/pextlib1.0/curl.c

toby at macports.org toby at macports.org
Mon Nov 3 22:37:10 PST 2008


Revision: 41478
          http://trac.macports.org/changeset/41478
Author:   toby at macports.org
Date:     2008-11-03 22:37:10 -0800 (Mon, 03 Nov 2008)
Log Message:
-----------
set CURLOPT_MAXREDIRS to 50 to avoid infinite redirection

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/curl.c

Modified: trunk/base/src/pextlib1.0/curl.c
===================================================================
--- trunk/base/src/pextlib1.0/curl.c	2008-11-04 06:33:33 UTC (rev 41477)
+++ trunk/base/src/pextlib1.0/curl.c	2008-11-04 06:37:10 UTC (rev 41478)
@@ -269,6 +269,13 @@
 			break;
 		}
 
+		/* --max-redirs option, same default as curl command line */
+		theCurlCode = curl_easy_setopt(theHandle, CURLOPT_MAXREDIRS, 50);
+		if (theCurlCode != CURLE_OK) {
+			theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
+			break;
+		}
+
 		/* -f option */
 		theCurlCode = curl_easy_setopt(theHandle, CURLOPT_FAILONERROR, 1);
 		if (theCurlCode != CURLE_OK) {
@@ -519,6 +526,13 @@
 			break;
 		}
 
+		/* --max-redirs option, same default as curl command line */
+		theCurlCode = curl_easy_setopt(theHandle, CURLOPT_MAXREDIRS, 50);
+		if (theCurlCode != CURLE_OK) {
+			theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
+			break;
+		}
+
 		/* -f option */
 		theCurlCode = curl_easy_setopt(theHandle, CURLOPT_FAILONERROR, 1);
 		if (theCurlCode != CURLE_OK) {
@@ -692,6 +706,13 @@
 			break;
 		}
 
+		/* --max-redirs option, same default as curl command line */
+		theCurlCode = curl_easy_setopt(theHandle, CURLOPT_MAXREDIRS, 50);
+		if (theCurlCode != CURLE_OK) {
+			theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
+			break;
+		}
+
 		/* -f option */
 		theCurlCode = curl_easy_setopt(theHandle, CURLOPT_FAILONERROR, 1);
 		if (theCurlCode != CURLE_OK) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081103/fed6c7ab/attachment.html>


More information about the macports-changes mailing list