- if (client->buf_tail >= client->buf_head) {
- bytes_read = xread (client->socket,
- client->buf,
- TTT_CLIENT_BUF_SIZE);
- if (bytes_read == 0)
- return TTT_STATUS_EOF;
- client->buf_head = client->buf;
- client->buf_tail = client->buf_head + bytes_read;
- }
-
- for (s = client->buf_head; s < client->buf_tail; s++) {
- if (*s == delimeter) {
- found_delimeter = TRUE;
- s++;
- break;
- }
- }
-
- _append_to_request (client,
- client->buf_head,
- s - client->buf_head);
- client->buf_head = s;
-
- if (found_delimeter)
- return TTT_STATUS_SUCCESS;
- }