index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-08-12 15:03:45 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-15 06:26:08 -0500 |
commit | 6bf60568f8a956c980accdc6ae86c918eee5a881 (patch) | |
tree | 3c1aeb51229b177808ed55f3ff8d458258a8b1c3 | |
parent | 83f076d3a81e5a625c07fdaf82a5e598a1c75c71 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 34 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 67090845..5a63e488 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -306,19 +306,27 @@ static int curl_download_internal(struct dload_payload *payload, curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 1L); /* was it a success? */ - if(handle->curlerr == CURLE_ABORTED_BY_CALLBACK) { - goto cleanup; - } else if(handle->curlerr != CURLE_OK) { - if(!payload->errors_ok) { - handle->pm_errno = ALPM_ERR_LIBCURL; - _alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), - payload->filename, hostname, error_buffer); - } else { - _alpm_log(handle, ALPM_LOG_DEBUG, "failed retrieving file '%s' from %s : %s\n", - payload->filename, hostname, error_buffer); - } - unlink(tempfile); - goto cleanup; + switch(handle->curlerr) { + case CURLE_OK: + break; + case CURLE_ABORTED_BY_CALLBACK: + goto cleanup; + case CURLE_OPERATION_TIMEDOUT: + dload_interrupted = 1; + /* fallthrough */ + default: + if(!payload->errors_ok) { + handle->pm_errno = ALPM_ERR_LIBCURL; + _alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), + payload->filename, hostname, error_buffer); + if(!dload_interrupted) { + unlink(tempfile); + } + } else { + _alpm_log(handle, ALPM_LOG_DEBUG, "failed retrieving file '%s' from %s : %s\n", + payload->filename, hostname, error_buffer); + } + goto cleanup; } /* retrieve info about the state of the transfer */ |