mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-05 09:25:49 +08:00
Event loops: the callbacks' pipes emptied before sockmap() takes over
On a reload the relay of the callbacks gives the connection back to sockmap(), which knows nothing of what its pipes hold, nor of how much of a body of known length has already gone through: what was in a pipe would have come out of order, and the whole length of a body been read again, into what follows it. The pipes are emptied first, the relay going on meanwhile, and the length left of a body is the one sockmap() is given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f486242638
commit
e0a6932704
@ -604,8 +604,14 @@ static int cbmaprun(struct cbmap *m){
|
|||||||
int round, moved = 0;
|
int round, moved = 0;
|
||||||
|
|
||||||
/* a reload: sockmap() takes the connection back, which has it go by
|
/* a reload: sockmap() takes the connection back, which has it go by
|
||||||
the newest configuration's rules, or ends it */
|
the newest configuration's rules, or ends it. It knows nothing of
|
||||||
if(param->version < runconf->version) return cbmapend(m, -2);
|
what the pipes hold: they are emptied first. What is left of a body
|
||||||
|
is what it is to move. */
|
||||||
|
if(param->version < runconf->version && !m->way[0].inpipe && !m->way[1].inpipe){
|
||||||
|
if(param->waitclient64) param->waitclient64 = m->way[0].left;
|
||||||
|
if(param->waitserver64) param->waitserver64 = m->way[1].left;
|
||||||
|
return cbmapend(m, -2);
|
||||||
|
}
|
||||||
for(round = 0; round < CBROUNDS; round++){
|
for(round = 0; round < CBROUNDS; round++){
|
||||||
int progress = cbway(m, &m->way[0]) | cbway(m, &m->way[1]);
|
int progress = cbway(m, &m->way[0]) | cbway(m, &m->way[1]);
|
||||||
int end = !m->halfclose && (m->term_r[0] || m->term_r[1]);
|
int end = !m->halfclose && (m->term_r[0] || m->term_r[1]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user