
17 Jun
2007
17 Jun
'07
5:51 p.m.
Eric wrote:
I'm writing a simple HTTP server and am trying to implement the POST method.
That's a rather general problem statement, indeed :-) For an application like this, I'd suggest that explicit resource management is the way to go, and that you should not be using hGetContents at all, under any guise. For example, any scheme involving reading an entire stream is going to do completely the wrong thing in the face of HTTP keepalive. Also, code that leaves open sockets piling up in drifts, to eventually be shoveled up by the RTS, is going to be trivially easy to DoS.