mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Event loops: CONNECT of the HTTP proxy and SOCKS, pop3p, imapp, smtpp
give up their fiber while relayed The children for which mapping is their last thing set their tail too: - socks, for CONNECT: its log line; the request's buffer is freed before mapping, nothing needing it after; - proxy, for CONNECT: the status page its end sends for the result where one is, now proxystatus() for both, and the log line of its request, a copy of which is the tail's. Not in a request httpsrv hands over, whose end is httpsrv's; - pop3p, imapp (with a copy of its tag), smtpp (its command freed before mapping): the log line and the error reply their ends send. A tail may wait now, sending to the client: once mapping is over the end of a client whose fiber gave up its stack runs on a fiber taken again for it, which, after a reload, has sockmap() go on with the mapping first. Only with no stack to be had is it ended there, logged with no tail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
973fc89d58
commit
90d798eaaf
6 files changed
+150
-65
No files matched your search
+15
@@ -30,6 +30,14 @@ static void printcommand(unsigned char * buf, int command, struct clientparam *p
|
||||
|
||||
}
|
||||
|
||||
/* the end of a CONNECT, as below, once mapping is over */
|
||||
static void sockstail(struct clientparam *param, void *data){
|
||||
unsigned char logline[340];
|
||||
|
||||
printcommand(logline, 1, param);
|
||||
dolog(param, logline);
|
||||
}
|
||||
|
||||
void * sockschild(struct clientparam* param) {
|
||||
int res;
|
||||
unsigned i=0;
|
||||
@@ -347,6 +355,13 @@ fflush(stderr);
|
||||
if(buf != param->tmpbuf) free(buf);
|
||||
return (void *)param->redirectfunc;
|
||||
}
|
||||
/* the request is not needed any more: its end is
|
||||
the log line, which mapping may leave to a loop */
|
||||
if(buf != param->tmpbuf){
|
||||
free(buf);
|
||||
buf = param->tmpbuf;
|
||||
}
|
||||
param->maptail = sockstail;
|
||||
param->res = mapsocket(param, param->srv->timeouts[CONNECTION_L]);
|
||||
break;
|
||||
case 2:
|
||||
|
||||
Reference in new issue
Block a user