+haskell-cafe, oops
--On Wed, Apr 4, 2012 at 10:09 PM, tsuraan <tsuraan@gmail.com> wrote:> It's hard to rule Snap timeouts out; try building snap-core with theHeh, that was quite a spew. I normally get the exceptions tens of MB
> "-fdebug" flag and running your app with "DEBUG=1", you'll get a spew of
> debugging output from Snap on stderr.
into files that are hundreds of MB, and I sometimes don't get them at
all, so printing out the entire request body was a bit slow :) After
commenting out some of the more talkative debug statements, I got the
exception to happen, and it looks generally like this:I think I might know what your problem is. You're accepting file uploads using handleMultipart, yes? Snap kills uploads that are going too slow, otherwise you would be vulnerable to slowloris (http://ha.ckers.org/slowloris/) DoS attacks. What's probably happening here is that you're doing slow work inside the "Iteratee IO a" handler you pass to that function, which makes Snap think the client is trickling bytes to you. If that's the case, either finish the iteratee more quickly and do the slow work back in the Snap handler (preferable), or disable the minimum upload rate guard (although that's not recommended on a server talking to the public internet.)G
Gregory Collins <greg@gregorycollins.net>