Skip to content

Commit

Permalink
[+] fix request line calculate
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanmei-Liu committed Nov 4, 2023
1 parent a1ca14a commit 9770ac2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions demo/xqc_hq_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ xqc_hq_parse_req(xqc_hq_request_t *hqr, char *res, size_t sz, uint8_t *fin)
return -XQC_EPROTO;
}

if (ret + 2 <= hqr->recv_buf_len
&& (*(hqr->req_recv_buf + ret) == '\r')
&& (*(hqr->req_recv_buf + ret + 1) == '\n'))
int request_line_len = strlen(method) + strlen(res) + 1; /* method + ' ' + path */
if (request_line_len + 2 <= hqr->recv_buf_len
&& (*(hqr->req_recv_buf + request_line_len) == '\r')
&& (*(hqr->req_recv_buf + request_line_len + 1) == '\n'))
{
/* check CR LF for hq request line */
*fin = 1;
Expand Down

0 comments on commit 9770ac2

Please sign in to comment.