On June 6, 2007 9:01:45 PM +0100 Joe Orton <[EMAIL PROTECTED]> wrote:
On Wed, Jun 06, 2007 at 12:37:18PM -0700, Frank Cusack wrote:
On June 6, 2007 8:22:44 PM +0100 Joe Orton <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 05, 2007 at 12:34:48PM -0700, Frank Cusack wrote:
>> On June 3, 2007 6:41:32 PM -0700 Frank Cusack <[EMAIL PROTECTED]>
>> wrote:
>>> If I do ne_get(session, path, fd), how do I know when I've read the
>>> entire response from fd?
>>
>> come on, no one knows the answer to this?
>
> ne_get() writes the entire response to the given fd.  When reading the
> file, the response ends when the file ends - at EOF.

ne_get() does not close the fd after it is finished writing the response.

Right - since it didn't open it either.  If you want to leave the fd
open then you can use lseek(fd, 0, SEEK_CUR) or similar to determine the
file pointer position (before and after) and derive the response length
like that.

that doesn't work on a pipe though.

best solutions i can think of are

- have a call that can retrieve the content-length, then i know how much
 to read()
- set a flag telling ne_get to close the fd

will you accept a patch for the latter option?  i'm trying to use neon
because it's simpler than some of the others, e.g. libcurl.  but i need
a reliable EOF indicator.

-frank
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to