Skip to content

Commit f778ff0

Browse files
authored
Merge pull request #1813 from private-octopus/fix-warnings-2024-12-18
Fix series of test warnings.
2 parents cb143e5 + 04aa8d7 commit f778ff0

File tree

3 files changed

+42
-38
lines changed

3 files changed

+42
-38
lines changed

picohttp/democlient.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,15 @@ static int picoquic_demo_client_open_stream(picoquic_cnx_t* cnx,
336336
}
337337

338338
if (!ctx->no_print) {
339+
char text[128];
339340
if (ret != 0) {
340341
fprintf(stdout, "Cannot send %s command for stream(%" PRIu64 "): %s\n",
341-
(post_size == 0) ? "GET" : "POST", stream_ctx->stream_id, path);
342+
(post_size == 0) ? "GET" : "POST", stream_ctx->stream_id,
343+
picoquic_uint8_to_str(text, sizeof(text), path, path_len));
342344
}
343345
else if (nb_repeat == 0) {
344-
fprintf(stdout, "Opening stream %d to %s %s\n", (int)stream_ctx->stream_id, (post_size == 0) ? "GET" : "POST", path);
346+
fprintf(stdout, "Opening stream %d to %s %s\n", (int)stream_ctx->stream_id, (post_size == 0) ? "GET" : "POST",
347+
picoquic_uint8_to_str(text, sizeof(text), path, path_len));
345348
}
346349
}
347350
}

