Cleanup code

This commit is contained in:
2022-12-10 21:40:41 +01:00
parent 2937bdaded
commit 2efe65fc74
6 changed files with 8 additions and 18 deletions

View File

@ -494,13 +494,12 @@ int fastcgi_send(fastcgi_conn *conn, sock *client, int flags) {
unsigned long avail_in, avail_out;
out:
avail_in = content_len;
void *next_in = ptr;
char *next_in = ptr;
do {
int buf_len = content_len;
if (flags & FASTCGI_COMPRESS) {
avail_out = sizeof(comp_out);
compress_compress(&comp_ctx, next_in + content_len - avail_in, &avail_in, comp_out, &avail_out,
finish_comp);
compress_compress(&comp_ctx, next_in + content_len - avail_in, &avail_in, comp_out, &avail_out, finish_comp);
ptr = comp_out;
buf_len = (int) (sizeof(comp_out) - avail_out);
}

View File

@ -176,7 +176,7 @@ int http_receive_request(sock *client, http_req *req) {
}
if (req->version[0] == 0) {
pos1 = memchr(ptr, ' ', rcv_len - (ptr - buf)) + 1;
pos1 = (char *) memchr(ptr, ' ', rcv_len - (ptr - buf)) + 1;
if (pos1 == NULL) goto err_hdr_fmt;
if (pos1 - ptr - 1 >= sizeof(req->method)) {
@ -192,7 +192,7 @@ int http_receive_request(sock *client, http_req *req) {
}
snprintf(req->method, sizeof(req->method), "%.*s", (int) (pos1 - ptr - 1), ptr);
pos2 = memchr(pos1, ' ', rcv_len - (pos1 - buf)) + 1;
pos2 = (char *) memchr(pos1, ' ', rcv_len - (pos1 - buf)) + 1;
if (pos2 == NULL) {
err_hdr_fmt:
error("Unable to parse http header: Invalid header format");

View File

@ -511,7 +511,7 @@ int rev_proxy_send(sock *client, unsigned long len_to_send, int flags) {
ptr = buffer;
out:
avail_in = len;
void *next_in = ptr;
char *next_in = ptr;
do {
long buf_len = len;
if (flags & REV_PROXY_COMPRESS) {