chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Faster read for custom input ports?


From: felix winkelmann
Subject: Re: [Chicken-users] Faster read for custom input ports?
Date: Wed, 8 Feb 2006 08:18:57 +0100

On 2/7/06, Reed Sheridan <address@hidden> wrote:
> The C function that my fastcgi library uses to read input has the prototype:
>
> int FCGX_GetStr(char *str, int n, FCGX_Stream *stream);
>
> I have defined a custom input port with make-input-port that uses this, but
> the read procedure provided by this only reads one byte at a time.  This is
> too inefficient, so I'm forced to provide a separate read function which
> breaks the port abstraction, which I'd rather not do (especially since I
> want code to be portable from any *cgi protocol).  Is there a way to read a
> port which, at a low level, will call
> FCGX_GetStr(str,some_large_number,streamp) ?
>

In fact, a read-string method for port objects (ports are basically just
a collection of procedures) is already on my todo-list, but I just don't
get around doing this.

I think Thomas is right: perhaps you can read in advance in your custom
port and keep an intermediate buffer?


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]