From 8517a5675b589a3068d46169cb3af1c2d33f60c3 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 19 Oct 2026 16:50:42 +0300 Subject: [PATCH] proxy: no variable named small, a macro for char on Windows rpcndr.h, which windows.h brings in, defines small as char, so the buffer the rest of a request is read into, unsigned char small[256], did not compile with MSVC. Renamed, and the splice heuristic's small in mainconf.c too. Co-Authored-By: Claude Opus 5.5 --- src/mainconf.c | 6 +++--- src/proxy.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mainconf.c b/src/mainconf.c index 8e76be7..86ac383 100644 --- a/src/mainconf.c +++ b/src/mainconf.c @@ -484,12 +484,12 @@ static int srvprepare(struct srvstart *s, int argc, char **argv){ SPLICE_DOWNLOAD|SPLICE_UPLOAD|SPLICE_AUTO) & (SPLICE_DOWNLOAD|SPLICE_UPLOAD|SPLICE_AUTO); if(heur){ - int min = 0, streak = 0, small = 0; + int min = 0, streak = 0, smallsz = 0; - sscanf(heur+1, "%d,%d,%d", &min, &streak, &small); + sscanf(heur+1, "%d,%d,%d", &min, &streak, &smallsz); if(min > 0) srv->splicemin = min; if(streak > 0) srv->splicestreak = streak; - if(small > 0) srv->splicesmall = small; + if(smallsz > 0) srv->splicesmall = smallsz; } } #endif diff --git a/src/proxy.c b/src/proxy.c index daeed85..923f094 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1623,12 +1623,12 @@ CLEANRET: /* the rest of a request whose headers were not all read */ if(!hdrsdone && ((r >= 509 && r < 517) || r > 900)) { - unsigned char small[256]; + unsigned char rest[256]; int atstart = 1; - while((i = sockgetlinebuf(param, CLIENT, small, sizeof(small) - 1, '\n', param->srv->timeouts[STRING_S])) > 0){ - if(atstart && i <= 2 && small[i-1] == '\n') break; - atstart = (small[i-1] == '\n'); + while((i = sockgetlinebuf(param, CLIENT, rest, sizeof(rest) - 1, '\n', param->srv->timeouts[STRING_S])) > 0){ + if(atstart && i <= 2 && rest[i-1] == '\n') break; + atstart = (rest[i-1] == '\n'); } } if(r == 10) stidx = 2;