mirror of
https://abf.rosa.ru/djam/rpm.git
synced 2025-02-23 10:23:04 +00:00
56 lines
2 KiB
Diff
56 lines
2 KiB
Diff
--- rpm-5.4.10/rpmio/rpmdav.c.dl_error~ 2012-07-06 17:39:19.000000000 +0200
|
|
+++ rpm-5.4.10/rpmio/rpmdav.c 2012-07-11 19:49:00.504968365 +0200
|
|
@@ -1722,6 +1722,7 @@ int davReq(FD_t ctrl, const char * httpC
|
|
{
|
|
urlinfo u;
|
|
int rc = 0;
|
|
+ const ne_status *status;
|
|
|
|
assert(ctrl != NULL);
|
|
u = (urlinfo) ctrl->u;
|
|
@@ -1789,10 +1790,24 @@ assert(ctrl->req != NULL);
|
|
}
|
|
|
|
/* XXX somewhere else instead? */
|
|
-if (_dav_debug) {
|
|
- const ne_status *status = ne_get_status((ne_request *)ctrl->req);
|
|
-fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase);
|
|
-}
|
|
+ status = ne_get_status((ne_request *)ctrl->req);
|
|
+ if (_dav_debug)
|
|
+ fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase);
|
|
+
|
|
+ switch (status->code) {
|
|
+ case 200:
|
|
+ case 201: /* 201 Created. */
|
|
+ break;
|
|
+ case 204: /* HACK: if overwriting, 204 No Content. */
|
|
+ case 403: /* 403 Forbidden. */
|
|
+ rc = FTPERR_UNKNOWN;
|
|
+ break;
|
|
+ default:
|
|
+ rc = FTPERR_FILE_NOT_FOUND;
|
|
+ break;
|
|
+ }
|
|
+ if (rc || _dav_debug)
|
|
+ fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase);
|
|
|
|
if (rc)
|
|
goto errxit;
|
|
--- rpm-5.4.10/rpmio/rpmio.c.dl_error~ 2012-07-06 17:39:19.000000000 +0200
|
|
+++ rpm-5.4.10/rpmio/rpmio.c 2012-07-11 19:47:59.396732322 +0200
|
|
@@ -2306,9 +2306,12 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o
|
|
u->openError = httpReq(fd, cmd, path);
|
|
#endif
|
|
if (u->openError < 0) {
|
|
+ /* XXX rpmdav doesn't behave consistently with the rest...*/
|
|
+#ifndef WITH_NEON
|
|
/* XXX make sure that we can exit through ufdClose */
|
|
- fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
|
|
- fd = fdLink(fd, "error data (ufdOpen HTTP)");
|
|
+ fd = u->ctrl = fdLink(fd, "error ctrl (ufdOpen HTTP)");
|
|
+ fd = u->data fdLink(fd, "error data (ufdOpen HTTP)");
|
|
+#endif
|
|
} else {
|
|
fd->bytesRemain = ((!strcmp(cmd, "GET"))
|
|
? fd->contentLength : -1);
|