You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ivan Zhakov <iv...@visualsvn.com> on 2013/07/12 15:26:33 UTC

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

On Tue, Jul 9, 2013 at 3:57 PM,  <rh...@apache.org> wrote:
> Author: rhuijben
> Date: Tue Jul  9 11:57:46 2013
> New Revision: 1501207
>
> URL: http://svn.apache.org/r1501207
> Log:
> Stop ignoring xml parser errors in three places in ra_serf. These parse errors
> might be caused by broken network requests, or requests that should have had a
> body. In all cases ignoring the parser errors made true errors hard to detect.
>
> * subversion/libsvn_ra_serf/util.c
>   (inject_to_parser,
>    svn_ra_serf__process_pending,
>    svn_ra_serf__handle_xml_parser): Properly handle xml parser errors.
>
[...]

> @@ -1485,14 +1487,24 @@ svn_ra_serf__process_pending(svn_ra_serf
>    if (pending_empty &&
>        parser->pending->network_eof)
>      {
> +      int xml_status;
>        SVN_ERR_ASSERT(parser->xmlp != NULL);
>
> -      /* Tell the parser that no more content will be parsed. Ignore the
> -         return status. We just don't care.  */
> -      (void) XML_Parse(parser->xmlp, NULL, 0, 1);
> +      /* Tell the parser that no more content will be parsed. */
> +      xml_status = XML_Parse(parser->xmlp, NULL, 0, 1);
>
>        apr_pool_cleanup_run(parser->pool, &parser->xmlp, xml_parser_cleanup);
>        parser->xmlp = NULL;
> +
> +      if (! parser->ignore_errors)
> +        {
> +          SVN_ERR(parser->error);
> +
> +          if (xml_status != XML_STATUS_OK)
> +            {
> +            }
Hi Bert,

What is the purpose of this condition with empty body?


-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com

RE: svn commit: r1501207 - /subversion/trunk/subversion/libsvn_ra_serf/util.c

Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Ivan Zhakov [mailto:ivan@visualsvn.com]
> Sent: vrijdag 12 juli 2013 15:27
> To: dev@subversion.apache.org; Bert Huijben
> Subject: Re: svn commit: r1501207 -
> /subversion/trunk/subversion/libsvn_ra_serf/util.c
> 
> On Tue, Jul 9, 2013 at 3:57 PM,  <rh...@apache.org> wrote:
> > Author: rhuijben
> > Date: Tue Jul  9 11:57:46 2013
> > New Revision: 1501207
> >
> > URL: http://svn.apache.org/r1501207
> > Log:
> > Stop ignoring xml parser errors in three places in ra_serf. These parse
> errors
> > might be caused by broken network requests, or requests that should have
> had a
> > body. In all cases ignoring the parser errors made true errors hard to
> detect.
> >
> > * subversion/libsvn_ra_serf/util.c
> >   (inject_to_parser,
> >    svn_ra_serf__process_pending,
> >    svn_ra_serf__handle_xml_parser): Properly handle xml parser errors.
> >
> [...]
> 
> > @@ -1485,14 +1487,24 @@ svn_ra_serf__process_pending(svn_ra_serf
> >    if (pending_empty &&
> >        parser->pending->network_eof)
> >      {
> > +      int xml_status;
> >        SVN_ERR_ASSERT(parser->xmlp != NULL);
> >
> > -      /* Tell the parser that no more content will be parsed. Ignore the
> > -         return status. We just don't care.  */
> > -      (void) XML_Parse(parser->xmlp, NULL, 0, 1);
> > +      /* Tell the parser that no more content will be parsed. */
> > +      xml_status = XML_Parse(parser->xmlp, NULL, 0, 1);
> >
> >        apr_pool_cleanup_run(parser->pool, &parser->xmlp,
> xml_parser_cleanup);
> >        parser->xmlp = NULL;
> > +
> > +      if (! parser->ignore_errors)
> > +        {
> > +          SVN_ERR(parser->error);
> > +
> > +          if (xml_status != XML_STATUS_OK)
> > +            {
> > +            }
> Hi Bert,
> 
> What is the purpose of this condition with empty body?

I intended to copy&paste one of the existing error blocks here, but I forgot to do that before committing.

Fixed in r1502777.

	Bert