Skip to content

Commit

Permalink
fix header server mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Mar 28, 2024
1 parent ee118d9 commit f424f26
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tunnels/server/header/header_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,38 @@ static void upStream(tunnel_t *self, context_t *c)
(void)(0);
break;
}
self->up->upStream(self->up, newInitContext(c->line));
}
else if (c->init)
{
CSTATE_MUT(c) = (header_server_con_state_t *)0x1;
destroyContext(c);
return;
}
else if (c->fin)
{
CSTATE_MUT(c) = NULL;
self->up->upStream(self->up, c);
return;
}

if (!ISALIVE(c))
{
DISCARD_CONTEXT(c);
self->up->upStream(self->up, newFinContext(c->line));
self->dw->downStream(self->dw, newFinContext(c->line));
destroyContext(c);
return;
}
self->up->upStream(self->up, c);
}

static inline void downStream(tunnel_t *self, context_t *c)
{

if (c->fin)
CSTATE_MUT(c) = NULL;

self->dw->downStream(self->dw, c);
}

Expand Down

0 comments on commit f424f26

Please sign in to comment.