bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Gawk [maynot] bug: Two-way IO getline stuff


From: Jürgen Kahrs
Subject: Re: Gawk [maynot] bug: Two-way IO getline stuff
Date: Sat, 25 Jul 2009 19:47:28 +0200
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

wxc wrote:

> since, in a http POST request header, content-lengh are supplied
> clarifying the length of post-data, after the header, there are exactly
> content-lengh bytes of post-data without any new line or something, that
> means if getline try to read them, it get stuck waiting for the RS.

Right, this is a problem, but not a bug.
You may try to match the body of the POST-data to a regexp.
The regexp should be an interval expression of the form

  r{n}

that matches exactly n bytes.

> i think gawk may add some buffer control stuff, such as "getline var
> NUMBER" means read exactly NUMBER bytes from input, "getline var NUMBER1
> NUMBER2" means read NUMBER1 bytes with timeout NUMBER2 seconds.

Several users have suggested modifications like this because
the blocking and the timeout of a connection cannot be handled
in the way that getline is implemented.

There is another possibility that allows the user to
extend gawk with the necessary functions:

  
http://www.gnu.org/software/gawk/manual/html_node/Dynamic-Extensions.html#Dynamic-Extensions

This sections contains an example of a library that can be
loaded at run-time. You can implement any function that you
need in this library (a dll).




reply via email to

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