ra_dav-refactoring: Add the code description to the request struct too.
* subversion/libsvn_ra_dav/ra_dav.h
(svn_ra_dav__request_t): Add 'code_desc' member.
* subversion/libsvn_ra_dav/util.c
(generate_error): Use the new member.
(svn_ra_dav__request_dispatch): Set the value of the new member.
git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/ra_dav-refactoring@862784 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/libsvn_ra_dav/ra_dav.h b/subversion/libsvn_ra_dav/ra_dav.h
index d0844b3..671fffb 100644
--- a/subversion/libsvn_ra_dav/ra_dav.h
+++ b/subversion/libsvn_ra_dav/ra_dav.h
@@ -108,7 +108,7 @@
ne_request_dispatch() or -1 if
not dispatched yet. */
int code; /* HTTP return code, or 0 if none */
-
+ const char *code_desc; /* Textual description of CODE */
svn_error_t *err; /* error encountered while executing
the request */
svn_boolean_t marshalled_error; /* TRUE if the error was server-side */
diff --git a/subversion/libsvn_ra_dav/util.c b/subversion/libsvn_ra_dav/util.c
index ca7aefa..3237112 100644
--- a/subversion/libsvn_ra_dav/util.c
+++ b/subversion/libsvn_ra_dav/util.c
@@ -393,7 +393,6 @@
apr_psprintf(req->pool, _("%s of '%s'"), req->method, req->url);;
const char *msg;
const char *hostport;
- const ne_status *statstruct;
/* Convert the return codes. */
switch (req->rv)
@@ -419,15 +418,12 @@
svn_ra_dav__request_get_location(req, pool)));
default:
- statstruct = ne_get_status(req->ne_req);
- msg = apr_pstrdup(pool, statstruct->reason_phrase);
-
return svn_error_create
(errcode, NULL,
apr_psprintf(pool,
_("Server sent unexpected return value (%d %s) "
"in response to %s request for '%s'"), req->code,
- msg, req->method, req->url));
+ req->code_desc, req->method, req->url));
}
case NE_AUTH:
errcode = SVN_ERR_RA_NOT_AUTHORIZED;
@@ -1258,7 +1254,6 @@
{
ne_xml_parser *error_parser;
const ne_status *statstruct;
- const char *code_desc;
/* add any extra headers passed in by caller. */
if (extra_headers != NULL)
@@ -1290,7 +1285,7 @@
/* Save values from the request */
statstruct = ne_get_status(req->ne_req);
- code_desc = apr_pstrdup(pool, statstruct->reason_phrase);
+ req->code_desc = apr_pstrdup(pool, statstruct->reason_phrase);
req->code = statstruct->code;
if (code_p)