]>
Commit | Line | Data |
---|---|---|
70f8787d JR |
1 | --- rpm-5.4.10/rpmio/rpmdav.c.dl_error~ 2012-07-06 17:39:19.000000000 +0200 |
2 | +++ rpm-5.4.10/rpmio/rpmdav.c 2012-07-11 19:49:00.504968365 +0200 | |
3 | @@ -1722,6 +1722,7 @@ int davReq(FD_t ctrl, const char * httpC | |
4 | { | |
5 | urlinfo u; | |
6 | int rc = 0; | |
7 | + const ne_status *status; | |
8 | ||
9 | assert(ctrl != NULL); | |
10 | u = (urlinfo) ctrl->u; | |
11 | @@ -1789,10 +1790,24 @@ assert(ctrl->req != NULL); | |
12 | } | |
13 | ||
14 | /* XXX somewhere else instead? */ | |
15 | -if (_dav_debug) { | |
16 | - const ne_status *status = ne_get_status((ne_request *)ctrl->req); | |
17 | -fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase); | |
18 | -} | |
19 | + status = ne_get_status((ne_request *)ctrl->req); | |
20 | + if (_dav_debug) | |
21 | + fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase); | |
22 | + | |
23 | + switch (status->code) { | |
24 | + case 200: | |
25 | + case 201: /* 201 Created. */ | |
26 | + break; | |
27 | + case 204: /* HACK: if overwriting, 204 No Content. */ | |
28 | + case 403: /* 403 Forbidden. */ | |
29 | + rc = FTPERR_UNKNOWN; | |
30 | + break; | |
31 | + default: | |
32 | + rc = FTPERR_FILE_NOT_FOUND; | |
33 | + break; | |
34 | + } | |
35 | + if (rc || _dav_debug) | |
36 | + fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase); | |
37 | ||
38 | if (rc) | |
39 | goto errxit; |