Index: branches/new-upload/phase3/includes/UploadFromUrl.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | * Returns true if there was an error, false otherwise |
56 | 56 | */ |
57 | 57 | private function curlCopy() { |
58 | | - global $wgOut; |
| 58 | + global $wgOut, $wgCopyUploadTimeout; |
59 | 59 | |
60 | 60 | # Open temporary file |
61 | 61 | $this->mCurlDestHandle = @fopen( $this->mTempPath, "wb" ); |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | |
67 | 67 | $ch = curl_init(); |
68 | 68 | curl_setopt( $ch, CURLOPT_HTTP_VERSION, 1.0); # Probably not needed, but apparently can work around some bug |
69 | | - curl_setopt( $ch, CURLOPT_TIMEOUT, 60*60); # 1 hour timeout |
| 69 | + curl_setopt( $ch, CURLOPT_TIMEOUT, $wgCopyUploadTimeout); # 1 hour timeout |
70 | 70 | curl_setopt( $ch, CURLOPT_LOW_SPEED_LIMIT, 512); # 0.5KB per second minimum transfer speed |
71 | 71 | curl_setopt( $ch, CURLOPT_URL, $this->mUrl); |
72 | 72 | curl_setopt( $ch, CURLOPT_WRITEFUNCTION, array( $this, 'uploadCurlCallback' ) ); |
Index: branches/new-upload/phase3/includes/DefaultSettings.php |
— | — | @@ -428,6 +428,8 @@ |
429 | 429 | $wgCacheSharedUploads = true; |
430 | 430 | /** Allow for upload to be copied from an URL. Requires Special:Upload?source=web */ |
431 | 431 | $wgAllowCopyUploads = false; |
| 432 | + |
| 433 | +$wgCopyUploadTimeout = 30; |
432 | 434 | /** |
433 | 435 | * Max size for uploads, in bytes. Currently only works for uploads from URL |
434 | 436 | * via CURL (see $wgAllowCopyUploads). The only way to impose limits on |