apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: [PATCH] fix apr_xlate_conv_buffer and testxlate
Date Fri, 19 Nov 2004 16:07:54 GMT
On Fri, Nov 19, 2004 at 09:03:40AM -0500, Jeff Trawick wrote:
> On Thu, 18 Nov 2004 17:22:50 +0100, Uwe Zeisberger
> <zeisberg@informatik.uni-freiburg.de> wrote:
> 
> > Below comes a log and a patch. I assume, that apr_xlate_conv_buffer
> > should convert inbuf and assume, that the strings ends then. Else its
> > use in test/testxlate.c is not appropriate.
> 
> it was assumed that the application does not have the knowledge to
> guarantee that complete characters are always passed to
> apr_xlate_conv_buffer(); instead, we only assume that the complete
> stream of data passed by the application over multiple calls to
> apr_xlate_conv_buffer() ends with a complete character (or app gets
> the INCOMPLETE return code on last call and realizes there is a
> problem since there is no more input data which could complete the
> character)
> 
> it is a big burden on the application to know when a character ends
> 
> or am I misunderstanding you?

The app must know when the *sequence of characters* ends, and this is
what needs to be passed through to the xlate layer so it can call
iconv(,NULL,NULL,,) to correctly terminate the output sequence for a
stateful encoding like UTF-7.

I think the correct fix is going to be to have the app pass inbuf = NULL
to indicate end of stream as per iconv().

Does this test case work with apr-iconv, does anyone know?

joe


Mime
View raw message