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

Re: svn commit: r1349545 - /subversion/trunk/subversion/libsvn_ra_serf/util.c

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Wed, 13 Jun 2012 02:14:37 +0200

On Tue, Jun 12, 2012 at 11:20 PM, <jerenkrantz_at_apache.org> wrote:
> Author: jerenkrantz
> Date: Tue Jun 12 21:20:51 2012
> New Revision: 1349545
>
> URL: http://svn.apache.org/viewvc?rev=1349545&view=rev
> Log:
> Fix lock tests #37 & #42 by properly calling our XML error response delegator.
>
> * subversion/libsvn_ra_serf/util.c
>  (handle_response): Appropriately set up the error callbacks or use our
>  defaults if there is no XML error response with a friendly message.
>
> Modified:
>    subversion/trunk/subversion/libsvn_ra_serf/util.c
>
> Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1349545&r1=1349544&r2=1349545&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
> +++ subversion/trunk/subversion/libsvn_ra_serf/util.c Tue Jun 12 21:20:51 2012
> @@ -1843,28 +1843,43 @@ handle_response(serf_request_t *request,
>       /* 405 Method Not allowed.
>          409 Conflict: can indicate a hook error.
>          5xx (Internal) Server error. */
> -      /* ### this is completely wrong. it only catches the current network
> -         ### packet. we need ongoing parsing. see SERVER_ERROR down below
> -         ### in the process_body: area. we'll eventually move to that.  */
> -      SVN_ERR(handle_server_error(request, response, scratch_pool));
> +      serf_bucket_t *hdrs;
> +      const char *val;
>
> -      if (!handler->session->pending_error)
> +      hdrs = serf_bucket_response_get_headers(response);
> +      val = serf_bucket_headers_get(hdrs, "Content-Type");
> +      if (val && strncasecmp(val, "text/xml", sizeof("text/xml") - 1) == 0)
>         {
> -          apr_status_t apr_err = SVN_ERR_RA_DAV_REQUEST_FAILED;
> +          svn_ra_serf__server_error_t *server_err;
>
> -          /* 405 == Method Not Allowed (Occurs when trying to lock a working
> -             copy path which no longer exists at HEAD in the repository. */
> -          if (handler->sline.code == 405
> -              && strcmp(handler->method, "LOCK") == 0)
> -            apr_err = SVN_ERR_FS_OUT_OF_DATE;
> +          server_err = begin_error_parsing(start_error, end_error, cdata_error,
> +                                           handler->handler_pool);
> +          /* Get the parser to set our DONE flag.  */
> +          server_err->parser.done = &handler->done;
>
> -          return svn_error_createf(apr_err, NULL,
> -                                   _("%s request on '%s' failed: %d %s"),
> +          handler->server_error = server_err;
> +        }
> +      else
> +        {
> +          handler->discard_body = TRUE;
> +
> +          if (!handler->session->pending_error)
> +            {
> +              apr_status_t apr_err = SVN_ERR_RA_DAV_REQUEST_FAILED;
> +
> +              /* 405 == Method Not Allowed (Occurs when trying to lock a working
> +                copy path which no longer exists at HEAD in the repository. */
> +              if (handler->sline.code == 405
> +                  && strcmp(handler->method, "LOCK") == 0)
> +                apr_err = SVN_ERR_FS_OUT_OF_DATE;
> +
> +              handler->session->pending_error =
> +                  svn_error_createf(apr_err, NULL,
> +                                    _("%s request on '%s' failed: %d %s"),
>                                    handler->method, handler->path,
>                                    handler->sline.code, handler->sline.reason);
> +            }
>         }
> -
> -      return SVN_NO_ERROR; /* Error is set in caller */
>     }
>
>   /* Stop processing the above, on every packet arrival.  */

This fixes those lock tests, but apparently causes authz_tests.py#13
("authz issue #2712") to go into an infinite loop (pegging a cpu).
This happens with and without SurfShield, and I think the
svn-slik-w2k3-x64-ra buildbot is seeing it too.

I can reproduce this from my debugger by executing the last command
from that test:

svn.exe switch http://localhost/svn-test-work/local_tmp/repos/A/B/E
svn-test-work\working_copies\authz_tests-14\A\D\G --ignore-ancestry
--config-dir R:\test\subversion\tests\cmdline\svn-test-work\local_tmp\config
--password rayjandom --no-auth-cache --username jrandom

So maybe we can take another look at this tomorrow (unless someone
else fixes it first of course :-)).

-- 
Johan
Received on 2012-06-13 02:15:30 CEST

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.