Skip to content

Commit 8c7721a

Browse files
authored
Fix bug when new request has same memory address as old request. (#195)
As seen in real life
1 parent f3e449d commit 8c7721a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/h1_connection.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static void s_client_update_incoming_stream_ptr(struct h1_connection *connection
650650
*/
651651
static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *connection) {
652652
struct aws_h1_stream *current = connection->thread_data.outgoing_stream;
653-
struct aws_h1_stream *prev = current;
653+
bool current_changed = false;
654654
int err;
655655

656656
/* If current stream is done sending data... */
@@ -683,6 +683,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *
683683
}
684684

685685
current = NULL;
686+
current_changed = true;
686687
}
687688

688689
/* If current stream is NULL, look for more work. */
@@ -720,6 +721,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *
720721

721722
/* We found a stream to work on! */
722723
current = stream;
724+
current_changed = true;
723725
break;
724726
}
725727

@@ -733,7 +735,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *
733735
}
734736

735737
/* Update current incoming and outgoing streams. */
736-
if (prev != current) {
738+
if (current_changed) {
737739
AWS_LOGF_TRACE(
738740
AWS_LS_HTTP_CONNECTION,
739741
"id=%p: Current outgoing stream is now %p.",

0 commit comments

Comments
 (0)