Checkout
rhuijben
committed
on 29 Dec 13
Consolidate http status and server error reporting in a new handler
callback to avoid leaking server errors (which causes an error leak)
and… Show more
Consolidate http status and server error reporting in a new handler

callback to avoid leaking server errors (which causes an error leak)

and to simplify usage. This patch also removes the xml handling done

handler that was a workaround for this plumbing for a few specific

handlers.

This finally makes it possible to make progress towards converting

the update implementation to the transition based xml parser.

* 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/get_lock.c

 (svn_ra_serf__get_lock): Update caller.

* subversion/libsvn_ra_serf/inherited_props.c

 (svn_ra_serf__get_inherited_props): Update caller.

* subversion/libsvn_ra_serf/lock.c

 (run_locks): Update caller. Handle server errors the new way.

* 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/multistatus.c

 (multistatus_opened): Document a bit of history.

 (multistatus_closed): Update for baton changes.

 (multistatus_done): Rename to...

 (svn_ra_serf__server_error_create): ... this and update usage

   pattern to avoid error leaks. Add some comments.

 (svn_ra_serf__setup_error_parsing): Update caller.

 (svn_ra_serf__handle_server_error): Handle eof for 207 responses.

* subversion/libsvn_ra_serf/options.c

 (create_options_req): Update caller. Use standard error handling.

* subversion/libsvn_ra_serf/property.c

 (svn_ra_serf__deliver_props): Update caller.

* subversion/libsvn_ra_serf/ra_serf.h

 (svn_ra_serf__response_done_delegate_t): New type.

 (svn_ra_serf__handler_t): Add done handler.

 (svn_ra_serf__xml_done_t): Remove type.

 (svn_ra_serf__xml_context_create): Remove argument.

 (svn_ra_serf__server_error_t): Remove error and keep track of original

   handler instead of just the status line to allow clearing server error.

 (svn_ra_serf__server_error_create): New function.

* subversion/libsvn_ra_serf/replay.c

 (replay_done): Convert from svn_ra_serf__xml_done_t to

   svn_ra_serf__response_done_delegate_t.

 (svn_ra_serf__replay): Update caller.

 (svn_ra_serf__replay_range): Update caller.

* subversion/libsvn_ra_serf/update.c

 (finish_report): Check server error when the response is done.

* subversion/libsvn_ra_serf/util.c

 (svn_ra_serf__context_run_one): Remove server error handling.

 (handle_response): Remove unexpected status handling from here.

 (handle_response_cb): Call done handler (when done).

 (response_done): New function.

 (svn_ra_serf__create_handler): Setup response_done as default done handler.

* subversion/libsvn_ra_serf/xml.c

 (svn_ra_serf__xml_context_t): Remove done callback.

 (svn_ra_serf__xml_context_done): Stop calling done callback.

 (svn_ra_serf__xml_context_create): Remove done setup.

Show less