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

Re: svn commit: r25630 - trunk/subversion/libsvn_ra_serf

From: Ivan Zhakov <zhakov_at_tigris.org>
Date: 2007-07-04 16:57:54 CEST

On 7/4/07, Erik Huelsmann <ehuels@gmail.com> wrote:
> On 7/3/07, zhakov@tigris.org <zhakov@tigris.org> wrote:
> > Author: zhakov
> > Date: Tue Jul 3 01:21:25 2007
> > New Revision: 25630
> >
> > Log:
> > ra_serf: Replace several abort() calls to errors.
> >
> > * subversion/libsvn_ra_serf/blame.c
> > (cdata_blame): Return error from svn_stream_write() if it occur.
> > * subversion/libsvn_ra_serf/property.c
> > () Include svn_private_config.h for '_()'.
> > (end_propfind): Generate error on unknown encoding instead of abort().
> >
> > Modified:
> > trunk/subversion/libsvn_ra_serf/blame.c
> > trunk/subversion/libsvn_ra_serf/property.c
> >
> > Modified: trunk/subversion/libsvn_ra_serf/blame.c
> > URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_ra_serf/blame.c?pathrev=25630&r1=25629&r2=25630
> > ==============================================================================
> > --- trunk/subversion/libsvn_ra_serf/blame.c (original)
> > +++ trunk/subversion/libsvn_ra_serf/blame.c Tue Jul 3 01:21:25 2007
> > @@ -2,7 +2,7 @@
> > * blame.c : entry point for blame RA functions for ra_serf
> > *
> > * ====================================================================
> > - * Copyright (c) 2006 CollabNet. All rights reserved.
> > + * Copyright (c) 2006-2007 CollabNet. All rights reserved.
> > *
> > * This software is licensed as described in the file COPYING, which
> > * you should have received as part of this distribution. The terms
> > @@ -349,11 +349,7 @@
> >
> > ret_len = len;
> >
> > - svn_stream_write(info->stream, data, &ret_len);
> > - if (ret_len != len)
> > - {
> > - abort();
> > - }
> > + SVN_ERR(svn_stream_write(info->stream, data, &ret_len));
> > }
>
> Hi Ivan,
>
> The above fixes an error leak, but you also changed the meaning of the
> code: it won't stop or error out if (ret_len != len).
>
> Maybe we do need to raise an error (such as "unexpected end of
> stream") in that case too?
>
Hi Erik,
I had the same idea, but according svn_stream_t documentation that's
cannot occur without raising error:
[[
 * The read and write handlers accept length arguments via pointer.
 * On entry to the handler, the pointed-to value should be the amount
 * of data which can be read or the amount of data to write. When the
 * handler returns, the value is reset to the amount of data actually
 * read or written. Handlers are obliged to complete a read or write
 * to the maximum extent possible; thus, a short read with no
 * associated error implies the end of the input stream, and a short
 * write should never occur without an associated error.
]]

May be we need comment or debug check. Personally I don't like idea to
check everything which cannot be happen by interface agreement.

-- 
Ivan Zhakov
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 4 16:57:43 2007

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.