picohttp/quicperf.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1245,12 +1245,12 @@ size_t quicperf_prepare_time_stamp(quicperf_stream_ctx_t* stream_ctx, uint8_t *
12451245
size_t byte_index = 0;
12461246
if (stream_ctx->frame_bytes_sent < 8) {
12471247
uint8_t time_stamp[8];
1248-
(void)picoquic_frames_uint64_encode(buffer, buffer + 8, stream_ctx->frame_start_stamp);
1249-
1250-
while (stream_ctx->frame_bytes_sent < 8 && byte_index < available) {
1251-
buffer[byte_index] = time_stamp[stream_ctx->frame_bytes_sent];
1252-
stream_ctx->frame_bytes_sent++;
1253-
byte_index++;
1248+
if (picoquic_frames_uint64_encode(buffer, buffer + 8, stream_ctx->frame_start_stamp) != NULL) {
1249+
while (stream_ctx->frame_bytes_sent < 8 && byte_index < available) {
1250+
buffer[byte_index] = time_stamp[stream_ctx->frame_bytes_sent];
1251+
stream_ctx->frame_bytes_sent++;
1252+
byte_index++;
1253+
}
12541254
}
12551255
}
12561256
return byte_index;

picoquictest/skip_frame_test.c

+31-30
Original file line numberDiff line numberDiff line change
@@ -1594,36 +1594,37 @@ int frames_format_test()
15941594
ret = -1;
15951595
}
15961596
}
1597-
1598-
stream->reset_requested = 1;
1599-
FRAME_FORMAT_TEST_ONCE(picoquic_format_stream_reset_frame, 2, cnx, stream, bytes, bytes_max, &more_data, &is_pure_ack);
1600-
stream->reset_requested = 0;
1601-
FRAME_FORMAT_TEST(picoquic_format_new_connection_id_frame, cnx, local_cnxid_list, bytes, bytes_max, &more_data, &is_pure_ack, l_cid);
1602-
FRAME_FORMAT_TEST(picoquic_format_retire_connection_id_frame, bytes, bytes_max, &more_data, &is_pure_ack, 1, 0, 17);
1603-
FRAME_FORMAT_TEST(picoquic_format_new_token_frame, bytes, bytes_max, &more_data, &is_pure_ack, data, 2);
1604-
stream->stop_sending_requested = 1;
1605-
FRAME_FORMAT_TEST_ONCE(picoquic_format_stop_sending_frame, 2, stream, bytes, bytes_max, &more_data, &is_pure_ack);
1606-
stream->stop_sending_requested = 0;
1607-
stream->stop_sending_sent = 0;
1608-
FRAME_FORMAT_TEST_ONCE(picoquic_format_data_blocked_frame, 1, cnx, bytes, bytes_max, &more_data, &is_pure_ack);
1609-
FRAME_FORMAT_TEST(picoquic_format_stream_data_blocked_frame, bytes, bytes_max, &more_data, &is_pure_ack, stream);
1610-
stream->stream_data_blocked_sent = 0;
1611-
FRAME_FORMAT_TEST_ONCE(picoquic_format_stream_blocked_frame, 1, cnx, bytes, bytes_max, &more_data, &is_pure_ack, stream);
1612-
cnx->stream_blocked_bidir_sent = 0;
1613-
FRAME_FORMAT_TEST(picoquic_format_connection_close_frame, cnx, bytes, bytes_max, &more_data, &is_pure_ack);
1614-
FRAME_FORMAT_TEST(picoquic_format_application_close_frame, cnx, bytes, bytes_max, &more_data, &is_pure_ack);
1615-
FRAME_FORMAT_TEST(picoquic_format_max_stream_data_frame, cnx, stream, bytes, bytes_max, &more_data, &is_pure_ack, 100000000);
1616-
FRAME_FORMAT_TEST(picoquic_format_path_challenge_frame, bytes, bytes_max, &more_data, &is_pure_ack, 0xaabbccddeeff0011ull);
1617-
FRAME_FORMAT_TEST(picoquic_format_path_response_frame, bytes, bytes_max, &more_data, &is_pure_ack, 0xaabbccddeeff0011ull);
1618-
FRAME_FORMAT_TEST(picoquic_format_datagram_frame, bytes, bytes_max, &more_data, &is_pure_ack, 2, data);
1619-
FRAME_FORMAT_TEST_ONCE(picoquic_format_ack_frequency_frame, 2, cnx, bytes, bytes_max, &more_data);
1620-
FRAME_FORMAT_TEST(picoquic_format_immediate_ack_frame, bytes, bytes_max, &more_data);
1621-
FRAME_FORMAT_TEST(picoquic_format_time_stamp_frame, cnx, buffer, bytes_max, &more_data, simulated_time);
1622-
FRAME_FORMAT_TEST(picoquic_format_path_abandon_frame, bytes, bytes_max, &more_data, 1, 3);
1623-
FRAME_FORMAT_TEST(picoquic_format_path_available_or_standby_frame, bytes, bytes_max, picoquic_frame_type_path_available, 1, 17, &more_data);
1624-
FRAME_FORMAT_TEST(picoquic_format_max_path_id_frame, bytes, bytes_max, 123, &more_data);
1625-
FRAME_FORMAT_TEST(picoquic_format_path_blocked_frame, bytes, bytes_max, 123, &more_data);
1626-
FRAME_FORMAT_TEST(picoquic_format_observed_address_frame, bytes, bytes_max, picoquic_frame_type_observed_address_v4, 13, addr_bytes, 4433, &more_data);
1597+
if (ret == 0) {
1598+
stream->reset_requested = 1;
1599+
FRAME_FORMAT_TEST_ONCE(picoquic_format_stream_reset_frame, 2, cnx, stream, bytes, bytes_max, &more_data, &is_pure_ack);
1600+
stream->reset_requested = 0;
1601+
FRAME_FORMAT_TEST(picoquic_format_new_connection_id_frame, cnx, local_cnxid_list, bytes, bytes_max, &more_data, &is_pure_ack, l_cid);
1602+
FRAME_FORMAT_TEST(picoquic_format_retire_connection_id_frame, bytes, bytes_max, &more_data, &is_pure_ack, 1, 0, 17);
1603+
FRAME_FORMAT_TEST(picoquic_format_new_token_frame, bytes, bytes_max, &more_data, &is_pure_ack, data, 2);
1604+
stream->stop_sending_requested = 1;
1605+
FRAME_FORMAT_TEST_ONCE(picoquic_format_stop_sending_frame, 2, stream, bytes, bytes_max, &more_data, &is_pure_ack);
1606+
stream->stop_sending_requested = 0;
1607+
stream->stop_sending_sent = 0;
1608+
FRAME_FORMAT_TEST_ONCE(picoquic_format_data_blocked_frame, 1, cnx, bytes, bytes_max, &more_data, &is_pure_ack);
1609+
FRAME_FORMAT_TEST(picoquic_format_stream_data_blocked_frame, bytes, bytes_max, &more_data, &is_pure_ack, stream);
1610+
stream->stream_data_blocked_sent = 0;
1611+
FRAME_FORMAT_TEST_ONCE(picoquic_format_stream_blocked_frame, 1, cnx, bytes, bytes_max, &more_data, &is_pure_ack, stream);
1612+
cnx->stream_blocked_bidir_sent = 0;
1613+
FRAME_FORMAT_TEST(picoquic_format_connection_close_frame, cnx, bytes, bytes_max, &more_data, &is_pure_ack);
1614+
FRAME_FORMAT_TEST(picoquic_format_application_close_frame, cnx, bytes, bytes_max, &more_data, &is_pure_ack);
1615+
FRAME_FORMAT_TEST(picoquic_format_max_stream_data_frame, cnx, stream, bytes, bytes_max, &more_data, &is_pure_ack, 100000000);
1616+
FRAME_FORMAT_TEST(picoquic_format_path_challenge_frame, bytes, bytes_max, &more_data, &is_pure_ack, 0xaabbccddeeff0011ull);
1617+
FRAME_FORMAT_TEST(picoquic_format_path_response_frame, bytes, bytes_max, &more_data, &is_pure_ack, 0xaabbccddeeff0011ull);
1618+
FRAME_FORMAT_TEST(picoquic_format_datagram_frame, bytes, bytes_max, &more_data, &is_pure_ack, 2, data);
1619+
FRAME_FORMAT_TEST_ONCE(picoquic_format_ack_frequency_frame, 2, cnx, bytes, bytes_max, &more_data);
1620+
FRAME_FORMAT_TEST(picoquic_format_immediate_ack_frame, bytes, bytes_max, &more_data);
1621+
FRAME_FORMAT_TEST(picoquic_format_time_stamp_frame, cnx, buffer, bytes_max, &more_data, simulated_time);
1622+
FRAME_FORMAT_TEST(picoquic_format_path_abandon_frame, bytes, bytes_max, &more_data, 1, 3);
1623+
FRAME_FORMAT_TEST(picoquic_format_path_available_or_standby_frame, bytes, bytes_max, picoquic_frame_type_path_available, 1, 17, &more_data);
1624+
FRAME_FORMAT_TEST(picoquic_format_max_path_id_frame, bytes, bytes_max, 123, &more_data);
1625+
FRAME_FORMAT_TEST(picoquic_format_path_blocked_frame, bytes, bytes_max, 123, &more_data);
1626+
FRAME_FORMAT_TEST(picoquic_format_observed_address_frame, bytes, bytes_max, picoquic_frame_type_observed_address_v4, 13, addr_bytes, 4433, &more_data);
1627+
}
16271628

16281629
if (qclient != NULL) {
16291630
picoquic_free(qclient);

0 commit comments

Comments
 (0)