Merge branch 'weliu-master'
This commit is contained in:
commit
7dfd6ab1ad
|
@ -1677,23 +1677,14 @@ static ssize_t hd_inflate_read(nghttp2_hd_inflater *inflater, nghttp2_buf *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finalize indexed header representation reception. If header is
|
* Finalize indexed header representation reception. The referenced
|
||||||
* emitted, |*nv_out| is filled with that value and 0 is returned. If
|
* header is always emitted, and |*nv_out| is filled with that value.
|
||||||
* no header is emitted, 1 is returned.
|
|
||||||
*
|
|
||||||
* This function returns either 0 or 1 if it succeeds, or one of the
|
|
||||||
* following negative error codes:
|
|
||||||
*
|
|
||||||
* NGHTTP2_ERR_NOMEM
|
|
||||||
* Out of memory
|
|
||||||
*/
|
*/
|
||||||
static int hd_inflate_commit_indexed(nghttp2_hd_inflater *inflater,
|
static void hd_inflate_commit_indexed(nghttp2_hd_inflater *inflater,
|
||||||
nghttp2_hd_nv *nv_out) {
|
nghttp2_hd_nv *nv_out) {
|
||||||
nghttp2_hd_nv nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index);
|
nghttp2_hd_nv nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index);
|
||||||
|
|
||||||
emit_header(nv_out, &nv);
|
emit_header(nv_out, &nv);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1944,16 +1935,11 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
|
||||||
inflater->index = inflater->left;
|
inflater->index = inflater->left;
|
||||||
--inflater->index;
|
--inflater->index;
|
||||||
|
|
||||||
rv = hd_inflate_commit_indexed(inflater, nv_out);
|
hd_inflate_commit_indexed(inflater, nv_out);
|
||||||
if (rv < 0) {
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
inflater->state = NGHTTP2_HD_STATE_OPCODE;
|
inflater->state = NGHTTP2_HD_STATE_OPCODE;
|
||||||
/* If rv == 1, no header was emitted */
|
*inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
|
||||||
if (rv == 0) {
|
return (ssize_t)(in - first);
|
||||||
*inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
|
|
||||||
return (ssize_t)(in - first);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
inflater->index = inflater->left;
|
inflater->index = inflater->left;
|
||||||
--inflater->index;
|
--inflater->index;
|
||||||
|
|
Loading…
Reference in New Issue