Software / code / prosody
Comparison
net/http/parser.lua @ 6386:f942cf2a9a03
net.http.parser: Support status code 101 and allow handling of the received data by someone else
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 03 Sep 2014 18:49:41 +0100 |
| parent | 5477:50cbea68586f |
| child | 6522:46cf369d3eb5 |
comparison
equal
deleted
inserted
replaced
| 6381:9ffd582c65d8 | 6386:f942cf2a9a03 |
|---|---|
| 138 chunk_size, chunk_start = nil, nil; | 138 chunk_size, chunk_start = nil, nil; |
| 139 else -- Partial chunk remaining | 139 else -- Partial chunk remaining |
| 140 break; | 140 break; |
| 141 end | 141 end |
| 142 elseif len and #buf >= len then | 142 elseif len and #buf >= len then |
| 143 packet.body, buf = buf:sub(1, len), buf:sub(len + 1); | 143 if packet.code == 101 then |
| 144 packet.body, buf = buf, "" | |
| 145 else | |
| 146 packet.body, buf = buf:sub(1, len), buf:sub(len + 1); | |
| 147 end | |
| 144 state = nil; success_cb(packet); | 148 state = nil; success_cb(packet); |
| 145 else | 149 else |
| 146 break; | 150 break; |
| 147 end | 151 end |
| 148 elseif #buf >= len then | 152 elseif #buf >= len then |