You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@attglobal.net> on 2001/08/03 14:28:53 UTC

APR_INCOMPLETE confusion

I'm happy to create a new APR_INCOMPLETE_CHAR status, hijack the
current doc for APR_INCOMPLETE, and change Apache/APR as appropriate.

Does APR_INCOMPLETE (for incomplete file status) need to be renamed as
well for clarity?  APR_INCOMPLETE_STATUS may be sufficiently clear.

Comments?
-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: APR_INCOMPLETE confusion

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@rowe-clan.net> writes:

> > maybe the description of APR_INCOMPLETE should be made more vague
> > (slightly less useful to somebody trying to see what it means) to
> > cover different uses?
> > 
> > but programmers are one thing, and they can grep the source code if
> > they're confused; end users are yet another, and there is no easy
> > workaround for a vague error string from apr_strerror()
> > 
> > > The flavors I can see are;
> > > 
> > > APR_SUCCESS   processed all input, provided all expected output
> > > 
> > > APR_???       processed all input, can only provide some expected output
> > >               (generally a system limitation, such as stat)
> > > 
> > > APR_???       processed some input, but remaining input is _invalid_
> > >               (as apr_xlate means, are we expecting more input?)
> > > 
> > > APR_???       processed some input, have more output but the output buffer
> > >               is filled (apr_xlate treats this as APR_SUCCESS, which probably 
> > >               isn't entirely healthy.)
> > 
> > it is an expected condition; nothing is wrong with the input :)
> 
> All these incompletes are 'expected conditions', that doesn't mean they don't
> get an apr_status_t _status_ result (as opposed to an error result).  For example,
> where APR_OOPS means our buffer filled, and APR_UGH means we are still looking...

okay, okay, you're right of course :)

The simple fact is that I barely have time now to try to make truly
broken stuff work properly; I thought I would try to spend minimial
time and lessen the confusion between the different uses of
APR_INCOMPLETE; apparently there is no palatable quick fix.

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: APR_INCOMPLETE confusion

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Jeff Trawick" <tr...@attglobal.net>
Sent: Friday, August 03, 2001 12:25 PM


> "William A. Rowe, Jr." <wr...@rowe-clan.net> writes:
> 
> > From: "Jeff Trawick" <tr...@attglobal.net>
> > Sent: Friday, August 03, 2001 7:28 AM
> > 
> > 
> > > I'm happy to create a new APR_INCOMPLETE_CHAR status, hijack the
> > > current doc for APR_INCOMPLETE, and change Apache/APR as appropriate.
> > > 
> > > Does APR_INCOMPLETE (for incomplete file status) need to be renamed as
> > > well for clarity?  APR_INCOMPLETE_STATUS may be sufficiently clear.
> > > 
> > > Comments?
> > 
> > the list seems to have an issue with the proliferation of error result codes.  
> > I don't have a set opinion on this, and certainly a few more will be warrented 
> > over time.
> 
> maybe the description of APR_INCOMPLETE should be made more vague
> (slightly less useful to somebody trying to see what it means) to
> cover different uses?
> 
> but programmers are one thing, and they can grep the source code if
> they're confused; end users are yet another, and there is no easy
> workaround for a vague error string from apr_strerror()
> 
> > The flavors I can see are;
> > 
> > APR_SUCCESS   processed all input, provided all expected output
> > 
> > APR_???       processed all input, can only provide some expected output
> >               (generally a system limitation, such as stat)
> > 
> > APR_???       processed some input, but remaining input is _invalid_
> >               (as apr_xlate means, are we expecting more input?)
> > 
> > APR_???       processed some input, have more output but the output buffer
> >               is filled (apr_xlate treats this as APR_SUCCESS, which probably 
> >               isn't entirely healthy.)
> 
> it is an expected condition; nothing is wrong with the input :)

All these incompletes are 'expected conditions', that doesn't mean they don't
get an apr_status_t _status_ result (as opposed to an error result).  For example,
where APR_OOPS means our buffer filled, and APR_UGH means we are still looking...

