Actually used the SEND_RESPONSE phase

This commit is contained in:
Nate Choe
2022-01-30 17:57:20 -06:00
parent f3694d3b43
commit 1888bb9518
6 changed files with 51 additions and 28 deletions

View File

@@ -85,3 +85,12 @@ int sendBinaryResponse(Connection *conn, char *status,
return 1;
return sendStream(conn->stream, data, len) < len;
}
int sendHeader(Connection *conn, char *status, size_t len) {
return (sendConnection(conn,
"HTTP/1.1 %s\r\n"
CONST_FIELDS
"Content-Length: %lu\r\n"
"\r\n"
, status, len));
}