File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -87,9 +87,6 @@ struct aws_h1_stream {
8787 /* Whether a "request handler" stream has a response to send.
8888 * Has mirror variable in synced_data */
8989 bool has_outgoing_response : 1 ;
90-
91- /* Total bytes written so far for Content-Length validation */
92- uint64_t incremental_content_written ;
9390 } thread_data ;
9491
9592 /* Any thread may touch this data, but the connection's lock must be held.
Original file line number Diff line number Diff line change @@ -926,11 +926,12 @@ AWS_HTTP_API int aws_http1_stream_write_chunk(
926926
927927/**
928928 * Write data to an HTTP stream in a protocol-agnostic way.
929- * Works with both HTTP/1.1 (with Content-Length) and HTTP/2.
929+ * Works with both HTTP/1.1 and HTTP/2.
930930 *
931931 * The stream must have specified `use_manual_data_writes` during request creation.
932932 * Note: `http2_use_manual_data_writes` also works for HTTP/2 but should be deprecated in favor of this unified flag.
933- * For HTTP/1.1: The request must have a Content-Length header and must NOT have a body stream set.
933+ * For HTTP/1.1: The request must have either a Content-Length header or Transfer-Encoding: chunked header,
934+ * and must NOT have a body stream set.
934935 *
935936 * For client streams, activate() must be called before any data is written.
936937 * For server streams, the response must be submitted before any data is written.
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ static int s_stream_write_data(
438438 }
439439
440440 if (is_chunked ) {
441- /* Convert write_data into chunk(s) for chunked encoding */
441+ /* Convert write_data into a chunk for chunked encoding */
442442 int64_t data_len = 0 ;
443443 if (aws_input_stream_get_length (options -> data , & data_len )) {
444444 AWS_LOGF_ERROR (
@@ -454,21 +454,7 @@ static int s_stream_write_data(
454454 .on_complete = options -> on_complete ,
455455 .user_data = options -> user_data ,
456456 };
457- if (aws_http1_stream_write_chunk (stream_base , & chunk_opts )) {
458- return AWS_OP_ERR ;
459- }
460-
461- /* If end_stream, also submit terminating zero-length chunk */
462- if (options -> end_stream ) {
463- struct aws_http1_chunk_options terminator = {
464- .chunk_data_size = 0 ,
465- };
466- if (aws_http1_stream_write_chunk (stream_base , & terminator )) {
467- return AWS_OP_ERR ;
468- }
469- }
470-
471- return AWS_OP_SUCCESS ;
457+ return aws_http1_stream_write_chunk (stream_base , & chunk_opts );
472458 }
473459
474460 /* Content-Length path: create data write and push to pending list */
Original file line number Diff line number Diff line change @@ -159,12 +159,10 @@ add_test_case(h1_client_connection_close_before_request_finishes_with_buffer_for
159159add_test_case (h1_client_connection_close_before_request_finishes_with_buffer_stream_cancel )
160160add_test_case (h1_client_write_data_single_chunk )
161161add_test_case (h1_client_write_data_multiple_chunks )
162- add_test_case (h1_client_write_data_not_enabled_with_body )
163- add_test_case (h1_client_write_data_not_enabled_no_body )
162+ add_test_case (h1_client_write_data_not_enabled )
164163add_test_case (h1_client_write_data_after_final )
165164add_test_case (h1_client_write_data_exceeds_content_length )
166165add_test_case (h1_client_write_data_less_than_content_length )
167- add_test_case (h1_client_unified_write_data_api )
168166add_test_case (h1_client_write_data_chunked_single )
169167add_test_case (h1_client_write_data_chunked_multiple )
170168
@@ -525,7 +523,6 @@ add_test_case(h2_client_batch_auto_window_update)
525523add_test_case (h2_client_batch_manual_window_update )
526524add_test_case (h2_client_cap_manual_window_update )
527525add_test_case (h2_client_unified_write_data_api )
528- add_test_case (h2_client_backward_compat_write_data )
529526
530527add_test_case (server_new_destroy )
531528add_test_case (server_new_destroy_tcp )
You can’t perform that action at this time.
0 commit comments