Skip to content

Commit

Permalink
add required checks since we checked the main line
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Jun 24, 2024
1 parent 339aa87 commit cc5c189
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tunnels/client/http2/http2_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,15 @@ static void upStream(tunnel_t *self, context_t *c)

if (con->content_type == kApplicationGrpc && con->handshake_completed)
{
lockLine(con->line);
sendGrpcFinalData(self, con->line, stream->stream_id);
if (! isAlive(con->line))
{
unLockLine(con->line);
destroyContext(c);
return;
}
unLockLine(con->line);
}

resumeLineUpSide(con->line);
Expand Down
8 changes: 6 additions & 2 deletions tunnels/server/http2/http2_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,19 +416,23 @@ static void downStream(tunnel_t *self, context_t *c)
removeStream(con, stream);
deleteHttp2Stream(stream);

lockLine(con->line);
while (trySendResponse(self, con, 0, NULL))
{
if (! isAlive(c->line))
if (! isAlive(con->line))
{
unLockLine(con->line);
destroyContext(c);
return;
}
}
if (! isAlive(c->line))
if (! isAlive(con->line))
{
unLockLine(con->line);
destroyContext(c);
return;
}
unLockLine(con->line);

if (nghttp2_session_want_read(con->session) == 0 && nghttp2_session_want_write(con->session) == 0)
{
Expand Down

0 comments on commit cc5c189

Please sign in to comment.