Skip to content

Commit

Permalink
Bug fix - parsing of all HTTP requests fails after a malformed request
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Mar 12, 2018
1 parent d07db00 commit 497432a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/httpd.b6b
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
}}

{$proc on_request {
{$local fd [$1 fd]}
{$local chunk [$1 read $.]}
{$if [$str.len $chunk] {
{$local fd [$1 fd]}
{$local data [$dict.get $http.reqs $fd {}]}

{$if [$> [$+ [$str.len $data] [$str.len $chunk]] $http.req_max] {
Expand All @@ -98,6 +98,7 @@
{$dict.set $http.reqs $fd $data}
}}
} {
{$forget_client $fd}
{$throw}
}}
} [$+ $http.req_max 1]}
Expand Down

0 comments on commit 497432a

Please sign in to comment.