From 1738323c8f5a6deeebf595b70f3c24052051bc8b Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Mon, 9 Mar 2020 18:22:08 -0700 Subject: [PATCH] Fix bug when new request has same memory address as old request. --- source/h1_connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/h1_connection.c b/source/h1_connection.c index b8f765cf4..045e6cd09 100644 --- a/source/h1_connection.c +++ b/source/h1_connection.c @@ -650,7 +650,7 @@ static void s_client_update_incoming_stream_ptr(struct h1_connection *connection */ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *connection) { struct aws_h1_stream *current = connection->thread_data.outgoing_stream; - struct aws_h1_stream *prev = current; + bool current_changed = false; int err; /* If current stream is done sending data... */ @@ -683,6 +683,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection * } current = NULL; + current_changed = true; } /* 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 * /* We found a stream to work on! */ current = stream; + current_changed = true; break; } @@ -733,7 +735,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct h1_connection * } /* Update current incoming and outgoing streams. */ - if (prev != current) { + if (current_changed) { AWS_LOGF_TRACE( AWS_LS_HTTP_CONNECTION, "id=%p: Current outgoing stream is now %p.",