Experimental IRC log happs-2007-09-26

Available formats: content-negotiated html turtle (see SIOC for the vocabulary)

Back to channel and daily index: content-negotiated html turtle

These logs are provided as an experiment in indexing discussions using IRCHub.py, Irc2RDF.hs, and SIOC.

03:19:57<stepcut>am I missing some obvious way of using things like lookupInput, lookBS, etc. I can't figure out anything useful to do with something of type, Data a
03:20:10<stepcut>without having to use runReaderT
03:25:23<Saizan>it seems, from SimpleHTTP, that you've to use it: runReaderT fromData (rqInputs rq,rqCookies rq)
03:28:36<stepcut>hrm
03:28:56<stepcut>I really just want to support uploading a file :)
03:29:34<Saizan>lookInput should work
03:30:44<stepcut>yeah, I am just baffled as to how to use it
03:30:58<Saizan>do rq <- ask; runReaderT (lookInput "field") (rqInputs rq,rqCookies rq)
03:33:06<stepcut>right, but where does that go in this line: dir "upload" [ method POST $ ok "whee" ]
03:34:07<Saizan>where you've ok "whee"
03:35:47<Saizan>dir "upload" [ method POST $ do rq <- ask; maybeInput <- runReaderT (lookInput "field") (rqInputs rq,rqCookies rq); doSomething maybeInput; ok "whee" ]
03:38:40<stepcut>i don't think that works, because ask has the type, ask :: (MonadReader r m) => m r, but ok has the type, ok :: (ToMessage a) => a -> IO Result
03:39:54<stepcut>and, in that context m = Maybe not IO
03:41:13<Saizan>uhm, you're right, you need to ask before calling method
03:41:23<Saizan>err "outside of"
03:42:16<Saizan>dir "upload" [ ask >>= \rq -> method POST $ do let maybeInput = runReaderT (lookInput "field") (rqInputs rq,rqCookies rq); doSomething maybeInput; ok "whee" ]
03:43:30<Saizan>hich is quite odd, i don't know if it's the preferred style
03:43:36<stepcut>no, because method has the type, method :: (HAppS.Server.SimpleHTTP.MatchMethod m) => m -> IO Result -> ServerPart
03:43:59<stepcut>hrm, hold on
03:44:01<Saizan>stepcut: so?
03:45:01<stepcut>If forgot to put the 'method POST $' part in my code, so it failed to type check :)
03:45:14<Saizan>ah ok :)
03:45:22<Saizan>well, night
03:46:07<stepcut>thanks!
03:46:22<stepcut>too many types to keep straight on day one
03:48:15<stepcut>yeah, I felt the same way, it seemed like that type of approached would work, but it was too weird to be 'The Right Way'
03:53:46<stepcut>Unfortunately, I think the uploaded file will initially stored entirely in RAM :-/ Fortunately the files I will be uploading are small. But I wonder if you could DoS a HAppS server by POSTing /dev/random or something
03:54:31<stepcut>even if the server isn't expecting a POST, it might (try) to read it all into RAM before realizing that
07:33:10<tuukkah>stepcut, there at least used to be a size limit on requests
07:35:57<tuukkah>bodyLimit. but now it's there only for udp...
08:59:47<tuukkah>perhaps it's lazy now?
09:01:30<tuukkah>since the request comes from L.hGetContents
09:02:44<tuukkah>otoh there's withTimeOut (30 * second)
21:29:07<nbarterd> troubles compiling happs0.92 (with sp) -- http://hpaster.org/2955
21:29:19<nbarterd>s/hpaster/hpaste/
21:30:50<nbarterd>oh wait... maybe that's because I didn't update this sort of branched off HAppS-Begin...
21:51:36<nbarterd>on second thought, I think it is a real happs problem after all: http://hpaste.org/2956
21:51:54<nbarterd>darcs updated HAppS-Begin seems unable to build.

Back to channel and daily index: content-negotiated html turtle