Unverified Commit 11da9c8c authored by jamesge's avatar jamesge Committed by GitHub

Merge pull request #1116 from wasphin/feature/fix-typo

fix a typo: COMPLELE -> COMPLETE
parents 4941431b f67446d7
...@@ -134,7 +134,7 @@ int HttpMessage::on_header_value(http_parser *parser, ...@@ -134,7 +134,7 @@ int HttpMessage::on_header_value(http_parser *parser,
int HttpMessage::on_headers_complete(http_parser *parser) { int HttpMessage::on_headers_complete(http_parser *parser) {
HttpMessage *http_message = (HttpMessage *)parser->data; HttpMessage *http_message = (HttpMessage *)parser->data;
http_message->_stage = HTTP_ON_HEADERS_COMPLELE; http_message->_stage = HTTP_ON_HEADERS_COMPLETE;
// Move content-type into the member field. // Move content-type into the member field.
const std::string* content_type = http_message->header().GetHeader("content-type"); const std::string* content_type = http_message->header().GetHeader("content-type");
if (content_type) { if (content_type) {
...@@ -295,12 +295,12 @@ int HttpMessage::OnMessageComplete() { ...@@ -295,12 +295,12 @@ int HttpMessage::OnMessageComplete() {
_cur_value = NULL; _cur_value = NULL;
if (!_read_body_progressively) { if (!_read_body_progressively) {
// Normal read. // Normal read.
_stage = HTTP_ON_MESSAGE_COMPLELE; _stage = HTTP_ON_MESSAGE_COMPLETE;
return 0; return 0;
} }
// Progressive read. // Progressive read.
std::unique_lock<butil::Mutex> mu(_body_mutex); std::unique_lock<butil::Mutex> mu(_body_mutex);
_stage = HTTP_ON_MESSAGE_COMPLELE; _stage = HTTP_ON_MESSAGE_COMPLETE;
if (_body_reader != NULL) { if (_body_reader != NULL) {
// Solve the case: SetBodyReader quit at ntry=MAX_TRY with non-empty // Solve the case: SetBodyReader quit at ntry=MAX_TRY with non-empty
// _body and the remaining _body is just the last part. // _body and the remaining _body is just the last part.
......
...@@ -37,9 +37,9 @@ enum HttpParserStage { ...@@ -37,9 +37,9 @@ enum HttpParserStage {
HTTP_ON_STATUS, HTTP_ON_STATUS,
HTTP_ON_HEADER_FIELD, HTTP_ON_HEADER_FIELD,
HTTP_ON_HEADER_VALUE, HTTP_ON_HEADER_VALUE,
HTTP_ON_HEADERS_COMPLELE, HTTP_ON_HEADERS_COMPLETE,
HTTP_ON_BODY, HTTP_ON_BODY,
HTTP_ON_MESSAGE_COMPLELE HTTP_ON_MESSAGE_COMPLETE
}; };
class HttpMessage { class HttpMessage {
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
// Returns bytes parsed, -1 on failure. // Returns bytes parsed, -1 on failure.
ssize_t ParseFromIOBuf(const butil::IOBuf &buf); ssize_t ParseFromIOBuf(const butil::IOBuf &buf);
bool Completed() const { return _stage == HTTP_ON_MESSAGE_COMPLELE; } bool Completed() const { return _stage == HTTP_ON_MESSAGE_COMPLETE; }
HttpParserStage stage() const { return _stage; } HttpParserStage stage() const { return _stage; }
HttpHeader &header() { return _header; } HttpHeader &header() { return _header; }
......
...@@ -1099,7 +1099,7 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket, ...@@ -1099,7 +1099,7 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket,
} }
return result; return result;
} else if (socket->is_read_progressive() && } else if (socket->is_read_progressive() &&
http_imsg->stage() >= HTTP_ON_HEADERS_COMPLELE) { http_imsg->stage() >= HTTP_ON_HEADERS_COMPLETE) {
// header part of a progressively-read http message is complete, // header part of a progressively-read http message is complete,
// go on to ProcessHttpXXX w/o waiting for full body. // go on to ProcessHttpXXX w/o waiting for full body.
http_imsg->AddOneRefForStage2(); // released when body is fully read http_imsg->AddOneRefForStage2(); // released when body is fully read
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment