@@ -254,7 +254,9 @@ int proxy_tester_create_testing_channel_connection(struct proxy_tester *tester)
254254 tester -> testing_channel -> channel_shutdown = s_testing_channel_shutdown_callback ;
255255 tester -> testing_channel -> channel_shutdown_user_data = tester ;
256256
257- struct aws_http_connection * connection = aws_http_connection_new_http1_1_client (tester -> alloc , SIZE_MAX );
257+ /* Use small window so that we can observe it opening in tests.
258+ * Channel may wait until the window is small before issuing the increment command. */
259+ struct aws_http_connection * connection = aws_http_connection_new_http1_1_client (tester -> alloc , 256 );
258260 ASSERT_NOT_NULL (connection );
259261
260262 connection -> user_data = tester -> http_bootstrap -> user_data ;
@@ -266,9 +268,9 @@ int proxy_tester_create_testing_channel_connection(struct proxy_tester *tester)
266268 ASSERT_SUCCESS (aws_channel_slot_insert_end (tester -> testing_channel -> channel , slot ));
267269 ASSERT_SUCCESS (aws_channel_slot_set_handler (slot , & connection -> channel_handler ));
268270 connection -> vtable -> on_channel_handler_installed (& connection -> channel_handler , slot );
271+ testing_channel_drain_queued_tasks (tester -> testing_channel );
269272
270273 tester -> client_connection = connection ;
271- testing_channel_drain_queued_tasks (tester -> testing_channel );
272274
273275 return AWS_OP_SUCCESS ;
274276}
@@ -309,7 +311,9 @@ int proxy_tester_send_connect_response(struct proxy_tester *tester) {
309311 if (tester -> failure_type == PTFT_CONNECT_REQUEST ) {
310312 response_string = "HTTP/1.0 401 Unauthorized\r\n\r\n" ;
311313 } else {
312- response_string = "HTTP/1.0 200 Connection established\r\n\r\n" ;
314+ /* adding close here because it's an edge case we need to exercise. The desired behavior is that it has
315+ * absolutely no effect. */
316+ response_string = "HTTP/1.0 200 Connection established\r\nconnection: close\r\n\r\n" ;
313317 }
314318
315319 /* send response */
0 commit comments