eg 

    do {
        load up the inbuf (may not be entirely empty)

        while ((rv = apr_xlate_thing(inbuf, outbuf)) == APR_OOOPS) {
            /* empty the outbuf and continue */
            if (cant_empty)
                break;
        }

    } while (more_input && (rv == APR_SUCCESS || rv == APR_UGH))

    if (rv)
        emit_error(rv);

gives us many possibilities...

rv == APR_OOOPS - "Insufficient Buffer" (forgot to check?)
rv == APR_UGH   - "Invalid trailing character" (forgot more input?)
rv == APR_other - something's broken

rv == APR_SUCCESS - no error :)

Bill



Re: APR_INCOMPLETE confusion

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@rowe-clan.net> writes:

> From: "Jeff Trawick" <tr...@attglobal.net>
> Sent: Friday, August 03, 2001 7:28 AM
> 
> 
> > I'm happy to create a new APR_INCOMPLETE_CHAR status, hijack the
> > current doc for APR_INCOMPLETE, and change Apache/APR as appropriate.
> > 
> > Does APR_INCOMPLETE (for incomplete file status) need to be renamed as
> > well for clarity?  APR_INCOMPLETE_STATUS may be sufficiently clear.
> > 
> > Comments?
> 
> the list seems to have an issue with the proliferation of error result codes.  
> I don't have a set opinion on this, and certainly a few more will be warrented 
> over time.

maybe the description of APR_INCOMPLETE should be made more vague
(slightly less useful to somebody trying to see what it means) to
cover different uses?

but programmers are one thing, and they can grep the source code if
they're confused; end users are yet another, and there is no easy
workaround for a vague error string from apr_strerror()

> The flavors I can see are;
> 
> APR_SUCCESS   processed all input, provided all expected output
> 
> APR_???       processed all input, can only provide some expected output
>               (generally a system limitation, such as stat)
> 
> APR_???       processed some input, but remaining input is _invalid_
>               (as apr_xlate means, are we expecting more input?)
> 
> APR_???       processed some input, have more output but the output buffer
>               is filled (apr_xlate treats this as APR_SUCCESS, which probably 
>               isn't entirely healthy.)

it is an expected condition; nothing is wrong with the input :)

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: APR_INCOMPLETE confusion

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Jeff Trawick" <tr...@attglobal.net>
Sent: Friday, August 03, 2001 7:28 AM


> I'm happy to create a new APR_INCOMPLETE_CHAR status, hijack the
> current doc for APR_INCOMPLETE, and change Apache/APR as appropriate.
> 
> Does APR_INCOMPLETE (for incomplete file status) need to be renamed as
> well for clarity?  APR_INCOMPLETE_STATUS may be sufficiently clear.
> 
> Comments?

the list seems to have an issue with the proliferation of error result codes.  
I don't have a set opinion on this, and certainly a few more will be warrented 
over time.

The flavors I can see are;

APR_SUCCESS   processed all input, provided all expected output

APR_???       processed all input, can only provide some expected output
              (generally a system limitation, such as stat)

APR_???       processed some input, but remaining input is _invalid_
              (as apr_xlate means, are we expecting more input?)

APR_???       processed some input, have more output but the output buffer
              is filled (apr_xlate treats this as APR_SUCCESS, which probably 
              isn't entirely healthy.)

More thoughts?

> On Sunday 29 July 2001 17:36, Marc Slemko wrote:
> > apr_errno.h says:
> >
> >  * APR_INCOMPLETE     The character conversion stopped because of an
> >  *                    incomplete character or shift sequence at the end
> >  *                    of the input buffer.
> >
> > This doesn't seem to be a good description of what it is used for
> > in reality...  since it seems to be used for functions that can return
> > partially filled structures.
> >
> > Could someone who is positive of what it is used for maybe update this
> > comment to make it less misleading?
> 
> -- 
> 
> _____________________________________________________________________________
> Ryan Bloom                        rbb@apache.org
> Covalent Technologies rbb@covalent.net
> -----------------------------------------------------------------------------
>