Checkout
rhuijben
committed
on 04 Jul 13
Extend the transition based xml parser in ra_serf with two features:
- explicit http status value checking
- an optional done callback

In m… Show more
Extend the transition based xml parser in ra_serf with two features:

- explicit http status value checking

- an optional done callback

In multi-request operations as update and replay a success callback

is needed to mark a request as done, and to signal the context loop that

cleanup work is needed.

This commit adds the necessary plumbing to provide better error handling

and to support the conversion of the replay handling, which I will add as

separate patches.

* subversion/libsvn_ra_serf/blame.c

 (svn_ra_serf__get_file_revs): Update caller.

* subversion/libsvn_ra_serf/getdate.c

 (svn_ra_serf__get_dated_revision): Update caller.

* subversion/libsvn_ra_serf/getlocations.c

 (svn_ra_serf__get_locations): Update caller.

* subversion/libsvn_ra_serf/getlocationsegments.c

 (svn_ra_serf__get_location_segments): Update caller.

* subversion/libsvn_ra_serf/getlocks.c

 (svn_ra_serf__get_locks): Update caller.

* subversion/libsvn_ra_serf/get_deleted_rev.c

 (svn_ra_serf__get_deleted_rev): Update caller.

* subversion/libsvn_ra_serf/inherited_props.c

 (svn_ra_serf__get_inherited_props): Update caller.

* subversion/libsvn_ra_serf/locks.c

 (locks_expected_status): New variable.

 (svn_ra_serf__get_lock): Update caller. Expect status 207.

 (svn_ra_serf__lock): Update caller.

* subversion/libsvn_ra_serf/log.c

 (svn_ra_serf__get_log): Update caller.

* subversion/libsvn_ra_serf/merge.c

 (svn_ra_serf__run_merge): Update caller.

* subversion/libsvn_ra_serf/mergeinfo.c

 (svn_ra_serf__get_mergeinfo): Update caller.

* subversion/libsvn_ra_serf/options.c

 (create_options_req): Update caller.

* subversion/libsvn_ra_serf/property.c

 (propfind_expected_status): New variable.

 (svn_ra_serf__deliver_props): Update caller. Expect 207.

* subversion/libsvn_ra_serf/ra_serf.h

 (svn_ra_serf__xml_done_t): New type.

 (svn_ra_serf__xml_context_create): Add done_cb argument.

 (svn_ra_serf__create_expat_handler): Add expected status argument.

* subversion/libsvn_ra_serf/util.c

 (expat_ctx_t): Add expected status.

 (expat_response_handler): Handle expected status. Use slightly safer

   check for parser failures.

 (svn_ra_serf__create_expat_handler): Store expected_status.

* subversion/libsvn_ra_serf/xml.c

 (svn_ra_serf__xml_context_t): Add callback.

 (svn_ra_serf__xml_context_done): Call done callback if available.

 (svn_ra_serf__xml_context_create): Store done callback.

Show less