I had a similar experience - an error (I forget the
details) when trying to process stdin via a CGI call
from a form where the client was uploading a file.
Since there are other buffer issues in j !# shells
(e.g. the one limiting the number of arguments, which
Eric has promised to provide relief for in 6.01 - a
reason I'm disappointed not to be able to test it
in Linux until I upgrade my Redhat 8.0 system...)
I decided that I would just do a workaround for my
particular problem. The HTML that the client uses
contains the following input line:
<input type=file size=30 name=file_name>
and the form that contains that invokes a script
#!/bin/bash
tf=/tmp/fdat$$
cat > $tf
./pfdat $tf "$REMOTE_ADDR" "$HTTP_USER_AGENT" "$$"
that, as you can see, invokes a j #! script named pfdat
In turn, that script reads the /tmp file and processes
it (with an arbitrary 20 megabyte limit on file size).
This seems to work pretty well.
I can provide further details if interested. If there
is insight into why there is a buffer overflow in stdin,
I would be very interested in knowing more about it.
- joey
At 6:48 -0700 2006/02/21, Lorin Lund wrote:
John Randall wrote:
Lorin:
Are you reading from an actual file or a socket? I have had no trouble
using stdin to read from a file or pipe, even for large files. For
sockets, I had the symptoms you described until I wrote code to keep
rechecking until the socket is fully read. If this is the issue, I can
post what I use.
Best wishes,
John
I am reading from a pipe from httpd. It isn't a matter of not
getting all the data. It is a matter of getting an error.
If I put a "try. catch." bracket around the read I can go on
without the data. But without that it dies there. But because the
server I'm using has hit logs but no error logs (as far as I have
found so far) I don't know if J is giving an error message or what
it might be.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm