- }
-
- // See if we have \r\n\r\n anywhere in the request. We start three bytes
- // before what we just appended, in case we just got the final character.
- size_t existing_req_bytes = client->request.size();
- client->request.append(string(buf, buf + ret));
-
- size_t start_at = (existing_req_bytes >= 3 ? existing_req_bytes - 3 : 0);
- const char *ptr = reinterpret_cast<char *>(
- memmem(client->request.data() + start_at, client->request.size() - start_at,
- "\r\n\r\n", 4));
- if (ptr == NULL) {