| 68 | } |
| 69 | |
| 70 | int BasicHttpHeaders::onValue(const char* at, size_t length) |
| 71 | { |
| 72 | if(count_ >= ARRAY_SIZE(headers)) { |
| 73 | return -1; |
| 74 | } |
| 75 | if(length == 0) { |
| 76 | headers[count_].value = nullptr; |
| 77 | } else { |
| 78 | const_cast<char*>(at)[length] = '\0'; |
| 79 | headers[count_].value = at; |
| 80 | } |
| 81 | ++count_; |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | const char* BasicHttpHeaders::operator[](const char* name) const |
| 86 | { |