Skip to content

Commit

Permalink
Reuse storage for header_start
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed May 25, 2024
1 parent 488445e commit ae46e88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/lwan-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ __attribute__((noreturn)) static int process_request_coro(struct coro *coro,
/* NOTE: This function should not return; coro_yield should be used
* instead. This ensures the storage for `strbuf` is alive when the
* coroutine ends and lwan_strbuf_free() is called. */
char *header_start[N_HEADER_START];
struct lwan_connection *conn = data;
struct lwan *lwan = conn->thread->lwan;
int fd = lwan_connection_get_fd(lwan, conn);
Expand Down Expand Up @@ -511,6 +512,7 @@ __attribute__((noreturn)) static int process_request_coro(struct coro *coro,
.buffer = &buffer,
.next_request = next_request,
.error_when_n_packets = error_when_n_packets,
.header_start = header_start,
};
struct lwan_request request = {.conn = conn,
.global_response_headers = &lwan->headers,
Expand Down

0 comments on commit ae46e88

Please sign in to comment.