Commit 2685e340 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Rename NGHTTP2_DATA_PAYLOAD_LENGTH as NGHTTP2_DATA_PAYLOADLEN

parent 9c4c99bf
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
(NGHTTP2_FRAME_HDLEN + 2 + NGHTTP2_MAX_PAYLOADLEN) (NGHTTP2_FRAME_HDLEN + 2 + NGHTTP2_MAX_PAYLOADLEN)
/* The maximum length of DATA frame payload. */ /* The maximum length of DATA frame payload. */
#define NGHTTP2_DATA_PAYLOAD_LENGTH 4096 #define NGHTTP2_DATA_PAYLOADLEN 4096
/* The number of bytes for each SETTINGS entry */ /* The number of bytes for each SETTINGS entry */
#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 5 #define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 5
......
...@@ -1331,7 +1331,7 @@ static int nghttp2_session_predicate_settings_send(nghttp2_session *session, ...@@ -1331,7 +1331,7 @@ static int nghttp2_session_predicate_settings_send(nghttp2_session *session,
static size_t nghttp2_session_next_data_read(nghttp2_session *session, static size_t nghttp2_session_next_data_read(nghttp2_session *session,
nghttp2_stream *stream) nghttp2_stream *stream)
{ {
int32_t window_size = NGHTTP2_DATA_PAYLOAD_LENGTH; int32_t window_size = NGHTTP2_DATA_PAYLOADLEN;
DEBUGF(fprintf(stderr, DEBUGF(fprintf(stderr,
"send: remote windowsize connection=%d, " "send: remote windowsize connection=%d, "
......
...@@ -2645,7 +2645,7 @@ void test_nghttp2_submit_data(void) ...@@ -2645,7 +2645,7 @@ void test_nghttp2_submit_data(void)
callbacks.send_callback = block_count_send_callback; callbacks.send_callback = block_count_send_callback;
data_prd.read_callback = fixed_length_data_source_read_callback; data_prd.read_callback = fixed_length_data_source_read_callback;
ud.data_source_length = NGHTTP2_DATA_PAYLOAD_LENGTH * 2; ud.data_source_length = NGHTTP2_DATA_PAYLOADLEN * 2;
CU_ASSERT(0 == nghttp2_session_client_new(&session, &callbacks, &ud)); CU_ASSERT(0 == nghttp2_session_client_new(&session, &callbacks, &ud));
aob = &session->aob; aob = &session->aob;
framebufs = &aob->framebufs; framebufs = &aob->framebufs;
...@@ -3884,7 +3884,7 @@ void test_nghttp2_session_stop_data_with_rst_stream(void) ...@@ -3884,7 +3884,7 @@ void test_nghttp2_session_stop_data_with_rst_stream(void)
data_prd.read_callback = fixed_length_data_source_read_callback; data_prd.read_callback = fixed_length_data_source_read_callback;
ud.frame_send_cb_called = 0; ud.frame_send_cb_called = 0;
ud.data_source_length = NGHTTP2_DATA_PAYLOAD_LENGTH * 4; ud.data_source_length = NGHTTP2_DATA_PAYLOADLEN * 4;
nghttp2_session_server_new(&session, &callbacks, &ud); nghttp2_session_server_new(&session, &callbacks, &ud);
nghttp2_session_open_stream(session, 1, NGHTTP2_STREAM_FLAG_NONE, nghttp2_session_open_stream(session, 1, NGHTTP2_STREAM_FLAG_NONE,
...@@ -3897,7 +3897,7 @@ void test_nghttp2_session_stop_data_with_rst_stream(void) ...@@ -3897,7 +3897,7 @@ void test_nghttp2_session_stop_data_with_rst_stream(void)
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
CU_ASSERT(NGHTTP2_DATA == ud.sent_frame_type); CU_ASSERT(NGHTTP2_DATA == ud.sent_frame_type);
/* data for DATA[1] is read from data_prd but it is not sent */ /* data for DATA[1] is read from data_prd but it is not sent */
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH * 2); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN * 2);
nghttp2_frame_rst_stream_init(&frame.rst_stream, 1, NGHTTP2_CANCEL); nghttp2_frame_rst_stream_init(&frame.rst_stream, 1, NGHTTP2_CANCEL);
CU_ASSERT(0 == nghttp2_session_on_rst_stream_received(session, &frame)); CU_ASSERT(0 == nghttp2_session_on_rst_stream_received(session, &frame));
...@@ -3909,7 +3909,7 @@ void test_nghttp2_session_stop_data_with_rst_stream(void) ...@@ -3909,7 +3909,7 @@ void test_nghttp2_session_stop_data_with_rst_stream(void)
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
/* With RST_STREAM, stream is canceled and further DATA on that /* With RST_STREAM, stream is canceled and further DATA on that
stream are not sent. */ stream are not sent. */
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH * 2); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN * 2);
CU_ASSERT(NULL == nghttp2_session_get_stream(session, 1)); CU_ASSERT(NULL == nghttp2_session_get_stream(session, 1));
...@@ -3930,7 +3930,7 @@ void test_nghttp2_session_defer_data(void) ...@@ -3930,7 +3930,7 @@ void test_nghttp2_session_defer_data(void)
data_prd.read_callback = defer_data_source_read_callback; data_prd.read_callback = defer_data_source_read_callback;
ud.frame_send_cb_called = 0; ud.frame_send_cb_called = 0;
ud.data_source_length = NGHTTP2_DATA_PAYLOAD_LENGTH * 4; ud.data_source_length = NGHTTP2_DATA_PAYLOADLEN * 4;
nghttp2_session_server_new(&session, &callbacks, &ud); nghttp2_session_server_new(&session, &callbacks, &ud);
nghttp2_session_open_stream(session, 1, NGHTTP2_STREAM_FLAG_NONE, nghttp2_session_open_stream(session, 1, NGHTTP2_STREAM_FLAG_NONE,
...@@ -3943,7 +3943,7 @@ void test_nghttp2_session_defer_data(void) ...@@ -3943,7 +3943,7 @@ void test_nghttp2_session_defer_data(void)
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
CU_ASSERT(NGHTTP2_HEADERS == ud.sent_frame_type); CU_ASSERT(NGHTTP2_HEADERS == ud.sent_frame_type);
/* No data is read */ /* No data is read */
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH * 4); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN * 4);
ud.block_count = 1; ud.block_count = 1;
nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL); nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL);
...@@ -3959,7 +3959,7 @@ void test_nghttp2_session_defer_data(void) ...@@ -3959,7 +3959,7 @@ void test_nghttp2_session_defer_data(void)
ud.block_count = 1; ud.block_count = 1;
/* Reads 2 DATA chunks */ /* Reads 2 DATA chunks */
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH * 2); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN * 2);
/* Deferred again */ /* Deferred again */
OB_DATA(item)->data_prd.read_callback = defer_data_source_read_callback; OB_DATA(item)->data_prd.read_callback = defer_data_source_read_callback;
...@@ -3967,7 +3967,7 @@ void test_nghttp2_session_defer_data(void) ...@@ -3967,7 +3967,7 @@ void test_nghttp2_session_defer_data(void)
sent. No read_callback invocation. */ sent. No read_callback invocation. */
ud.block_count = 1; ud.block_count = 1;
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH * 2); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN * 2);
/* Resume deferred DATA */ /* Resume deferred DATA */
...@@ -4528,7 +4528,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void) ...@@ -4528,7 +4528,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void)
data_prd.read_callback = fixed_length_data_source_read_callback; data_prd.read_callback = fixed_length_data_source_read_callback;
ud.frame_send_cb_called = 0; ud.frame_send_cb_called = 0;
ud.data_source_length = NGHTTP2_DATA_PAYLOAD_LENGTH * 4; ud.data_source_length = NGHTTP2_DATA_PAYLOADLEN * 4;
nghttp2_session_client_new(&session, &callbacks, &ud); nghttp2_session_client_new(&session, &callbacks, &ud);
nghttp2_submit_request(session, NULL, NULL, 0, &data_prd, NULL); nghttp2_submit_request(session, NULL, NULL, 0, &data_prd, NULL);
...@@ -4538,7 +4538,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void) ...@@ -4538,7 +4538,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void)
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
CU_ASSERT(NGHTTP2_DATA == ud.sent_frame_type); CU_ASSERT(NGHTTP2_DATA == ud.sent_frame_type);
/* data for DATA[1] is read from data_prd but it is not sent */ /* data for DATA[1] is read from data_prd but it is not sent */
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH * 2); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN * 2);
nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL); nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL);
ud.block_count = 2; ud.block_count = 2;
...@@ -4546,7 +4546,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void) ...@@ -4546,7 +4546,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void)
CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_send(session));
CU_ASSERT(NGHTTP2_PING == ud.sent_frame_type); CU_ASSERT(NGHTTP2_PING == ud.sent_frame_type);
/* data for DATA[2] is read from data_prd but it is not sent */ /* data for DATA[2] is read from data_prd but it is not sent */
CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOAD_LENGTH); CU_ASSERT(ud.data_source_length == NGHTTP2_DATA_PAYLOADLEN);
ud.block_count = 2; ud.block_count = 2;
/* Sends DATA[2..3] */ /* Sends DATA[2..3] */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment