Forum OpenACS Q&A: Response to File upload failures

Posted by Jerry Asher on

When I've seen that error come out of AOLserver, it has been the result of a broken connection while downloading something big, a connection where presumably the user has become bored and moved on.  That would fit with your second scenario, where the form is resubmitted while the upload is in progress.  I can't imagine anyway to prevent that without using JavaScript to disable the form submit.

And that's seems to be what ns_conncptofp is complaining of too, that it was trying to copy the content from the connection to a file pointer when the resource went away.  Presumably the resource in question is the connection and not the disk.  To look into this further, you can start looking at nsd/conn.c/ConnCopy.  That routine has two error returns, one after the read, and one after the write.

The read usually does a nonblocking read from the socket, and if I recall, retrying twice after receiving an EWOULDBLOCK (and then waiting a configurable amount of time), and then finally give up. (but I'm not sure about all this.)  So if your conn goes away for more than the timeout period but is coming back, presumably you've got a pretty flaky connection to begin with.

My question, if you don't click submit again, do you still have the problem while uploading?