diff options
| author | Drahflow <drahflow@gmx.de> | 2014-03-02 00:24:20 +0100 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2014-03-02 00:24:20 +0100 |
| commit | e9f4e9e2992870920dafe0abc7418d8ea7f42a29 (patch) | |
| tree | c6915481fba8e84b386d5718ae8ea7e11d5218ac /elymas/lib/net/alg/http.ey | |
| parent | b2150cc0d050522acae179a891c69bab01581061 (diff) | |
Now using the error library
Diffstat (limited to 'elymas/lib/net/alg/http.ey')
| -rw-r--r-- | elymas/lib/net/alg/http.ey | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/elymas/lib/net/alg/http.ey b/elymas/lib/net/alg/http.ey index 1238bcf..fcb3993 100644 --- a/elymas/lib/net/alg/http.ey +++ b/elymas/lib/net/alg/http.ey @@ -35,12 +35,19 @@ } =*fail > ::request } - { 1 } { "" =inBuffer :close } # TODO: error reporting + { 1 } { + "HTTP/1.0 400 Error\r\nContent-Type: text/html\r\n\r\n<html><body>Could not parse request</body></html>\r\n" + :write :finish + } ] conds } loop inBuffer } =*in > } ^accept - { ^run } /run deffst + { + { ^run } { + _ .?close { .close } { ??!' } ? * + } ?!io.net + } /run deffst > } /rawHttpServer net .alg .deff { < @@ -68,10 +75,7 @@ } each } rep - url args - < req keys { _ { : }_ -01 deffst }' each # TODO: this forwarding logic seems ugly, find a better way to forward activity levels - ==args { }_ =url - > ::request + url args < ==args ==url req >' ::request } ^request { ^run } /run deffst |
