Skip to main content
16 events
when toggle format what by license comment
May 15, 2014 at 5:47 history edited 200_success CC BY-SA 3.0
edited tags; edited title
Sep 21, 2012 at 14:08 vote accept daknøk
Sep 20, 2012 at 1:27 answer added Dan Burton timeline score: 7
Sep 19, 2012 at 20:54 answer added solrize timeline score: 1
Sep 19, 2012 at 16:09 comment added daknøk @nponeccop but I do need to have the length of the HTTP request, otherwise I won’t be able to know the request has already ended. The length of the request body is in the Content-Length header.
Sep 19, 2012 at 16:01 vote accept daknøk
Sep 21, 2012 at 14:08
Sep 19, 2012 at 16:00 answer added Frerich Raabe timeline score: 10
Sep 19, 2012 at 12:38 comment added nponeccop hGetContent doesn't require length to be known in advance.
Sep 19, 2012 at 11:40 vote accept daknøk
Sep 19, 2012 at 16:01
Sep 19, 2012 at 11:40 comment added daknøk @nponeccop hGetContent won’t work, since the length of the data isn’t known before the headers are parsed. hGetLine won’t work if the headers contain a newline.
Sep 19, 2012 at 10:54 comment added nponeccop Can't you just use hGetLine? There are many alternatives to your code. For example, you can just use hGetContent and parse the resulting list.
Sep 19, 2012 at 10:17 comment added daknøk @nponeccop performance isn’t really an issue. The point is making the code more concise.
Sep 19, 2012 at 9:35 answer added nponeccop timeline score: 15
Sep 19, 2012 at 9:20 comment added nponeccop The answer depends on your goal. If you want high performance or an elegant HTTP parser, you should choose different algorithm and libraries. If you just want to see how your current code can be cleaned up with only structural changes without changing the algoritm, it's a different story. Please specify.
Sep 19, 2012 at 9:01 history tweeted twitter.com/#!/StackCodeReview/status/248346121309675520
Sep 19, 2012 at 8:16 history asked daknøk CC BY-SA 3.0