httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Morgan <rmor...@covalent.net>
Subject Re: cvs commit: httpd-2.0/server protocol.c
Date Tue, 13 Nov 2001 00:07:59 GMT
On Mon, Nov 12, 2001 at 05:43:25PM -0600, William A. Rowe, Jr. wrote:
> From: "Ryan Morgan" <rmorgan@covalent.net>
> Sent: Monday, November 12, 2001 4:29 PM
> 
> 
> > It would be even better if ap_getline would return an apr_status_t rather
> > than the number of bytes read.  This would allow callers of ap_getline to
> > detect errors like timeouts, etc from within ap_getline.  Currently we just
> > return the number of bytes read, or -1 on error.
> > 
> > The length parameter could be passed into the function and modified like
> > is done in apr calls that return data.
> > 
> > Thoughts anyone?  I could put together a patch if others see this as a
> > useful feature.
> 
> If used properly, the length saves us a strlen() call, so the existing
> prototype is rather useful.
>

That's why I suggested adding an extra length parameter to ap_getline that 
gets modified to the length of the data read.. or am I missing something?

IMO the current prototype is lacking since we only know if an error occurred,
and not what the exact error was.  This may be acceptable for HTTP, but 
other protocols may require more knowledge for reporting back to the client. 

-Ryan 

Mime
View raw message