From 47e483675a042dac55cc5f4f2d5c3a1f2cf05114 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Thu, 26 Jan 2023 17:22:59 +0100 Subject: [PATCH] fix fastGCI size encoding bug --- fcgi.c | 1 + proto.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fcgi.c b/fcgi.c index 50ad41a..f7b401a 100644 --- a/fcgi.c +++ b/fcgi.c @@ -676,6 +676,7 @@ static int send_request(antd_client_t *cl, antd_request_t* rq) } else { + // LOG("FCGI SEND QUERY STRING: %s", tmp); ret += fcgi_send_param(cl, cl->sock, "QUERY_STRING", tmp); } diff --git a/proto.c b/proto.c index 85a7d0f..16c5f30 100644 --- a/proto.c +++ b/proto.c @@ -154,7 +154,7 @@ int fcgi_send_param(antd_client_t* cl, int id, const char* key, const char* valu if(clen > 0) { - uint8_t encoding_type = (((k_length & 0xFF) >> 7) << 0) | (((v_length & 0xFF)>>7) << 1); + uint8_t encoding_type = ((k_length>127?1:0) << 0) | ((v_length>127?1:0) << 1); switch(encoding_type) { case PARAMS_LENGTH_11: