@@ -17,20 +17,22 @@ extern "C" {
17
17
* @brief read flag of xqc_h3_request_read_notify_pt
18
18
*/
19
19
typedef enum {
20
- /* nothing readable */
20
+ /** nothing readable */
21
21
XQC_REQ_NOTIFY_READ_NULL = 0 ,
22
22
23
- /* read header section flag, this will be set when the first HEADERS is processed */
23
+ /** read header section flag, this will be set when the first HEADERS is processed */
24
24
XQC_REQ_NOTIFY_READ_HEADER = 1 << 0 ,
25
25
26
- /* read body flag, this will be set when a DATA frame is processed */
26
+ /** read body flag, this will be set when a DATA frame is processed */
27
27
XQC_REQ_NOTIFY_READ_BODY = 1 << 1 ,
28
28
29
- /* read trailer section flag, this will be set when trailer HEADERS frame is processed */
29
+ /** read trailer section flag, this will be set when trailer HEADERS frame is processed */
30
30
XQC_REQ_NOTIFY_READ_TRAILER = 1 << 2 ,
31
31
32
- /* read empty fin flag, notify callback will be triggered when a single fin frame is received
33
- while HEADERS and DATA were notified. This flag will NEVER be set with other flags */
32
+ /**
33
+ * read empty fin flag, notify callback will be triggered when a single fin frame is received
34
+ while HEADERS and DATA were notified. This flag will NEVER be set with other flags
35
+ */
34
36
XQC_REQ_NOTIFY_READ_EMPTY_FIN = 1 << 3 ,
35
37
} xqc_request_notify_flag_t ;
36
38
@@ -88,28 +90,28 @@ typedef enum xqc_http3_nv_flag_s {
88
90
89
91
90
92
typedef struct xqc_http_header_s {
91
- /* name of http header */
93
+ /** name of http header */
92
94
struct iovec name ;
93
95
94
- /* value of http header */
96
+ /** value of http header */
95
97
struct iovec value ;
96
98
97
- /* flags of xqc_http3_nv_flag_t with OR operator */
99
+ /** flags of xqc_http3_nv_flag_t with OR operator */
98
100
uint8_t flags ;
99
101
} xqc_http_header_t ;
100
102
101
103
102
104
typedef struct xqc_http_headers_s {
103
- /* array of http headers */
105
+ /** array of http headers */
104
106
xqc_http_header_t * headers ;
105
107
106
- /* count of headers */
108
+ /** count of headers */
107
109
size_t count ;
108
110
109
- /* capacity of headers */
111
+ /** capacity of headers */
110
112
size_t capacity ;
111
113
112
- /* total byte count of headers */
114
+ /** total byte count of headers */
113
115
size_t total_len ;
114
116
} xqc_http_headers_t ;
115
117
@@ -122,19 +124,32 @@ typedef struct xqc_http_headers_s {
122
124
typedef struct xqc_request_stats_s {
123
125
size_t send_body_size ;
124
126
size_t recv_body_size ;
125
- size_t send_header_size ; /* plaintext header size */
126
- size_t recv_header_size ; /* plaintext header size */
127
- size_t send_hdr_compressed ; /* compressed header size */
128
- size_t recv_hdr_compressed ; /* compressed header size */
129
- int stream_err ; /* QUIC layer error code, 0 for no error */
130
- xqc_usec_t blocked_time ; /* time of h3 stream being blocked */
131
- xqc_usec_t unblocked_time ; /* time of h3 stream being unblocked */
132
- xqc_usec_t stream_fin_time ; /* time of receiving transport fin */
133
- xqc_usec_t h3r_begin_time ; /* time of creating request */
134
- xqc_usec_t h3r_end_time ; /* time of request fin */
135
- xqc_usec_t h3r_header_begin_time ; /* time of receiving HEADERS frame */
136
- xqc_usec_t h3r_header_end_time ; /* time of finishing processing HEADERS frame */
137
- xqc_usec_t h3r_body_begin_time ; /* time of receiving DATA frame */
127
+ /** plaintext header size */
128
+ size_t send_header_size ;
129
+ /** plaintext header size */
130
+ size_t recv_header_size ;
131
+ /** compressed header size */
132
+ size_t send_hdr_compressed ;
133
+ /** compressed header size */
134
+ size_t recv_hdr_compressed ;
135
+ /** QUIC layer error code, 0 for no error */
136
+ int stream_err ;
137
+ /** time of h3 stream being blocked */
138
+ xqc_usec_t blocked_time ;
139
+ /** time of h3 stream being unblocked */
140
+ xqc_usec_t unblocked_time ;
141
+ /** time of receiving transport fin */
142
+ xqc_usec_t stream_fin_time ;
143
+ /** time of creating request */
144
+ xqc_usec_t h3r_begin_time ;
145
+ /** time of request fin */
146
+ xqc_usec_t h3r_end_time ;
147
+ /** time of receiving HEADERS frame */
148
+ xqc_usec_t h3r_header_begin_time ;
149
+ /** time of finishing processing HEADERS frame */
150
+ xqc_usec_t h3r_header_end_time ;
151
+ /** time of receiving DATA frame */
152
+ xqc_usec_t h3r_body_begin_time ;
138
153
xqc_usec_t h3r_header_send_time ;
139
154
xqc_usec_t h3r_body_send_time ;
140
155
xqc_usec_t stream_fin_send_time ;
@@ -171,7 +186,7 @@ typedef struct xqc_request_stats_s {
171
186
/**
172
187
* @brief how long the request was blocked by congestion control (ms)
173
188
*/
174
- xqc_msec_t cwnd_blocked_ms ;
189
+ xqc_msec_t cwnd_blocked_ms ;
175
190
/**
176
191
* @brief the number of packet has been retransmitted
177
192
*/
@@ -209,25 +224,27 @@ typedef struct xqc_h3_ext_bytestream_stats_s {
209
224
xqc_usec_t first_byte_rcvd_time ;
210
225
} xqc_h3_ext_bytestream_stats_t ;
211
226
212
- /* connection settings for http3 */
227
+ /**
228
+ * @brief connection settings for http3
229
+ */
213
230
typedef struct xqc_h3_conn_settings_s {
214
- /* MAX_FIELD_SECTION_SIZE of http3 */
231
+ /** MAX_FIELD_SECTION_SIZE of http3 */
215
232
uint64_t max_field_section_size ;
216
233
217
- /* MAX_PUSH_STREAMS */
234
+ /** MAX_PUSH_STREAMS */
218
235
uint64_t max_pushes ;
219
236
220
- /* ENC_MAX_DYNAMIC_TABLE_CAPACITY */
237
+ /** ENC_MAX_DYNAMIC_TABLE_CAPACITY */
221
238
uint64_t qpack_enc_max_table_capacity ;
222
239
223
- /* DEC_MAX_DYNAMIC_TABLE_CAPACITY */
240
+ /** DEC_MAX_DYNAMIC_TABLE_CAPACITY */
224
241
uint64_t qpack_dec_max_table_capacity ;
225
242
226
- /* MAX_BLOCKED_STREAMS */
243
+ /** MAX_BLOCKED_STREAMS */
227
244
uint64_t qpack_blocked_streams ;
228
245
229
246
#ifdef XQC_COMPAT_DUPLICATE
230
- /* compat with the original qpack encoder's duplicate strategy */
247
+ /** compat with the original qpack encoder's duplicate strategy */
231
248
xqc_bool_t qpack_compat_duplicate ;
232
249
#endif
233
250
@@ -316,16 +333,16 @@ typedef void (*xqc_h3_ext_datagram_mss_updated_notify_pt)(xqc_h3_conn_t *conn,
316
333
317
334
typedef struct xqc_h3_ext_dgram_callbacks_s {
318
335
319
- /* the return value is ignored by XQUIC stack */
336
+ /** the return value is ignored by XQUIC stack */
320
337
xqc_h3_ext_datagram_read_notify_pt dgram_read_notify ;
321
338
322
- /* the return value is ignored by XQUIC stack */
339
+ /** the return value is ignored by XQUIC stack */
323
340
xqc_h3_ext_datagram_write_notify_pt dgram_write_notify ;
324
341
325
- /* the return value is ignored by XQUIC stack */
342
+ /** the return value is ignored by XQUIC stack */
326
343
xqc_h3_ext_datagram_acked_notify_pt dgram_acked_notify ;
327
344
328
- /* the return value is ignored by XQUIC stack */
345
+ /** the return value is ignored by XQUIC stack */
329
346
xqc_h3_ext_datagram_lost_notify_pt dgram_lost_notify ;
330
347
xqc_h3_ext_datagram_mss_updated_notify_pt dgram_mss_updated_notify ;
331
348
@@ -335,16 +352,16 @@ typedef struct xqc_h3_ext_dgram_callbacks_s {
335
352
* @brief http3 connection callbacks for application layer
336
353
*/
337
354
typedef struct xqc_h3_conn_callbacks_s {
338
- /* http3 connection creation callback, REQUIRED for server, OPTIONAL for client */
355
+ /** http3 connection creation callback, REQUIRED for server, OPTIONAL for client */
339
356
xqc_h3_conn_notify_pt h3_conn_create_notify ;
340
357
341
- /* http3 connection close callback */
358
+ /** http3 connection close callback */
342
359
xqc_h3_conn_notify_pt h3_conn_close_notify ;
343
360
344
- /* handshake finished callback. which will be triggered when HANDSHAKE_DONE is received */
361
+ /** handshake finished callback. which will be triggered when HANDSHAKE_DONE is received */
345
362
xqc_h3_handshake_finished_pt h3_conn_handshake_finished ;
346
363
347
- /* ping callback. which will be triggered when ping is acked */
364
+ /** ping callback. which will be triggered when ping is acked */
348
365
xqc_h3_conn_ping_ack_notify_pt h3_conn_ping_acked ; /* optional */
349
366
350
367
} xqc_h3_conn_callbacks_t ;
@@ -354,53 +371,53 @@ typedef struct xqc_h3_conn_callbacks_s {
354
371
* @brief http3 request callbacks for application layer
355
372
*/
356
373
typedef struct xqc_h3_request_callbacks_s {
357
- /* request creation notify. it will be triggered after a request was created, and is required
374
+ /** request creation notify. it will be triggered after a request was created, and is required
358
375
for server, optional for client */
359
376
xqc_h3_request_notify_pt h3_request_create_notify ;
360
377
361
- /* request close notify. which will be triggered after a request was closed */
378
+ /** request close notify. which will be triggered after a request was closed */
362
379
xqc_h3_request_notify_pt h3_request_close_notify ;
363
380
364
- /* request read notify callback. which will be triggered after received http headers or body */
381
+ /** request read notify callback. which will be triggered after received http headers or body */
365
382
xqc_h3_request_read_notify_pt h3_request_read_notify ;
366
383
367
- /* request write notify callback. when triggered, users can continue to send headers or body */
384
+ /** request write notify callback. when triggered, users can continue to send headers or body */
368
385
xqc_h3_request_notify_pt h3_request_write_notify ;
369
386
370
- /* request closing notify callback, will be triggered when request is closing */
387
+ /** request closing notify callback, will be triggered when request is closing */
371
388
xqc_h3_request_closing_notify_pt h3_request_closing_notify ;
372
389
373
390
} xqc_h3_request_callbacks_t ;
374
391
375
392
typedef struct xqc_h3_ext_bytestream_callbacks_s {
376
393
377
- /* the return value is ignored by XQUIC stack */
394
+ /** the return value is ignored by XQUIC stack */
378
395
xqc_h3_ext_bytestream_notify_pt bs_create_notify ;
379
396
380
- /* the return value is ignored by XQUIC stack */
397
+ /** the return value is ignored by XQUIC stack */
381
398
xqc_h3_ext_bytestream_notify_pt bs_close_notify ;
382
399
383
- /* negative return values will cause the connection to be closed */
400
+ /** negative return values will cause the connection to be closed */
384
401
xqc_h3_ext_bytestream_read_notify_pt bs_read_notify ;
385
402
386
- /* negative return values will cause the connection to be closed */
403
+ /** negative return values will cause the connection to be closed */
387
404
xqc_h3_ext_bytestream_notify_pt bs_write_notify ;
388
405
389
406
} xqc_h3_ext_bytestream_callbacks_t ;
390
407
391
408
392
409
typedef struct xqc_h3_callbacks_s {
393
410
394
- /* http3 connection callbacks */
411
+ /** http3 connection callbacks */
395
412
xqc_h3_conn_callbacks_t h3c_cbs ;
396
413
397
- /* http3 request callbacks */
414
+ /** http3 request callbacks */
398
415
xqc_h3_request_callbacks_t h3r_cbs ;
399
416
400
- /* datagram callbacks */
417
+ /** datagram callbacks */
401
418
xqc_h3_ext_dgram_callbacks_t h3_ext_dgram_cbs ;
402
419
403
- /* bytestream callbacks */
420
+ /** bytestream callbacks */
404
421
xqc_h3_ext_bytestream_callbacks_t h3_ext_bs_cbs ;
405
422
406
423
} xqc_h3_callbacks_t ;
@@ -496,7 +513,7 @@ void xqc_h3_engine_set_local_settings(xqc_engine_t *engine,
496
513
* @brief create and http3 connection
497
514
*
498
515
* @param engine return from xqc_engine_create
499
- * @param conn_settings connection settings
516
+ * @param conn_settings Include all the connection settings, which should be customized according to the actual needs, and will be defaultly set to internal_default_conn_settings if not specified.
500
517
* @param token token receive from server, xqc_save_token_pt callback
501
518
* @param token_len length of token
502
519
* @param server_host server domain
0 commit comments