Lines Matching refs:deflater
691 int nghttp2_hd_deflate_init(nghttp2_hd_deflater *deflater, nghttp2_mem *mem) { in nghttp2_hd_deflate_init() argument
693 deflater, NGHTTP2_HD_DEFAULT_MAX_DEFLATE_BUFFER_SIZE, mem); in nghttp2_hd_deflate_init()
696 int nghttp2_hd_deflate_init2(nghttp2_hd_deflater *deflater, in nghttp2_hd_deflate_init2() argument
700 rv = hd_context_init(&deflater->ctx, mem); in nghttp2_hd_deflate_init2()
705 hd_map_init(&deflater->map); in nghttp2_hd_deflate_init2()
708 deflater->notify_table_size_change = 1; in nghttp2_hd_deflate_init2()
709 deflater->ctx.hd_table_bufsize_max = max_deflate_dynamic_table_size; in nghttp2_hd_deflate_init2()
711 deflater->notify_table_size_change = 0; in nghttp2_hd_deflate_init2()
714 deflater->deflate_hd_table_bufsize_max = max_deflate_dynamic_table_size; in nghttp2_hd_deflate_init2()
715 deflater->min_hd_table_bufsize_max = UINT32_MAX; in nghttp2_hd_deflate_init2()
764 void nghttp2_hd_deflate_free(nghttp2_hd_deflater *deflater) { in nghttp2_hd_deflate_free() argument
765 hd_context_free(&deflater->ctx); in nghttp2_hd_deflate_free()
1241 nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size) { in nghttp2_hd_deflate_change_table_size() argument
1243 deflater->deflate_hd_table_bufsize_max); in nghttp2_hd_deflate_change_table_size()
1245 deflater->ctx.hd_table_bufsize_max = next_bufsize; in nghttp2_hd_deflate_change_table_size()
1247 deflater->min_hd_table_bufsize_max = in nghttp2_hd_deflate_change_table_size()
1248 nghttp2_min(deflater->min_hd_table_bufsize_max, next_bufsize); in nghttp2_hd_deflate_change_table_size()
1250 deflater->notify_table_size_change = 1; in nghttp2_hd_deflate_change_table_size()
1252 hd_context_shrink_table_size(&deflater->ctx, &deflater->map); in nghttp2_hd_deflate_change_table_size()
1321 static int hd_deflate_decide_indexing(nghttp2_hd_deflater *deflater, in hd_deflate_decide_indexing() argument
1329 deflater->ctx.hd_table_bufsize_max * 3 / 4) { in hd_deflate_decide_indexing()
1336 static int deflate_nv(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs, in deflate_nv() argument
1349 mem = deflater->ctx.mem; in deflate_nv()
1367 : hd_deflate_decide_indexing(deflater, nv, token); in deflate_nv()
1369 res = search_hd_table(&deflater->ctx, nv, token, indexing_mode, in deflate_nv()
1370 &deflater->map, hash); in deflate_nv()
1394 hd_nv.name = nghttp2_hd_table_get(&deflater->ctx, (size_t)idx).name; in deflate_nv()
1413 rv = add_hd_table_incremental(&deflater->ctx, &hd_nv, &deflater->map, hash); in deflate_nv()
1434 int nghttp2_hd_deflate_hd_bufs(nghttp2_hd_deflater *deflater, in nghttp2_hd_deflate_hd_bufs() argument
1440 if (deflater->ctx.bad) { in nghttp2_hd_deflate_hd_bufs()
1444 if (deflater->notify_table_size_change) { in nghttp2_hd_deflate_hd_bufs()
1447 min_hd_table_bufsize_max = deflater->min_hd_table_bufsize_max; in nghttp2_hd_deflate_hd_bufs()
1449 deflater->notify_table_size_change = 0; in nghttp2_hd_deflate_hd_bufs()
1450 deflater->min_hd_table_bufsize_max = UINT32_MAX; in nghttp2_hd_deflate_hd_bufs()
1452 if (deflater->ctx.hd_table_bufsize_max > min_hd_table_bufsize_max) { in nghttp2_hd_deflate_hd_bufs()
1461 rv = emit_table_size(bufs, deflater->ctx.hd_table_bufsize_max); in nghttp2_hd_deflate_hd_bufs()
1469 rv = deflate_nv(deflater, bufs, &nv[i]); in nghttp2_hd_deflate_hd_bufs()
1481 deflater->ctx.bad = 1; in nghttp2_hd_deflate_hd_bufs()
1485 ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, in nghttp2_hd_deflate_hd() argument
1492 mem = deflater->ctx.mem; in nghttp2_hd_deflate_hd()
1500 rv = nghttp2_hd_deflate_hd_bufs(deflater, &bufs, nv, nvlen); in nghttp2_hd_deflate_hd()
1517 ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, in nghttp2_hd_deflate_hd_vec() argument
1525 mem = deflater->ctx.mem; in nghttp2_hd_deflate_hd_vec()
1533 rv = nghttp2_hd_deflate_hd_bufs(deflater, &bufs, nv, nvlen); in nghttp2_hd_deflate_hd_vec()
1550 size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater, in nghttp2_hd_deflate_bound() argument
1554 (void)deflater; in nghttp2_hd_deflate_bound()
1587 nghttp2_hd_deflater *deflater; in nghttp2_hd_deflate_new2() local
1593 deflater = nghttp2_mem_malloc(mem, sizeof(nghttp2_hd_deflater)); in nghttp2_hd_deflate_new2()
1595 if (deflater == NULL) { in nghttp2_hd_deflate_new2()
1599 rv = nghttp2_hd_deflate_init2(deflater, deflate_hd_table_bufsize_max, mem); in nghttp2_hd_deflate_new2()
1602 nghttp2_mem_free(mem, deflater); in nghttp2_hd_deflate_new2()
1607 *deflater_ptr = deflater; in nghttp2_hd_deflate_new2()
1612 void nghttp2_hd_deflate_del(nghttp2_hd_deflater *deflater) { in nghttp2_hd_deflate_del() argument
1615 mem = deflater->ctx.mem; in nghttp2_hd_deflate_del()
1617 nghttp2_hd_deflate_free(deflater); in nghttp2_hd_deflate_del()
1619 nghttp2_mem_free(mem, deflater); in nghttp2_hd_deflate_del()
2315 size_t nghttp2_hd_deflate_get_num_table_entries(nghttp2_hd_deflater *deflater) { in nghttp2_hd_deflate_get_num_table_entries() argument
2316 return get_max_index(&deflater->ctx); in nghttp2_hd_deflate_get_num_table_entries()
2320 nghttp2_hd_deflate_get_table_entry(nghttp2_hd_deflater *deflater, size_t idx) { in nghttp2_hd_deflate_get_table_entry() argument
2321 return hd_get_table_entry(&deflater->ctx, idx); in nghttp2_hd_deflate_get_table_entry()
2325 nghttp2_hd_deflate_get_dynamic_table_size(nghttp2_hd_deflater *deflater) { in nghttp2_hd_deflate_get_dynamic_table_size() argument
2326 return deflater->ctx.hd_table_bufsize; in nghttp2_hd_deflate_get_dynamic_table_size()
2330 nghttp2_hd_deflate_get_max_dynamic_table_size(nghttp2_hd_deflater *deflater) { in nghttp2_hd_deflate_get_max_dynamic_table_size() argument
2331 return deflater->ctx.hd_table_bufsize_max; in nghttp2_hd_deflate_get_max_dynamic_table_size()