You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/07/03 16:19:10 UTC

svn commit: r1499416 - /subversion/trunk/subversion/libsvn_ra_serf/update.c

Author: rhuijben
Date: Wed Jul  3 14:19:10 2013
New Revision: 1499416

URL: http://svn.apache.org/r1499416
Log:
Following up on r1499393, remove done variable from report baton that should
not be used separately from the handler done variable, as that breaks parsing
responses.

This might resolve some hard to test error handling issues.

* subversion/libsvn_ra_serf/update.c
  (report_state_e): Use proper macro.
  (report_context_t): Remove variable.
  (update_ttable): Request callback on close of document element.
  (update_closed): Don't reset done. The xml parser handles the handler done
    for us.
  (finish_report): Use handler->done as loop check and remove last usages of
    parser_ctx when USE_TRANSITION_PARSER.

  (make_update_reporter): Update baton initialization.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1499416&r1=1499415&r2=1499416&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Wed Jul  3 14:19:10 2013
@@ -82,7 +82,7 @@ typedef enum report_state_e {
     NEED_PROP_NAME,
     TXDELTA
 
-#ifdef NOT_USED_YET
+#ifdef USE_TRANSITION_PARSER
     ,
 
     CHECKED_IN,
@@ -390,9 +390,6 @@ struct report_context_t {
   /* The path to the REPORT request */
   const char *path;
 
-  /* Are we done parsing the REPORT response? */
-  svn_boolean_t done;
-
   /* Did we receive all data from the network? */
   svn_boolean_t report_received;
 
@@ -414,7 +411,7 @@ struct report_context_t {
 #define V_ SVN_DAV_PROP_NS_DAV
 static const svn_ra_serf__xml_transition_t update_ttable[] = {
   { INITIAL, S_, "update-report", UPDATE_REPORT,
-    FALSE, { NULL }, FALSE },
+    FALSE, { NULL }, TRUE },
 
   { UPDATE_REPORT, S_, "target-revision", TARGET_REVISION,
     FALSE, { "rev", NULL }, TRUE },
@@ -2568,7 +2565,6 @@ update_closed(svn_ra_serf__xml_estate_t 
   if (leaving_state == UPDATE_REPORT)
     {
       ctx->report_completed = TRUE;
-      ctx->done = TRUE;
     }
   else if (leaving_state == TARGET_REVISION)
     {
@@ -2820,9 +2816,10 @@ finish_report(void *report_baton,
   report_context_t *report = report_baton;
   svn_ra_serf__session_t *sess = report->sess;
   svn_ra_serf__handler_t *handler;
-  svn_ra_serf__xml_parser_t *parser_ctx;
 #ifdef USE_TRANSITION_PARSER
   svn_ra_serf__xml_context_t *xmlctx;
+#else
+  svn_ra_serf__xml_parser_t *parser_ctx;
 #endif
   const char *report_target;
   svn_stringbuf_t *buf = NULL;
@@ -2885,7 +2882,7 @@ finish_report(void *report_baton,
   parser_ctx->start = start_report;
   parser_ctx->end = end_report;
   parser_ctx->cdata = cdata_report;
-  parser_ctx->done = &report->done;
+  parser_ctx->done = &handler->done;
 
   handler->response_handler = svn_ra_serf__handle_xml_parser;
   handler->response_baton = parser_ctx;
@@ -2905,7 +2902,7 @@ finish_report(void *report_baton,
      network or because we've spooled the entire response into our "pending"
      content of the XML parser. The DONE flag will get set when all the
      XML content has been received *and* parsed.  */
-  while (!report->done
+  while (!handler->done
          || report->num_active_fetches
          || report->num_active_propfinds)
     {
@@ -3145,6 +3142,7 @@ finish_report(void *report_baton,
         }
       report->done_dir_propfinds = NULL;
 
+#ifndef USE_TRANSITION_PARSER
       /* If the parser is paused, and the number of active requests has
          dropped far enough, then resume parsing.  */
       if (parser_ctx->paused
@@ -3159,6 +3157,7 @@ finish_report(void *report_baton,
         SVN_ERR(svn_ra_serf__process_pending(parser_ctx,
                                              &report->report_received,
                                              iterpool_inner));
+#endif
 
       /* Debugging purposes only! */
       for (i = 0; i < sess->num_conns; i++)
@@ -3279,7 +3278,6 @@ make_update_reporter(svn_ra_session_t *r
 
   report->update_editor = update_editor;
   report->update_baton = update_baton;
-  report->done = FALSE;
 
   *reporter = &ra_serf_reporter;
   *report_baton = report;