Skip to content

Commit

Permalink
Fix simple http conn
Browse files Browse the repository at this point in the history
  • Loading branch information
gaodunqiao committed Jul 2, 2017
1 parent 4333bf6 commit 6de9cab
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pink/src/simple_http_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,16 @@ bool SimpleHTTPConn::BuildRequestHeader() {
if (!request_->ParseHeadFromArray(rbuf_, header_len_)) {
return false;
}
auto iter = request_->headers.begin();
iter = request_->headers.find("content-length");
auto iter = request_->headers.find("content-length");
if (iter == request_->headers.end()) {
remain_packet_len_ = 0;
} else {
int64_t tmp = 0;
slash::string2l(iter->second.data(), iter->second.size(),
static_cast<long*>(&tmp));
remain_packet_len_ = tmp;
long tmp = 0;
if (slash::string2l(iter->second.data(), iter->second.size(), &tmp)) {
remain_packet_len_ = tmp;
} else {
remain_packet_len_ = 0;
}
}

if (rbuf_pos_ > header_len_) {
Expand Down

0 comments on commit 6de9cab

Please sign in to comment.