From 718798c7fc642ca3f944878f8e8b8f5e14ba3788 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sat, 24 Oct 2026 19:25:38 +0300 Subject: [PATCH] FilePlugin: socksend() given no clientparam, not a TLS state for one socksend() takes the client's parameters, and was passed the socket functions' state instead: NULL, the global functions used then, as intended, but on a TLS connection the state of its TLS layer, which socksend() read as a clientparam. Co-Authored-By: Claude Opus 5.5 --- src/plugins/FilePlugin/FilePlugin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/FilePlugin/FilePlugin.c b/src/plugins/FilePlugin/FilePlugin.c index 94ca52f..efe6db6 100644 --- a/src/plugins/FilePlugin/FilePlugin.c +++ b/src/plugins/FilePlugin/FilePlugin.c @@ -286,7 +286,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){ case GOT_SMTP_REQ: case GOT_SMTP_DATA: fps->state = FLUSH_DATA; - pl->socksend(fps->fpd.cp->sostate,fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), fps->fpd.cp->srv->timeouts[STRING_S]); + pl->socksend(NULL, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), fps->fpd.cp->srv->timeouts[STRING_S]); fps->state = state; break; case GOT_HTTP_REQUEST: @@ -298,7 +298,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){ case GOT_HTTP_SRVDATA: if(!fps->serversent){ fps->state = FLUSH_DATA; - pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[0], (int)strlen((char *)fp_stringtable[0]), fps->fpd.cp->srv->timeouts[STRING_S]); + pl->socksend(NULL, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[0], (int)strlen((char *)fp_stringtable[0]), fps->fpd.cp->srv->timeouts[STRING_S]); fps->state = state; } break; @@ -306,7 +306,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){ case GOT_FTP_REQ: case GOT_FTP_SRVDATA: fps->state = FLUSH_DATA; - pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->ctrlsock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), fps->fpd.cp->srv->timeouts[STRING_S]); + pl->socksend(NULL, fps->fpd.cp->ctrlsock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), fps->fpd.cp->srv->timeouts[STRING_S]); fps->state = state; break; default: @@ -358,7 +358,7 @@ static int copyfdtosock(struct fp_stream * fps, DIRECTION which, long len){ if(fps->serversent >= fps->srvhdrwritten){ sprintf(fps->buf, "%lx\r\n", len); sendchunk = (int)strlen(fps->buf); - if(pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, (unsigned char *)fps->buf, sendchunk, fps->fpd.cp->srv->timeouts[STRING_S]) != sendchunk){ + if(pl->socksend(NULL, fps->fpd.cp->clisock, (unsigned char *)fps->buf, sendchunk, fps->fpd.cp->srv->timeouts[STRING_S]) != sendchunk){ return -4; } } @@ -397,13 +397,13 @@ static int copyfdtosock(struct fp_stream * fps, DIRECTION which, long len){ #endif return -3; } - if(pl->socksend(fps->fpd.cp->sostate, sock, (unsigned char *)fps->buf, res, fps->fpd.cp->srv->timeouts[STRING_S]) != res) { + if(pl->socksend(NULL, sock, (unsigned char *)fps->buf, res, fps->fpd.cp->srv->timeouts[STRING_S]) != res) { return -4; } len -= res; } if(sendchunk){ - if(pl->socksend(fps->fpd.cp->sostate, sock, (unsigned char *)"\r\n", 2, fps->fpd.cp->srv->timeouts[STRING_S]) != 2) + if(pl->socksend(NULL, sock, (unsigned char *)"\r\n", 2, fps->fpd.cp->srv->timeouts[STRING_S]) != 2) return -4; } fps->state = state;