[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: new Neon 0.24

From: David Waite <mass_at_akuma.org>
Date: 2003-06-28 00:05:42 CEST

I'm horribly busy right now, but let me know once it gets close to the
'everything else works' stage, and I'll look at fixing the SSL code to
match the new interfaces.

-David Waite

mark benedetto king wrote:

>On Thu, Jun 26, 2003 at 03:09:09PM -0400, Sergey A. Lipnevich wrote:
>
>
>>mark benedetto king wrote:
>>
>>
>>>If you'd like to take over the work on this, I can send you my diffs;
>>>I do have other issues that I should probably be working on instead.
>>>
>>>
>>>
>>Since this is a "beta" issue now, I assume I have some time to slide
>>into Subversion code. I expect to have some time during this weekend to
>>get started. Actually, I did get started and have done something before
>>I realized that it's better to implement the "shim layer" as you put it.
>>
>>
>>
>
>Okay, better get it to you before the weekend, then. :-)
>
>One issue that I've run into is that neon's SSL interface has also
>changed. To save myself some headache, I've just #ifdef'ed out the SSL
>calls from libsvn_ra_dav/session.c. This is obviously not an acceptable
>solution.
>
>The following is a completely untested and certainly broken patch
>that merely represents the state of my WC right now. :-) I am handing
>this change off to you.
>
>
>Index: subversion/libsvn_ra_dav/merge.c
>===================================================================
>--- subversion/libsvn_ra_dav/merge.c (revision 6363)
>+++ subversion/libsvn_ra_dav/merge.c (working copy)
>@@ -35,25 +35,27 @@
> #include "ra_dav.h"
>
>
>-static const struct ne_xml_elm merge_elements[] =
>+static const svn_ra_dav__xml_elm_t merge_elements[] =
> {
> { "DAV:", "updated-set", ELEM_updated_set, 0 },
> { "DAV:", "merged-set", ELEM_merged_set, 0 },
> { "DAV:", "ignored-set", ELEM_ignored_set, 0 },
>- { "DAV:", "href", NE_ELM_href, NE_XML_CDATA },
>+ { "DAV:", "href", ELEM_href, SVN_RA_DAV__XML_CDATA },
> { "DAV:", "merge-response", ELEM_merge_response, 0 },
> { "DAV:", "checked-in", ELEM_checked_in, 0 },
>- { "DAV:", "response", NE_ELM_response, 0 },
>- { "DAV:", "propstat", NE_ELM_propstat, 0 },
>- { "DAV:", "status", NE_ELM_status, NE_XML_CDATA },
>- { "DAV:", "responsedescription", NE_ELM_responsedescription, NE_XML_CDATA },
>- { "DAV:", "prop", NE_ELM_prop, 0 },
>+ { "DAV:", "response", ELEM_response, 0 },
>+ { "DAV:", "propstat", ELEM_propstat, 0 },
>+ { "DAV:", "status", ELEM_status, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "responsedescription", ELEM_responsedescription,
>+ SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "prop", ELEM_prop, 0 },
> { "DAV:", "resourcetype", ELEM_resourcetype, 0 },
> { "DAV:", "collection", ELEM_collection, 0 },
> { "DAV:", "baseline", ELEM_baseline, 0 },
>- { "DAV:", "version-name", ELEM_version_name, NE_XML_CDATA },
>- { "DAV:", "creationdate", ELEM_creationdate, NE_XML_CDATA },
>- { "DAV:", "creator-displayname", ELEM_creator_displayname, NE_XML_CDATA },
>+ { "DAV:", "version-name", ELEM_version_name, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "creationdate", ELEM_creationdate, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "creator-displayname", ELEM_creator_displayname,
>+ SVN_RA_DAV__XML_CDATA },
>
> { NULL }
> };
>@@ -260,102 +262,108 @@
> return bump_resource(mc, relative, mc->vsn_url->data);
> }
>
>-static int validate_element(void *userdata, ne_xml_elmid parent,
>- ne_xml_elmid child)
>+static int validate_element(void *userdata, int parent,
>+ int child)
> {
> if ((child == ELEM_collection || child == ELEM_baseline)
> && parent != ELEM_resourcetype) {
> /* ### technically, they could occur elsewhere, but screw it */
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
> }
>
> switch (parent)
> {
>- case NE_ELM_root:
>+ case ELEM_root:
> if (child == ELEM_merge_response)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_merge_response:
> if (child == ELEM_updated_set
> || child == ELEM_merged_set
> || child == ELEM_ignored_set)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* any child is allowed */
>+ return SVN_RA_DAV__XML_DECLINE; /* any child is allowed */
>
> case ELEM_updated_set:
> case ELEM_merged_set:
>- if (child == NE_ELM_response)
>- return NE_XML_VALID;
>+ if (child == ELEM_response)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
> case ELEM_ignored_set:
>- if (child == NE_ELM_href)
>- return NE_XML_VALID;
>+ if (child == ELEM_href)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
>- case NE_ELM_response:
>- if (child == NE_ELM_href
>- || child == NE_ELM_status
>- || child == NE_ELM_propstat)
>- return NE_XML_VALID;
>- else if (child == NE_ELM_responsedescription)
>+ case ELEM_response:
>+ if (child == ELEM_href
>+ || child == ELEM_status
>+ || child == ELEM_propstat)
>+ return SVN_RA_DAV__XML_VALID;
>+ else if (child == ELEM_responsedescription)
> /* ### I think we want this... to save a message for the user */
>- return NE_XML_DECLINE; /* valid, but we don't need to see it */
>+ return SVN_RA_DAV__XML_DECLINE; /* valid, but we don't need to see it */
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
>- case NE_ELM_propstat:
>- if (child == NE_ELM_prop || child == NE_ELM_status)
>- return NE_XML_VALID;
>- else if (child == NE_ELM_responsedescription)
>+ case ELEM_propstat:
>+ if (child == ELEM_prop || child == ELEM_status)
>+ return SVN_RA_DAV__XML_VALID;
>+ else if (child == ELEM_responsedescription)
> /* ### I think we want this... to save a message for the user */
>- return NE_XML_DECLINE; /* valid, but we don't need to see it */
>+ return SVN_RA_DAV__XML_DECLINE; /* valid, but we don't need to see it */
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
>- case NE_ELM_prop:
>+ case ELEM_prop:
> if (child == ELEM_checked_in
> || child == ELEM_resourcetype
> || child == ELEM_version_name
> || child == ELEM_creationdate
> || child == ELEM_creator_displayname
> /* other props */)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* ignore other props */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore other props */
>
> case ELEM_checked_in:
>- if (child == NE_ELM_href)
>- return NE_XML_VALID;
>+ if (child == ELEM_href)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
> case ELEM_resourcetype:
> if (child == ELEM_collection || child == ELEM_baseline)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
> default:
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
> }
>
> /* NOTREACHED */
> }
>
>-static int start_element(void *userdata, const struct ne_xml_elm *elm,
>+static int start_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> merge_ctx_t *mc = userdata;
>
> switch (elm->id)
> {
>- case NE_ELM_response:
>+ case ELEM_response:
> mc->response_has_error = FALSE;
>
> /* for each response (which corresponds to one resource), note that we
>@@ -380,7 +388,7 @@
> mc->response_parent = elm->id;
> break;
>
>- case NE_ELM_propstat:
>+ case ELEM_propstat:
> /* initialize the status so we can figure out if we ever saw a
> status element in the propstat */
> mc->status = 0;
>@@ -401,7 +409,7 @@
> break;
>
> default:
>- /* one of: NE_ELM_href, NE_ELM_status, NE_ELM_prop,
>+ /* one of: ELEM_href, ELEM_status, ELEM_prop,
> ELEM_version_name */
> break;
> }
>@@ -409,21 +417,21 @@
> return 0;
> }
>
>-static int end_element(void *userdata, const struct ne_xml_elm *elm,
>+static int end_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> merge_ctx_t *mc = userdata;
>
> switch (elm->id)
> {
>- case NE_ELM_href:
>+ case ELEM_href:
> switch (mc->href_parent)
> {
> case ELEM_ignored_set:
> add_ignored(mc, cdata);
> break;
>
>- case NE_ELM_response:
>+ case ELEM_response:
> /* we're now working on this href... */
> svn_ra_dav__copy_href(mc->href, cdata);
> break;
>@@ -434,12 +442,12 @@
> }
> break;
>
>- case NE_ELM_responsedescription:
>+ case ELEM_responsedescription:
> /* ### I don't think we'll see this right now, due to validate_element */
> /* ### remember this for error messages? */
> break;
>
>- case NE_ELM_status:
>+ case ELEM_status:
> {
> ne_status hs;
>
>@@ -465,7 +473,7 @@
> }
> break;
>
>- case NE_ELM_propstat:
>+ case ELEM_propstat:
> /* ### does Neon have a symbol for 200? */
> if (mc->status == 200 /* OK */)
> {
>@@ -474,7 +482,7 @@
> /* ### else issue an error? status==0 means we never saw one */
> break;
>
>- case NE_ELM_response:
>+ case ELEM_response:
> {
> svn_error_t *err;
>
>@@ -495,7 +503,7 @@
> /* When we leave a DAV:checked-in element, the parents are DAV:prop,
> DAV:propstat, then DAV:response. If we see a DAV:href "on the way
> out", then it is going to belong to the DAV:response. */
>- mc->href_parent = NE_ELM_response;
>+ mc->href_parent = ELEM_response;
> break;
>
> case ELEM_version_name:
>@@ -512,7 +520,7 @@
>
> default:
> /* one of: ELEM_updated_set, ELEM_merged_set, ELEM_ignored_set,
>- NE_ELM_prop, ELEM_resourcetype, ELEM_collection, ELEM_baseline */
>+ ELEM_prop, ELEM_resourcetype, ELEM_collection, ELEM_baseline */
> break;
> }
>
>Index: subversion/libsvn_ra_dav/ra_dav.h
>===================================================================
>--- subversion/libsvn_ra_dav/ra_dav.h (revision 6363)
>+++ subversion/libsvn_ra_dav/ra_dav.h (working copy)
>@@ -41,7 +41,61 @@
> #endif /* __cplusplus */
>
>
>+
>+#ifdef NE_XML_VALID
>+
>+#define SVN_RA_DAV__XML_VALID NE_XML_VALID
>+#define SVN_RA_DAV__XML_INVALID NE_XML_INVALID
>+#define SVN_RA_DAV__XML_DECLINE NE_XML_DECLINE
>+#define SVN_RA_DAV__XML_CDATA NE_XML_CDATA
>+#define SVN_RA_DAV__XML_COLLECT NE_XML_COLLECT
>+
>+typedef struct ne_xml_elm svn_ra_dav__xml_elm_t;
>+typedef ne_xml_validate_cb svn_ra_dav__xml_validate_cb;
>+typedef ne_xml_startelm_cb svn_ra_dav__xml_startelm_cb;
>+typedef ne_xml_endelm_cb svn_ra_dav__xml_endelm_cb;
>+
>+#else
>+
>+#define SVN_RA_DAV__NEED_SHIM
>+
>+#define SVN_RA_DAV__XML_VALID (0)
>+#define SVN_RA_DAV__XML_INVALID (-1)
>+#define SVN_RA_DAV__XML_DECLINE (-2)
>+#define SVN_RA_DAV__XML_CDATA (1<<1)
>+#define SVN_RA_DAV__XML_COLLECT (1<<2 | SVN_RA_DAV__XML_CDATA)
>+
> typedef struct {
>+ const char *nspace; /* namespace */
>+ const char *name; /* element name */
>+ int id; /* enumerated id */
>+ unsigned int flags; /* flags for processing */
>+} svn_ra_dav__xml_elm_t;
>+
>+typedef int svn_ra_dav__xml_validate_cb(void *userdata,
>+ int parent,
>+ int child);
>+
>+typedef int svn_ra_dav__xml_startelm_cb(void *userdata,
>+ const svn_ra_dav__xml_elm_t *elm,
>+ const char **atts);
>+
>+typedef int svn_ra_dav__xml_endelm_cb(void *userdata,
>+ const svn_ra_dav__xml_elm_t *elm,
>+ const char *cdata);
>+
>+#endif
>+
>+void svn_ra_dav__xml_push_handler(ne_xml_parser *p,
>+ const svn_ra_dav__xml_elm_t *elements,
>+ svn_ra_dav__xml_validate_cb validate_cb,
>+ svn_ra_dav__xml_startelm_cb startelm_cb,
>+ svn_ra_dav__xml_endelm_cb endelm_cb,
>+ void *userdata,
>+ apr_pool_t *pool);
>+
>+
>+typedef struct {
> apr_pool_t *pool;
>
> const char *url; /* original, unparsed session url */
>@@ -65,6 +119,7 @@
> svn_boolean_t compression; /* should we use http compression? */
> } svn_ra_ne_session_baton_t;
>
>+
> /* Id used with ne_set_session_private() and ne_get_session_private()
> to retrieve the associated svn_ra_ne_session_baton_t baton. */
> #define SVN_RA_NE_SESSION_ID "SVN"
>@@ -388,6 +443,7 @@
> apr_file_t *body_file);
>
>
>+
> /* Send a METHOD request (e.g., "MERGE", "REPORT", "PROPFIND") to URL
> * in session SESS, and parse the response. If BODY is non-null, it is
> * the body of the request, else use the contents of file BODY_FILE
>@@ -416,19 +472,31 @@
> apr_file_t *body_file,
> void set_parser (ne_xml_parser *parser,
> void *baton),
>- const struct ne_xml_elm *elements,
>- ne_xml_validate_cb validate_cb,
>- ne_xml_startelm_cb startelm_cb,
>- ne_xml_endelm_cb endelm_cb,
>+ const svn_ra_dav__xml_elm_t *elements,
>+ svn_ra_dav__xml_validate_cb cdata_cb,
>+ svn_ra_dav__xml_startelm_cb startelm_cb,
>+ svn_ra_dav__xml_endelm_cb endelm_cb,
> void *baton,
> apr_hash_t *extra_headers,
> apr_pool_t *pool);
>-
>
>+
> /* ### add SVN_RA_DAV_ to these to prefix conflicts with (sys) headers? */
> enum {
> /* DAV elements */
>+#ifdef SVN_RA_DAV__NEED_SHIM
>+ ELEM_root,
>+ ELEM_href,
>+ ELEM_response,
>+ ELEM_status,
>+ ELEM_propstat,
>+ ELEM_responsedescription,
>+ ELEM_multistatus,
>+ ELEM_unknown,
>+ ELEM_activity_coll_set,
>+#else
> ELEM_activity_coll_set = NE_ELM_207_UNUSED,
>+#endif
> ELEM_baseline,
> ELEM_baseline_coll,
> ELEM_checked_in,
>Index: subversion/libsvn_ra_dav/log.c
>===================================================================
>--- subversion/libsvn_ra_dav/log.c (revision 6363)
>+++ subversion/libsvn_ra_dav/log.c (working copy)
>@@ -104,10 +104,10 @@
> * This implements the `ne_xml_validate_cb' prototype.
> */
> static int
>-log_validate(void *userdata, ne_xml_elmid parent, ne_xml_elmid child)
>+log_validate(void *userdata, int parent, int child)
> {
> /* ### todo */
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> }
>
>
>@@ -124,7 +124,7 @@
> */
> static int
> log_start_element(void *userdata,
>- const struct ne_xml_elm *elm,
>+ const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> struct log_baton *lb = userdata;
>@@ -173,7 +173,7 @@
> lb->this_path_item = NULL;
> break;
> }
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> }
>
>
>@@ -182,7 +182,7 @@
> */
> static int
> log_end_element(void *userdata,
>- const struct ne_xml_elm *elm,
>+ const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> struct log_baton *lb = userdata;
>@@ -228,7 +228,8 @@
> if (err)
> {
> lb->err = err; /* ### Wrap an existing error, if any? */
>- return NE_XML_INVALID; /* ### Any other way to express an err? */
>+ return SVN_RA_DAV__XML_INVALID; /* ### Any other way to express
>+ an err? */
> }
> }
> break;
>@@ -282,7 +283,7 @@
> break;
> }
>
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> }
>
>
>@@ -323,19 +324,25 @@
>
> static const char log_request_tail[] = "</S:log-report>" DEBUG_CR;
>
>- static const struct ne_xml_elm log_report_elements[] =
>+ static const svn_ra_dav__xml_elm_t log_report_elements[] =
> {
> { SVN_XML_NAMESPACE, "log-report", ELEM_log_report, 0 },
> { SVN_XML_NAMESPACE, "log-item", ELEM_log_item, 0 },
>- { SVN_XML_NAMESPACE, "date", ELEM_log_date, NE_XML_CDATA },
>- { SVN_XML_NAMESPACE, "added-path", ELEM_added_path, NE_XML_CDATA },
>- { SVN_XML_NAMESPACE, "deleted-path", ELEM_deleted_path, NE_XML_CDATA },
>- { SVN_XML_NAMESPACE, "modified-path", ELEM_modified_path, NE_XML_CDATA },
>- { SVN_XML_NAMESPACE, "replaced-path", ELEM_replaced_path, NE_XML_CDATA },
>- { "DAV:", "version-name", ELEM_version_name, NE_XML_CDATA },
>+ { SVN_XML_NAMESPACE, "date", ELEM_log_date, SVN_RA_DAV__XML_CDATA },
>+ { SVN_XML_NAMESPACE, "added-path", ELEM_added_path,
>+ SVN_RA_DAV__XML_CDATA },
>+ { SVN_XML_NAMESPACE, "deleted-path", ELEM_deleted_path,
>+ SVN_RA_DAV__XML_CDATA },
>+ { SVN_XML_NAMESPACE, "modified-path", ELEM_modified_path,
>+ SVN_RA_DAV__XML_CDATA },
>+ { SVN_XML_NAMESPACE, "replaced-path", ELEM_replaced_path,
>+ SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "version-name", ELEM_version_name,
>+ SVN_RA_DAV__XML_CDATA },
> { "DAV:", "creator-displayname", ELEM_creator_displayname,
>- NE_XML_CDATA },
>- { "DAV:", "comment", ELEM_comment, NE_XML_CDATA },
>+ SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "comment", ELEM_comment,
>+ SVN_RA_DAV__XML_CDATA },
> { NULL }
> };
>
>Index: subversion/libsvn_ra_dav/props.c
>===================================================================
>--- subversion/libsvn_ra_dav/props.c (revision 6363)
>+++ subversion/libsvn_ra_dav/props.c (working copy)
>@@ -73,7 +73,7 @@
> /*** Propfind Implementation ***/
>
> typedef struct {
>- ne_xml_elmid id;
>+ int id;
> const char *name;
> int is_property; /* is it a property, or part of some structure? */
> } elem_defn;
>@@ -85,14 +85,14 @@
> propfind_elements[] ***/
>
> /* DAV elements */
>- { NE_ELM_multistatus, "DAV:multistatus", 0 },
>- { NE_ELM_response, "DAV:response", 0 },
>- { NE_ELM_href, "DAV:href", NE_XML_CDATA },
>- { NE_ELM_propstat, "DAV:propstat", 0 },
>- { NE_ELM_prop, "DAV:prop", 0 },
>- { NE_ELM_status, "DAV:status", NE_XML_CDATA },
>- { ELEM_baseline, "DAV:baseline", NE_XML_CDATA },
>- { ELEM_collection, "DAV:collection", NE_XML_CDATA },
>+ { ELEM_multistatus, "DAV:multistatus", 0 },
>+ { ELEM_response, "DAV:response", 0 },
>+ { ELEM_href, "DAV:href", SVN_RA_DAV__XML_CDATA },
>+ { ELEM_propstat, "DAV:propstat", 0 },
>+ { ELEM_prop, "DAV:prop", 0 },
>+ { ELEM_status, "DAV:status", SVN_RA_DAV__XML_CDATA },
>+ { ELEM_baseline, "DAV:baseline", SVN_RA_DAV__XML_CDATA },
>+ { ELEM_collection, "DAV:collection", SVN_RA_DAV__XML_CDATA },
> { ELEM_resourcetype, "DAV:resourcetype", 0 },
> { ELEM_baseline_coll, SVN_RA_DAV__PROP_BASELINE_COLLECTION, 0 },
> { ELEM_checked_in, SVN_RA_DAV__PROP_CHECKED_IN, 0 },
>@@ -110,39 +110,41 @@
> };
>
>
>-static const struct ne_xml_elm propfind_elements[] =
>+static const svn_ra_dav__xml_elm_t propfind_elements[] =
> {
> /*** NOTE: Make sure that every item in here is also represented in
> elem_definitions[] ***/
>
> /* DAV elements */
>- { "DAV:", "multistatus", NE_ELM_multistatus, 0 },
>- { "DAV:", "response", NE_ELM_response, 0 },
>- { "DAV:", "href", NE_ELM_href, NE_XML_CDATA },
>- { "DAV:", "propstat", NE_ELM_propstat, 0 },
>- { "DAV:", "prop", NE_ELM_prop, 0 },
>- { "DAV:", "status", NE_ELM_status, NE_XML_CDATA },
>- { "DAV:", "baseline", ELEM_baseline, NE_XML_CDATA },
>- { "DAV:", "baseline-collection", ELEM_baseline_coll, NE_XML_CDATA },
>+ { "DAV:", "multistatus", ELEM_multistatus, 0 },
>+ { "DAV:", "response", ELEM_response, 0 },
>+ { "DAV:", "href", ELEM_href, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "propstat", ELEM_propstat, 0 },
>+ { "DAV:", "prop", ELEM_prop, 0 },
>+ { "DAV:", "status", ELEM_status, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "baseline", ELEM_baseline, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "baseline-collection", ELEM_baseline_coll, SVN_RA_DAV__XML_CDATA },
> { "DAV:", "checked-in", ELEM_checked_in, 0 },
>- { "DAV:", "collection", ELEM_collection, NE_XML_CDATA },
>+ { "DAV:", "collection", ELEM_collection, SVN_RA_DAV__XML_CDATA },
> { "DAV:", "resourcetype", ELEM_resourcetype, 0 },
> { "DAV:", "version-controlled-configuration", ELEM_vcc, 0 },
>- { "DAV:", "version-name", ELEM_version_name, NE_XML_CDATA },
>- { "DAV:", "getcontentlength", ELEM_get_content_length, NE_XML_CDATA },
>- { "DAV:", "creationdate", ELEM_creationdate, NE_XML_CDATA },
>- { "DAV:", "creator-displayname", ELEM_creator_displayname, NE_XML_CDATA },
>+ { "DAV:", "version-name", ELEM_version_name, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "getcontentlength", ELEM_get_content_length,
>+ SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "creationdate", ELEM_creationdate, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "creator-displayname", ELEM_creator_displayname,
>+ SVN_RA_DAV__XML_CDATA },
>
> /* SVN elements */
> { SVN_DAV_PROP_NS_DAV, "baseline-relative-path", ELEM_baseline_relpath,
>- NE_XML_CDATA },
>+ SVN_RA_DAV__XML_CDATA },
> { SVN_DAV_PROP_NS_DAV, "md5-checksum", ELEM_md5_checksum,
>- NE_XML_CDATA },
>+ SVN_RA_DAV__XML_CDATA },
> { SVN_DAV_PROP_NS_DAV, "repository-uuid", ELEM_repository_uuid,
>- NE_XML_CDATA },
>+ SVN_RA_DAV__XML_CDATA },
>
> /* Unknowns */
>- { "", "", NE_ELM_unknown, NE_XML_COLLECT },
>+ { "", "", ELEM_unknown, SVN_RA_DAV__XML_COLLECT },
>
> { NULL }
> };
>@@ -156,7 +158,7 @@
> const char *encoding; /* property encoding (or NULL) */
> int status; /* status for the current <propstat> (or 0 if unknown). */
> apr_hash_t *propbuffer; /* holds properties until their status is known. */
>- ne_xml_elmid last_open_id; /* the id of the last opened tag. */
>+ int last_open_id; /* the id of the last opened tag. */
> ne_xml_parser *parser; /* xml parser handling the PROPSET request. */
>
> apr_pool_t *pool;
>@@ -166,7 +168,7 @@
>
> /* Look up an element definition ID. May return NULL if the elem is
> not recognized. */
>-static const elem_defn *defn_from_id(ne_xml_elmid id)
>+static const elem_defn *defn_from_id(int id)
> {
> const elem_defn *defn;
>
>@@ -206,54 +208,55 @@
>
>
> static int validate_element(void *userdata,
>- ne_xml_elmid parent,
>- ne_xml_elmid child)
>+ int parent,
>+ int child)
> {
> switch (parent)
> {
>- case NE_ELM_root:
>- if (child == NE_ELM_multistatus)
>- return NE_XML_VALID;
>+ case ELEM_root:
>+ if (child == ELEM_multistatus)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
>- case NE_ELM_multistatus:
>- if (child == NE_ELM_response)
>- return NE_XML_VALID;
>+ case ELEM_multistatus:
>+ if (child == ELEM_response)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
>
>- case NE_ELM_response:
>- if ((child == NE_ELM_href) || (child == NE_ELM_propstat))
>- return NE_XML_VALID;
>+ case ELEM_response:
>+ if ((child == ELEM_href) || (child == ELEM_propstat))
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
>
>- case NE_ELM_propstat:
>- if ((child == NE_ELM_prop) || (child == NE_ELM_status))
>- return NE_XML_VALID;
>+ case ELEM_propstat:
>+ if ((child == ELEM_prop) || (child == ELEM_status))
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
>
>- case NE_ELM_prop:
>- return NE_XML_VALID; /* handle all children of <prop> */
>+ case ELEM_prop:
>+ return SVN_RA_DAV__XML_VALID; /* handle all children of <prop> */
>
> case ELEM_baseline_coll:
> case ELEM_checked_in:
> case ELEM_vcc:
>- if (child == NE_ELM_href)
>- return NE_XML_VALID;
>+ if (child == ELEM_href)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* not concerned with other types */
>+ return SVN_RA_DAV__XML_DECLINE; /* not concerned with other types */
>
> case ELEM_resourcetype:
> if ((child == ELEM_collection) || (child == ELEM_baseline))
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* not concerned with other types (### now) */
>+ return SVN_RA_DAV__XML_DECLINE; /* not concerned with other types
>+ (### now) */
>
> default:
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
> }
>
> /* NOTREACHED */
>@@ -261,14 +264,14 @@
>
>
> static int start_element(void *userdata,
>- const struct ne_xml_elm *elm,
>+ const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> propfind_ctx_t *pc = userdata;
>
> switch (elm->id)
> {
>- case NE_ELM_response:
>+ case ELEM_response:
> if (pc->rsrc)
> return 1;
> /* Create a new resource. */
>@@ -278,11 +281,11 @@
> pc->status = 0;
> break;
>
>- case NE_ELM_propstat:
>+ case ELEM_propstat:
> pc->status = 0;
> break;
>
>- case NE_ELM_href:
>+ case ELEM_href:
> /* Remember this <href>'s parent so that when we close this tag,
> we know to whom the URL assignment belongs. Could be the
> resource itself, or one of the properties:
>@@ -294,7 +297,7 @@
> pc->rsrc->is_collection = 1;
> break;
>
>- case NE_ELM_unknown:
>+ case ELEM_unknown:
> /* these are our user-visible properties, presumably. */
> pc->encoding = ne_xml_get_attr(pc->parser, atts, SVN_DAV_PROP_NS_DAV,
> "encoding");
>@@ -314,7 +317,7 @@
>
>
> static int end_element(void *userdata,
>- const struct ne_xml_elm *elm,
>+ const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> propfind_ctx_t *pc = userdata;
>@@ -327,7 +330,7 @@
>
> switch (elm->id)
> {
>- case NE_ELM_response:
>+ case ELEM_response:
> /* Verify that we've received a URL for this resource. */
> if (!pc->rsrc->url)
> return 1;
>@@ -337,7 +340,7 @@
> pc->rsrc = NULL;
> return 0;
>
>- case NE_ELM_propstat:
>+ case ELEM_propstat:
> /* We're at the end of a set of properties. Do the right thing
> status-wise. */
> if (pc->status)
>@@ -366,7 +369,7 @@
> }
> return 0;
>
>- case NE_ELM_status:
>+ case ELEM_status:
> /* Parse the <status> tag's CDATA for a status code. */
> if (ne_parse_statusline(cdata, &status))
> return 1;
>@@ -374,9 +377,9 @@
> pc->status = status.code;
> return 0;
>
>- case NE_ELM_href:
>+ case ELEM_href:
> /* Special handling for <href> that belongs to the <response> tag. */
>- if (rsrc->href_parent == NE_ELM_response)
>+ if (rsrc->href_parent == ELEM_response)
> {
> assign_rsrc_url(pc->rsrc, cdata, pc->pool);
> return 0;
>@@ -396,15 +399,15 @@
>
> default:
> /*** This case is, as usual, for everything not covered by other
>- cases. ELM->id should be either NE_ELM_unknown, or one of
>+ cases. ELM->id should be either ELEM_unknown, or one of
> the ids in the elem_definitions[] structure. In this case,
>- we seek to handle properties. Since NE_ELM_unknown should
>+ we seek to handle properties. Since ELEM_unknown should
> only occur for properties, we will handle that id. All
> other ids will be searched for in the elem_definitions[]
> structure to determine if they are properties. Properties,
> we handle; all else hits the road. ***/
>
>- if (elm->id == NE_ELM_unknown)
>+ if (elm->id == ELEM_unknown)
> {
> name = apr_pstrcat(pc->pool, elm->nspace, elm->name, NULL);
> }
>Index: subversion/libsvn_ra_dav/session.c
>===================================================================
>--- subversion/libsvn_ra_dav/session.c (revision 6363)
>+++ subversion/libsvn_ra_dav/session.c (working copy)
>@@ -204,6 +204,7 @@
> client_creds = creds;
> if (client_creds)
> {
>+#if 0 /*MBK*/
> if (client_creds->cert_type == svn_auth_ssl_pem_cert_type)
> {
> ne_ssl_load_pem(sess, client_creds->cert_file,
>@@ -213,6 +214,7 @@
> {
> ne_ssl_load_pkcs12(sess, client_creds->cert_file);
> }
>+#endif
> }
> }
> apr_pool_destroy(pool);
>@@ -605,6 +607,7 @@
>
> if (is_ssl_session)
> {
>+#if 0 /*MBK*/
> const char *authorities_file;
> authorities_file = svn_config_get_server_setting(
> cfg, server_group,
>@@ -630,6 +633,7 @@
> a password is needed for the key. */
> ne_ssl_keypw_prompt(sess, client_ssl_keypw_callback, ras);
> ne_ssl_keypw_prompt(sess2, client_ssl_keypw_callback, ras);
>+#endif
> }
>
>
>Index: subversion/libsvn_ra_dav/fetch.c
>===================================================================
>--- subversion/libsvn_ra_dav/fetch.c (revision 6363)
>+++ subversion/libsvn_ra_dav/fetch.c (working copy)
>@@ -175,7 +175,7 @@
> "\">" DEBUG_CR;
> static const char report_tail[] = "</S:update-report>" DEBUG_CR;
>
>-static const struct ne_xml_elm report_elements[] =
>+static const svn_ra_dav__xml_elm_t report_elements[] =
> {
> { SVN_XML_NAMESPACE, "update-report", ELEM_update_report, 0 },
> { SVN_XML_NAMESPACE, "resource-walk", ELEM_resource_walk, 0 },
>@@ -195,25 +195,27 @@
> { SVN_XML_NAMESPACE, "fetch-file", ELEM_fetch_file, 0 },
> { SVN_XML_NAMESPACE, "prop", ELEM_prop, 0 },
> { SVN_DAV_PROP_NS_DAV, "repository-uuid",
>- ELEM_repository_uuid, NE_XML_CDATA },
>+ ELEM_repository_uuid, SVN_RA_DAV__XML_CDATA },
>
>- { SVN_DAV_PROP_NS_DAV, "md5-checksum", ELEM_md5_checksum, NE_XML_CDATA },
>+ { SVN_DAV_PROP_NS_DAV, "md5-checksum", ELEM_md5_checksum,
>+ SVN_RA_DAV__XML_CDATA },
>
>- { "DAV:", "version-name", ELEM_version_name, NE_XML_CDATA },
>- { "DAV:", "creationdate", ELEM_creationdate, NE_XML_CDATA },
>- { "DAV:", "creator-displayname", ELEM_creator_displayname, NE_XML_CDATA },
>+ { "DAV:", "version-name", ELEM_version_name, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "creationdate", ELEM_creationdate, SVN_RA_DAV__XML_CDATA },
>+ { "DAV:", "creator-displayname", ELEM_creator_displayname,
>+ SVN_RA_DAV__XML_CDATA },
>
> { "DAV:", "checked-in", ELEM_checked_in, 0 },
>- { "DAV:", "href", NE_ELM_href, NE_XML_CDATA },
>+ { "DAV:", "href", ELEM_href, SVN_RA_DAV__XML_CDATA },
>
> { NULL }
> };
>
> /* Elements used in a dated-rev-report response */
>-static const struct ne_xml_elm drev_report_elements[] =
>+static const svn_ra_dav__xml_elm_t drev_report_elements[] =
> {
> { SVN_XML_NAMESPACE, "dated-rev-report", ELEM_dated_rev_report, 0 },
>- { "DAV:", "version-name", ELEM_version_name, NE_XML_CDATA },
>+ { "DAV:", "version-name", ELEM_version_name, SVN_RA_DAV__XML_CDATA },
> { NULL }
> };
>
>@@ -1003,21 +1005,21 @@
> */
>
> /* This implements the `ne_xml_validate_cb' prototype. */
>-static int drev_validate_element(void *userdata, ne_xml_elmid parent,
>- ne_xml_elmid child)
>+static int drev_validate_element(void *userdata, int parent,
>+ int child)
> {
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> }
>
> /* This implements the `ne_xml_startelm_cb' prototype. */
>-static int drev_start_element(void *userdata, const struct ne_xml_elm *elm,
>+static int drev_start_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> return 0;
> }
>
> /* This implements the `ne_xml_endelm_cb' prototype. */
>-static int drev_end_element(void *userdata, const struct ne_xml_elm *elm,
>+static int drev_end_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> if (elm->id == ELEM_version_name)
>@@ -1227,8 +1229,8 @@
>
> /* This implements the `ne_xml_validate_cb' prototype. */
> static int validate_element(void *userdata,
>- ne_xml_elmid parent,
>- ne_xml_elmid child)
>+ int parent,
>+ int child)
> {
> /* We're being very strict with the validity of XML elements here. If
> something exists that we don't know about, then we might not update
>@@ -1238,31 +1240,31 @@
>
> switch (parent)
> {
>- case NE_ELM_root:
>+ case ELEM_root:
> if (child == ELEM_update_report)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_update_report:
> if (child == ELEM_target_revision
> || child == ELEM_open_directory
> || child == ELEM_resource_walk)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_resource_walk:
> if (child == ELEM_resource)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_resource:
> if (child == ELEM_checked_in)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_open_directory:
> if (child == ELEM_open_directory
>@@ -1274,18 +1276,18 @@
> || child == ELEM_delete_entry
> || child == ELEM_prop
> || child == ELEM_checked_in)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_add_directory:
> if (child == ELEM_add_directory
> || child == ELEM_add_file
> || child == ELEM_prop
> || child == ELEM_checked_in)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_open_file:
> if (child == ELEM_checked_in
>@@ -1293,22 +1295,22 @@
> || child == ELEM_prop
> || child == ELEM_fetch_props
> || child == ELEM_remove_prop)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_add_file:
> if (child == ELEM_checked_in
> || child == ELEM_prop)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_checked_in:
>- if (child == NE_ELM_href)
>- return NE_XML_VALID;
>+ if (child == ELEM_href)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_prop:
> /* if (child == ELEM_version_name
>@@ -1317,17 +1319,17 @@
> || child == ELEM_md5_checksum
> || child == ELEM_repository_uuid
> || child == ELEM_remove_prop)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
> */
> /* ### TODO: someday uncomment the block above, and make the
>- else clause return NE_XML_IGNORE. But first, neon needs to
>+ else clause return SVN_RA_DAV__XML_IGNORE. But first, neon needs to
> define that value. :-) */
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
>
> default:
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
> }
>
> /* NOTREACHED */
>@@ -1355,7 +1357,7 @@
> }
>
> /* This implements the `ne_xml_startelm_cb' prototype. */
>-static int start_element(void *userdata, const struct ne_xml_elm *elm,
>+static int start_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> report_baton_t *rb = userdata;
>@@ -1731,7 +1733,7 @@
>
> /* This implements the `ne_xml_endelm_cb' prototype. */
> static int end_element(void *userdata,
>- const struct ne_xml_elm *elm,
>+ const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> report_baton_t *rb = userdata;
>@@ -1813,7 +1815,7 @@
> rb->file_pool = NULL;
> break;
>
>- case NE_ELM_href:
>+ case ELEM_href:
> /* do nothing if we aren't fetching content. */
> if (!rb->fetch_content)
> break;
>Index: subversion/libsvn_ra_dav/options.c
>===================================================================
>--- subversion/libsvn_ra_dav/options.c (revision 6363)
>+++ subversion/libsvn_ra_dav/options.c (working copy)
>@@ -29,10 +29,10 @@
> #include "ra_dav.h"
>
>
>-static const struct ne_xml_elm options_elements[] =
>+static const svn_ra_dav__xml_elm_t options_elements[] =
> {
> { "DAV:", "activity-collection-set", ELEM_activity_coll_set, 0 },
>- { "DAV:", "href", NE_ELM_href, NE_XML_CDATA },
>+ { "DAV:", "href", ELEM_href, SVN_RA_DAV__XML_CDATA },
> { "DAV:", "options-response", ELEM_options_response, 0 },
>
> { NULL }
>@@ -46,49 +46,48 @@
>
>
>
>-static int validate_element(void *userdata, ne_xml_elmid parent,
>- ne_xml_elmid child)
>+static int validate_element(void *userdata, int parent, int child)
> {
> switch (parent)
> {
>- case NE_ELM_root:
>+ case ELEM_root:
> if (child == ELEM_options_response)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_options_response:
> if (child == ELEM_activity_coll_set)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* not concerned with other response */
>+ return SVN_RA_DAV__XML_DECLINE; /* not concerned with other response */
>
> case ELEM_activity_coll_set:
>- if (child == NE_ELM_href)
>- return NE_XML_VALID;
>+ if (child == ELEM_href)
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* not concerned with unknown crud */
>+ return SVN_RA_DAV__XML_DECLINE; /* not concerned with unknown crud */
>
> default:
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
> }
>
> /* NOTREACHED */
> }
>
>-static int start_element(void *userdata, const struct ne_xml_elm *elm,
>+static int start_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> /* nothing to do here */
> return 0;
> }
>
>-static int end_element(void *userdata, const struct ne_xml_elm *elm,
>+static int end_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> options_ctx_t *oc = userdata;
>
>- if (elm->id == NE_ELM_href)
>+ if (elm->id == ELEM_href)
> {
> oc->activity_coll = svn_string_create(cdata, oc->pool);
> }
>Index: subversion/libsvn_ra_dav/util.c
>===================================================================
>--- subversion/libsvn_ra_dav/util.c (revision 6363)
>+++ subversion/libsvn_ra_dav/util.c (working copy)
>@@ -1,5 +1,4 @@
> /*
>- * util.c : utility functions for the RA/DAV library
> *
> * ====================================================================
> * Copyright (c) 2000-2003 CollabNet. All rights reserved.
>@@ -16,6 +15,8 @@
> * ====================================================================
> */
>
>+#include <apr_pools.h>
>+
> #define APR_WANT_STRFUNC
> #include <apr_want.h>
>
>@@ -33,6 +34,109 @@
>
>
>
>+#ifdef SVN_RA_DAV__NEED_SHIM
>+
>+typedef struct {
>+ apr_pool_t *pool;
>+ void *userdata;
>+ const svn_ra_dav__xml_elm_t *elements;
>+ svn_ra_dav__xml_validate_cb *validate_cb;
>+ svn_ra_dav__xml_startelm_cb *startelm_cb;
>+ svn_ra_dav__xml_endelm_cb *endelm_cb;
>+ svn_stringbuf_t *accum;
>+ int state;
>+} shim_baton_t;
>+
>+static const svn_ra_dav__xml_elm_t *lookup_elem(
>+ const svn_ra_dav__xml_elm_t *table,
>+ const char *nspace,
>+ const char *name)
>+{
>+ while(table->nspace)
>+ {
>+ if (strcmp(table->nspace, nspace) == 0
>+ && strcmp(table->name, name) == 0)
>+ return table;
>+ table++;
>+ }
>+ return NULL;
>+}
>+
>+static int shim_startelm(void *userdata, int parent, const char *nspace,
>+ const char *name, const char **attrs)
>+{
>+ const svn_ra_dav__xml_elm_t *elem;
>+ shim_baton_t *baton = userdata;
>+ int rc;
>+
>+ elem = lookup_elem(baton->elements, nspace, name);
>+ if (!elem)
>+ return SVN_RA_DAV__XML_INVALID;
>+
>+ rc = baton->validate_cb(baton->userdata, parent, elem->id);
>+ if (rc < 0)
>+ return rc;
>+
>+ return baton->startelm_cb(baton->userdata, elem, attrs);
>+}
>+
>+static int shim_cdata(void *userdata, int state, const char *cdata, size_t len)
>+{
>+ const svn_ra_dav__xml_elm_t *elem;
>+ shim_baton_t *baton = userdata;
>+ svn_stringbuf_appendbytes(baton->accum, cdata, len);
>+}
>+
>+static int shim_endelm(void *userdata, int parent, const char *nspace,
>+ const char *name)
>+{
>+ const svn_ra_dav__xml_elm_t *elem;
>+ shim_baton_t *baton = userdata;
>+
>+ elem = lookup_elem(baton->elements, nspace, name);
>+ if (!elem)
>+ return SVN_RA_DAV__XML_INVALID;
>+
>+ return baton->endelm_cb(baton->userdata,
>+ elem,
>+ baton->accum->data);
>+}
>+
>+void svn_ra_dav__xml_push_handler(ne_xml_parser *p,
>+ const svn_ra_dav__xml_elm_t *elements,
>+ svn_ra_dav__xml_validate_cb validate_cb,
>+ svn_ra_dav__xml_startelm_cb startelm_cb,
>+ svn_ra_dav__xml_endelm_cb endelm_cb,
>+ void *userdata,
>+ apr_pool_t *pool)
>+{
>+ shim_baton_t *baton = apr_pcalloc(pool, sizeof(shim_baton_t));
>+ baton->pool = pool;
>+ baton->userdata = userdata;
>+ baton->elements = elements;
>+ baton->validate_cb = validate_cb;
>+ baton->startelm_cb = startelm_cb;
>+ baton->endelm_cb = endelm_cb;
>+
>+ ne_xml_push_handler(p, shim_startelm, shim_cdata, shim_endelm, baton);
>+}
>+
>+#else
>+
>+void svn_ra_dav__xml_push_handler(ne_xml_parser *p,
>+ const svn_ra_dav__xml_elm_t *elements,
>+ svn_ra_dav__xml_validate_cb validate_cb,
>+ svn_ra_dav__xml_startelm_cb startelm_cb,
>+ svn_ra_dav__xml_endelm_cb endelm_cb,
>+ void *userdata,
>+ apr_pool_t *pool)
>+{
>+ ne_xml_push_handler(p, elements, validate_cb, startelm_cb, endelm_cb,
>+ userdata);
>+}
>+
>+#endif
>+
> void svn_ra_dav__copy_href(svn_stringbuf_t *dst, const char *src)
> {
> ne_uri parsed_url;
>@@ -98,12 +202,12 @@
> }
>
>
>-static const struct ne_xml_elm error_elements[] =
>+static const svn_ra_dav__xml_elm_t error_elements[] =
> {
> { "DAV:", "error", ELEM_error, 0 },
> { "svn:", "error", ELEM_svn_error, 0 },
> { "http://apache.org/dav/xmlns", "human-readable",
>- ELEM_human_readable, NE_XML_CDATA },
>+ ELEM_human_readable, SVN_RA_DAV__XML_CDATA },
>
> /* ### our validator doesn't yet recognize the rich, specific
> <D:some-condition-failed/> objects as defined by DeltaV.*/
>@@ -113,33 +217,34 @@
>
>
> static int validate_error_elements(void *userdata,
>- ne_xml_elmid parent,
>- ne_xml_elmid child)
>+ int parent,
>+ int child)
> {
> switch (parent)
> {
>- case NE_ELM_root:
>+ case ELEM_root:
> if (child == ELEM_error)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_INVALID;
>+ return SVN_RA_DAV__XML_INVALID;
>
> case ELEM_error:
> if (child == ELEM_svn_error
> || child == ELEM_human_readable)
>- return NE_XML_VALID;
>+ return SVN_RA_DAV__XML_VALID;
> else
>- return NE_XML_DECLINE; /* ignore if something else was in there */
>+ return SVN_RA_DAV__XML_DECLINE; /* ignore if something else was
>+ in there */
>
> default:
>- return NE_XML_DECLINE;
>+ return SVN_RA_DAV__XML_DECLINE;
> }
>
> /* NOTREACHED */
> }
>
>
>-static int start_err_element(void *userdata, const struct ne_xml_elm *elm,
>+static int start_err_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char **atts)
> {
> svn_error_t **err = userdata;
>@@ -176,7 +281,7 @@
> return 0;
> }
>
>-static int end_err_element(void *userdata, const struct ne_xml_elm *elm,
>+static int end_err_element(void *userdata, const svn_ra_dav__xml_elm_t *elm,
> const char *cdata)
> {
> svn_error_t **err = userdata;
>@@ -256,10 +361,10 @@
> apr_file_t *body_file,
> void set_parser (ne_xml_parser *parser,
> void *baton),
>- const struct ne_xml_elm *elements,
>- ne_xml_validate_cb validate_cb,
>- ne_xml_startelm_cb startelm_cb,
>- ne_xml_endelm_cb endelm_cb,
>+ const svn_ra_dav__xml_elm_t *elements,
>+ svn_ra_dav__xml_validate_cb validate_cb,
>+ svn_ra_dav__xml_startelm_cb startelm_cb,
>+ svn_ra_dav__xml_endelm_cb endelm_cb,
> void *baton,
> apr_hash_t *extra_headers,
> apr_pool_t *pool)
>@@ -305,8 +410,9 @@
>
> /* create a parser to read the normal response body */
> success_parser = ne_xml_create();
>- ne_xml_push_handler(success_parser, elements,
>- validate_cb, startelm_cb, endelm_cb, baton);
>+ svn_ra_dav__xml_push_handler(success_parser, elements,
>+ validate_cb, startelm_cb, endelm_cb, baton,
>+ pool);
>
> /* if our caller is interested in having access to this parser, call
> the SET_PARSER callback with BATON. */
>@@ -315,8 +421,9 @@
>
> /* create a parser to read the <D:error> response body */
> error_parser = ne_xml_create();
>- ne_xml_push_handler(error_parser, error_elements, validate_error_elements,
>- start_err_element, end_err_element, &err);
>+ svn_ra_dav__xml_push_handler(error_parser, error_elements,
>+ validate_error_elements, start_err_element,
>+ end_err_element, &err, pool);
>
> /* Register the "main" accepter and body-reader with the request --
> the one to use when the HTTP status is 2XX */
>@@ -445,8 +552,9 @@
>
> /* attach a standard <D:error> body parser to the request */
> error_parser = ne_xml_create();
>- ne_xml_push_handler(error_parser, error_elements, validate_error_elements,
>- start_err_element, end_err_element, &err);
>+ svn_ra_dav__xml_push_handler(error_parser, error_elements,
>+ validate_error_elements, start_err_element,
>+ end_err_element, &err, pool);
> ne_add_response_body_reader(request, ra_dav_error_accepter,
> ne_xml_parse_v, error_parser);
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 28 00:07:10 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.