![](https://seccdn.libravatar.org/avatar/128a7b98d536a9cf9b4d4d5a90d63475.jpg?s=120&d=mm&r=g)
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package aws-c-http for openSUSE:Factory checked in at 2024-06-06 12:34:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aws-c-http (Old) and /work/SRC/openSUSE:Factory/.aws-c-http.new.24587 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "aws-c-http" Thu Jun 6 12:34:23 2024 rev:3 rq:1178902 version:0.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/aws-c-http/aws-c-http.changes 2024-02-21 17:59:15.289461650 +0100 +++ /work/SRC/openSUSE:Factory/.aws-c-http.new.24587/aws-c-http.changes 2024-06-06 12:34:57.349584570 +0200 @@ -1,0 +2,8 @@ +Wed Jun 5 09:52:17 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com> + +- Update to version 0.8.2 + * Mark some missing Network tests as net_tests. by @waahm7 in (#465) + * Add test where connection shuts down before response completes + by @graebm in (#468) + +------------------------------------------------------------------- Old: ---- v0.8.1.tar.gz New: ---- v0.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aws-c-http.spec ++++++ --- /var/tmp/diff_new_pack.qvPAn4/_old 2024-06-06 12:34:57.933605853 +0200 +++ /var/tmp/diff_new_pack.qvPAn4/_new 2024-06-06 12:34:57.933605853 +0200 @@ -19,7 +19,7 @@ %define library_version 1.0.0 %define library_soversion 1_0_0 Name: aws-c-http -Version: 0.8.1 +Version: 0.8.2 Release: 0 Summary: C99 implementation of the HTTP/1.1 and HTTP/2 specifications License: Apache-2.0 ++++++ v0.8.1.tar.gz -> v0.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-http-0.8.1/tests/CMakeLists.txt new/aws-c-http-0.8.2/tests/CMakeLists.txt --- old/aws-c-http-0.8.1/tests/CMakeLists.txt 2024-02-13 22:07:29.000000000 +0100 +++ new/aws-c-http-0.8.2/tests/CMakeLists.txt 2024-05-30 19:54:21.000000000 +0200 @@ -121,7 +121,8 @@ add_test_case(h1_client_respects_stream_window) add_test_case(h1_client_connection_window_with_buffer) add_test_case(h1_client_connection_window_with_small_buffer) -add_test_case(h1_client_request_cancelled_by_channel_shutdown) +add_test_case(h1_client_request_cancelled_by_channel_shutdown_before_response) +add_test_case(h1_client_request_cancelled_by_channel_shutdown_mid_response) add_test_case(h1_client_multiple_requests_cancelled_by_channel_shutdown) add_test_case(h1_client_new_request_fails_if_channel_shut_down) add_test_case(h1_client_error_from_outgoing_body_callback_stops_decoder) @@ -500,13 +501,13 @@ add_test_case(server_new_destroy) add_test_case(server_new_destroy_tcp) add_test_case(connection_setup_shutdown) -add_test_case(connection_setup_shutdown_tls) +add_net_test_case(connection_setup_shutdown_tls) add_test_case(connection_setup_shutdown_proxy_setting_on_ev_not_found) add_test_case(connection_setup_shutdown_pinned_event_loop) add_test_case(connection_h2_prior_knowledge) add_test_case(connection_h2_prior_knowledge_not_work_with_tls) -add_test_case(connection_customized_alpn) -add_test_case(connection_customized_alpn_error_with_unknown_return_string) +add_net_test_case(connection_customized_alpn) +add_net_test_case(connection_customized_alpn_error_with_unknown_return_string) # These server tests occasionally fail. Resurrect if/when we get back to work on HTTP server. # add_test_case(connection_destroy_server_with_connection_existing) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-http-0.8.1/tests/test_h1_client.c new/aws-c-http-0.8.2/tests/test_h1_client.c --- old/aws-c-http-0.8.1/tests/test_h1_client.c 2024-02-13 22:07:29.000000000 +0100 +++ new/aws-c-http-0.8.2/tests/test_h1_client.c 2024-05-30 19:54:21.000000000 +0200 @@ -3273,7 +3273,8 @@ return AWS_OP_SUCCESS; } -H1_CLIENT_TEST_CASE(h1_client_request_cancelled_by_channel_shutdown) { +/* If channel shuts down before any response is received, the request should complete with an error */ +H1_CLIENT_TEST_CASE(h1_client_request_cancelled_by_channel_shutdown_before_response) { (void)ctx; struct tester tester; ASSERT_SUCCESS(s_tester_init(&tester, allocator)); @@ -3310,6 +3311,45 @@ ASSERT_SUCCESS(s_tester_clean_up(&tester)); return AWS_OP_SUCCESS; } + +/* If channel shuts down in the middle of a response, the request should complete with an error */ +H1_CLIENT_TEST_CASE(h1_client_request_cancelled_by_channel_shutdown_mid_response) { + (void)ctx; + struct tester tester; + ASSERT_SUCCESS(s_tester_init(&tester, allocator)); + + /* send request */ + struct aws_http_message *request = s_new_default_get_request(allocator); + + struct client_stream_tester stream_tester; + ASSERT_SUCCESS(s_stream_tester_init(&stream_tester, &tester, request)); + + testing_channel_drain_queued_tasks(&tester.testing_channel); + + /* Ensure the request can be destroyed after request is sent */ + aws_http_message_destroy(request); + + /* send response that is 1 byte short of being complete */ + const char *response_str = "HTTP/1.1 200 OK\r\n" + "Content-Length: 4\r\n" + "\r\n" + "123"; + ASSERT_SUCCESS(testing_channel_push_read_str(&tester.testing_channel, response_str)); + + /* shutdown channel while response is 1 byte short of being complete */ + aws_channel_shutdown(tester.testing_channel.channel, AWS_ERROR_SUCCESS); + testing_channel_drain_queued_tasks(&tester.testing_channel); + + /* the request should complete with error, having only received a partial response */ + ASSERT_TRUE(stream_tester.complete); + ASSERT_INT_EQUALS(AWS_ERROR_HTTP_CONNECTION_CLOSED, stream_tester.on_complete_error_code); + ASSERT_UINT_EQUALS(3, stream_tester.response_body.len); + + /* clean up */ + client_stream_tester_clean_up(&stream_tester); + ASSERT_SUCCESS(s_tester_clean_up(&tester)); + return AWS_OP_SUCCESS; +} H1_CLIENT_TEST_CASE(h1_client_multiple_requests_cancelled_by_channel_shutdown) { (void)ctx;