pong-bot bugfixes

This commit is contained in:
Jeena Paradies 2011-04-12 18:29:47 +02:00
parent 9c8d04114c
commit 5bcd7260d3
4 changed files with 33 additions and 7 deletions

View file

@ -65,6 +65,7 @@ expect_headers({char, $\n}, {Pid,_}, {Strings, Remains}) ->
[LastMessage|_] = Strings,
case LastMessage of
"" -> % We have a data section.. Last line should thus be the content length.
% FIXME: the Content-Length doesn't have to be the last Header line
[LastMessage, SecondLast | Rest] = Strings,
case re:split(SecondLast, ": ", [{return, list}]) of
["Content-Length", X] ->