# HG changeset patch # User Olaf Wintermann # Date 1770908529 -3600 # Node ID 0a7d1e9ca6b83035709229dc1f9d0d2060dd57e2 # Parent 1f0f014c0121d2a3d76b2adef6e98087787cecc1 implement HttpClient function create_req_buffer diff -r 1f0f014c0121 -r 0a7d1e9ca6b8 src/server/proxy/httpclient.c --- a/src/server/proxy/httpclient.c Thu Feb 12 11:20:43 2026 +0100 +++ b/src/server/proxy/httpclient.c Thu Feb 12 16:02:09 2026 +0100 @@ -122,7 +122,27 @@ return 1; } + if(client->method) { + cxBufferPutString(&buf, "GET "); + } else { + cxBufferPutString(&buf, client->method); + } + cxBufferPutString(&buf, client->uri ? client->uri : "/"); + cxBufferPutString(&buf, " HTTP/1.1\r\n"); + HeaderArray *hdr = client->request_headers; + while(hdr) { + for(int i=0;ilen;i++) { + cxBufferPutString(&buf, hdr->headers[i].name); + cxBufferPutString(&buf, ": "); + cxBufferPutString(&buf, hdr->headers[i].value); + cxBufferPutString(&buf, "\r\n"); + } + hdr = hdr->next; + } + cxBufferPutString(&buf, "\r\n"); + client->req_buffer = buf.space; + client->req_buffer_len = buf.size; return 0; } diff -r 1f0f014c0121 -r 0a7d1e9ca6b8 src/server/proxy/httpclient.h --- a/src/server/proxy/httpclient.h Thu Feb 12 11:20:43 2026 +0100 +++ b/src/server/proxy/httpclient.h Thu Feb 12 16:02:09 2026 +0100 @@ -44,6 +44,7 @@ struct HttpClient { EventHandler *ev; CxMempool *mp; + char *method; char *uri; struct sockaddr *addr;