From 40d217beb170cd80faddbcc9059a9501e28737d6 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 17 Aug 2016 22:37:57 +0900 Subject: [PATCH] Remove bufs_avail --- lib/nghttp2_buf.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/nghttp2_buf.c b/lib/nghttp2_buf.c index 538df370..b5021a27 100644 --- a/lib/nghttp2_buf.c +++ b/lib/nghttp2_buf.c @@ -296,12 +296,6 @@ size_t nghttp2_bufs_len(nghttp2_bufs *bufs) { return len; } -static size_t bufs_avail(nghttp2_bufs *bufs) { - return nghttp2_buf_avail(&bufs->cur->buf) + - (bufs->chunk_length - bufs->offset) * - (bufs->max_chunk - bufs->chunk_used); -} - static int bufs_alloc_chain(nghttp2_bufs *bufs) { int rv; nghttp2_buf_chain *chain; @@ -341,10 +335,6 @@ int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len) { nghttp2_buf *buf; const uint8_t *p; - if (bufs_avail(bufs) < len) { - return NGHTTP2_ERR_BUFFER_ERROR; - } - p = data; while (len) {