+ int size_needed = client->request_len + size;
+
+ if (size_needed > client->request_size) {
+ if (client->request_size == 0) {
+ client->request_size = size_needed;
+ } else {
+ while (size_needed > client->request_size)
+ client->request_size *= 2;
+ }
+
+ client->request = xrealloc (client->request, client->request_size);
+ }
+
+ memcpy (client->request + client->request_len,
+ buf, size);
+
+ client->request_len += size;
+}
+
+static ttt_status_t
+ttt_client_read_into_request_until (ttt_client_t *client, char delimeter)
+{
+ ttt_bool_t found_delimeter = FALSE;
+ int bytes_read;
+ char *s;
+
+ client->request_len = 0;