| 429 | } |
| 430 | |
| 431 | long int HTTPMsg::content_length() const |
| 432 | { |
| 433 | unsigned long int length = 0; |
| 434 | auto it = headers.find("Content-Length"); |
| 435 | if (it == headers.end()) |
| 436 | return -1; |
| 437 | errno = 0; |
| 438 | length = std::strtoul(it->second.c_str(), (char **) NULL, 10); |
| 439 | if (errno != 0) |
| 440 | return -1; |
| 441 | return length; |
| 442 | } |
| 443 | |
| 444 | int HTTPRes::parse(const char *buf, size_t len) |
| 445 | { |
no outgoing calls