index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-08-18 15:21:58 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-19 09:54:58 -0500 |
commit | 9934b3bd345011eef6a96249d8d90de594c04cd0 (patch) | |
tree | ea46ef9f9c2a60b52ac17746018f56c340b5ee8b /lib | |
parent | 24824b54ce6ce3f62417be493d1e29eeb2cc8f53 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 8 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 2a1fb41c..e181f425 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -189,7 +189,7 @@ static int curl_download_internal(struct dload_payload *payload, char hostname[256]; char error_buffer[CURL_ERROR_SIZE]; struct stat st; - long timecond, remote_time = -1; + long timecond, respcode = 0, remote_time = -1; double remote_size, bytes_dl; struct sigaction sig_pipe[2], sig_int[2]; /* shortcut to our handle within the payload */ @@ -309,6 +309,12 @@ static int curl_download_internal(struct dload_payload *payload, /* was it a success? */ switch(handle->curlerr) { case CURLE_OK: + /* get http/ftp response code */ + curl_easy_getinfo(handle->curl, CURLINFO_RESPONSE_CODE, &respcode); + if(respcode >=400) { + payload->unlink_on_fail = 1; + goto cleanup; + } break; case CURLE_ABORTED_BY_CALLBACK: goto cleanup; |