Skip to content

Commit e8be604

Browse files
committed
[h2client] print origin frame
1 parent 747c6ad commit e8be604

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

h2client.c

+19
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,15 @@ process_rst_stream_frame(const nghttp2_rst_stream *rst_stream)
293293
log_info("rst error code is %u", rst_stream->error_code);
294294
}
295295

296+
static void
297+
print_origin_extension(const nghttp2_ext_origin *origin)
298+
{
299+
for (size_t i = 0; i < origin->nov; i++) {
300+
nghttp2_origin_entry *ov = &origin->ov[i];
301+
log_info("origin host <%.*s>", (int)ov->origin_len, ov->origin);
302+
}
303+
}
304+
296305
static void
297306
process_http2_frame(const nghttp2_frame *frame, int c_to_s)
298307
{
@@ -316,6 +325,16 @@ process_http2_frame(const nghttp2_frame *frame, int c_to_s)
316325
case NGHTTP2_RST_STREAM:
317326
process_rst_stream_frame(&frame->rst_stream);
318327
break;
328+
329+
case NGHTTP2_ORIGIN:
330+
{
331+
nghttp2_ext_origin *origin = (nghttp2_ext_origin *)frame->ext.payload;
332+
if (origin) {
333+
print_origin_extension(origin);
334+
}
335+
}
336+
337+
break;
319338
}
320339
}
321340

0 commit comments

Comments
 (0)