Specify 1 for 2nd parameter of fwrite as a convention
This commit is contained in:
parent
3aa0ebbbd6
commit
fdc27c9f0e
|
@ -219,9 +219,9 @@ static int on_frame_send_callback(nghttp2_session *session,
|
||||||
const nghttp2_nv *nva = frame->headers.nva;
|
const nghttp2_nv *nva = frame->headers.nva;
|
||||||
printf("[INFO] C ----------------------------> S (HEADERS)\n");
|
printf("[INFO] C ----------------------------> S (HEADERS)\n");
|
||||||
for (i = 0; i < frame->headers.nvlen; ++i) {
|
for (i = 0; i < frame->headers.nvlen; ++i) {
|
||||||
fwrite(nva[i].name, nva[i].namelen, 1, stdout);
|
fwrite(nva[i].name, 1, nva[i].namelen, stdout);
|
||||||
printf(": ");
|
printf(": ");
|
||||||
fwrite(nva[i].value, nva[i].valuelen, 1, stdout);
|
fwrite(nva[i].value, 1, nva[i].valuelen, stdout);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -249,9 +249,9 @@ static int on_frame_recv_callback(nghttp2_session *session,
|
||||||
if (req) {
|
if (req) {
|
||||||
printf("[INFO] C <---------------------------- S (HEADERS)\n");
|
printf("[INFO] C <---------------------------- S (HEADERS)\n");
|
||||||
for (i = 0; i < frame->headers.nvlen; ++i) {
|
for (i = 0; i < frame->headers.nvlen; ++i) {
|
||||||
fwrite(nva[i].name, nva[i].namelen, 1, stdout);
|
fwrite(nva[i].name, 1, nva[i].namelen, stdout);
|
||||||
printf(": ");
|
printf(": ");
|
||||||
fwrite(nva[i].value, nva[i].valuelen, 1, stdout);
|
fwrite(nva[i].value, 1, nva[i].valuelen, stdout);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,9 +109,9 @@ static void deflate(nghttp2_hd_deflater *deflater,
|
||||||
printf("Input (%zu byte(s)):\n\n", sum);
|
printf("Input (%zu byte(s)):\n\n", sum);
|
||||||
|
|
||||||
for (i = 0; i < nvlen; ++i) {
|
for (i = 0; i < nvlen; ++i) {
|
||||||
fwrite(nva[i].name, nva[i].namelen, 1, stdout);
|
fwrite(nva[i].name, 1, nva[i].namelen, stdout);
|
||||||
printf(": ");
|
printf(": ");
|
||||||
fwrite(nva[i].value, nva[i].valuelen, 1, stdout);
|
fwrite(nva[i].value, 1, nva[i].valuelen, stdout);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,9 +186,9 @@ int inflate_header_block(nghttp2_hd_inflater *inflater, uint8_t *in,
|
||||||
inlen -= proclen;
|
inlen -= proclen;
|
||||||
|
|
||||||
if (inflate_flags & NGHTTP2_HD_INFLATE_EMIT) {
|
if (inflate_flags & NGHTTP2_HD_INFLATE_EMIT) {
|
||||||
fwrite(nv.name, nv.namelen, 1, stderr);
|
fwrite(nv.name, 1, nv.namelen, stderr);
|
||||||
fprintf(stderr, ": ");
|
fprintf(stderr, ": ");
|
||||||
fwrite(nv.value, nv.valuelen, 1, stderr);
|
fwrite(nv.value, 1, nv.valuelen, stderr);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,9 +179,9 @@ static void delete_http2_session_data(http2_session_data *session_data) {
|
||||||
|
|
||||||
static void print_header(FILE *f, const uint8_t *name, size_t namelen,
|
static void print_header(FILE *f, const uint8_t *name, size_t namelen,
|
||||||
const uint8_t *value, size_t valuelen) {
|
const uint8_t *value, size_t valuelen) {
|
||||||
fwrite(name, namelen, 1, f);
|
fwrite(name, 1, namelen, f);
|
||||||
fprintf(f, ": ");
|
fprintf(f, ": ");
|
||||||
fwrite(value, valuelen, 1, f);
|
fwrite(value, 1, valuelen, f);
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ static int on_data_chunk_recv_callback(nghttp2_session *session _U_,
|
||||||
void *user_data) {
|
void *user_data) {
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
if (session_data->stream_data->stream_id == stream_id) {
|
if (session_data->stream_data->stream_id == stream_id) {
|
||||||
fwrite(data, len, 1, stdout);
|
fwrite(data, 1, len, stdout);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -994,7 +994,7 @@ static int emit_string(nghttp2_bufs *bufs, const uint8_t *str, size_t len) {
|
||||||
blocklen = count_encoded_length(enclen, 7);
|
blocklen = count_encoded_length(enclen, 7);
|
||||||
|
|
||||||
DEBUGF(fprintf(stderr, "deflatehd: emit string str="));
|
DEBUGF(fprintf(stderr, "deflatehd: emit string str="));
|
||||||
DEBUGF(fwrite(str, len, 1, stderr));
|
DEBUGF(fwrite(str, 1, len, stderr));
|
||||||
DEBUGF(fprintf(stderr, ", length=%zu, huffman=%d, encoded_length=%zu\n", len,
|
DEBUGF(fprintf(stderr, ", length=%zu, huffman=%d, encoded_length=%zu\n", len,
|
||||||
huffman, enclen));
|
huffman, enclen));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue