Mercurial > prosody-hg
comparison util/httpstream.lua @ 3568:51d5578965a5
util.httpstream: Fixed a possible string to number comparison error.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sat, 06 Nov 2010 03:41:05 +0500 |
| parents | 94828fb2dab8 |
| children | 6ef68af9431c |
comparison
equal
deleted
inserted
replaced
| 3567:94828fb2dab8 | 3568:51d5578965a5 |
|---|---|
| 65 elseif parser_type == "client" then | 65 elseif parser_type == "client" then |
| 66 while true do | 66 while true do |
| 67 -- read status line | 67 -- read status line |
| 68 local status_line = readline(); | 68 local status_line = readline(); |
| 69 local httpversion, status_code, reason_phrase = status_line:match("^HTTP/(%S+)%s+(%d%d%d)%s+(.*)$"); | 69 local httpversion, status_code, reason_phrase = status_line:match("^HTTP/(%S+)%s+(%d%d%d)%s+(.*)$"); |
| 70 if not httpversion then coroutine.yield("invalid-status-line"); end | 70 status_code = tonumber(status_code); |
| 71 if not status_code then coroutine.yield("invalid-status-line"); end | |
| 71 local headers = readheaders(); | 72 local headers = readheaders(); |
| 72 | 73 |
| 73 -- read body | 74 -- read body |
| 74 local have_body = not | 75 local have_body = not |
| 75 ( (options_cb and options_cb().method == "HEAD") | 76 ( (options_cb and options_cb().method == "HEAD") |
