Mercurial > prosody-hg
comparison net/http/parser.lua @ 5461:67b674f6a299
net.http.parser: Break when no more usable data in buffer (client part of e5ec60dfb202)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 11 Apr 2013 17:39:10 +0100 |
| parents | 274c10668fe8 |
| children | 3ecae471d9dd |
comparison
equal
deleted
inserted
replaced
| 5460:274c10668fe8 | 5461:67b674f6a299 |
|---|---|
| 134 end | 134 end |
| 135 error("trailers"); -- FIXME MUST read trailers | 135 error("trailers"); -- FIXME MUST read trailers |
| 136 elseif len and #buf >= len then | 136 elseif len and #buf >= len then |
| 137 packet.body, buf = buf:sub(1, len), buf:sub(len + 1); | 137 packet.body, buf = buf:sub(1, len), buf:sub(len + 1); |
| 138 state = nil; success_cb(packet); | 138 state = nil; success_cb(packet); |
| 139 else | |
| 140 break; | |
| 139 end | 141 end |
| 140 elseif #buf >= len then | 142 elseif #buf >= len then |
| 141 packet.body, buf = buf:sub(1, len), buf:sub(len + 1); | 143 packet.body, buf = buf:sub(1, len), buf:sub(len + 1); |
| 142 state = nil; success_cb(packet); | 144 state = nil; success_cb(packet); |
| 143 else | 145 else |
