Lines Matching refs:len

747                     size_t len = buffer_clen(mimetype);  in SETDEFAULTS_FUNC()  local
748 if (len > 2 && mimetype->ptr[len-1] == '*') in SETDEFAULTS_FUNC()
749 buffer_truncate(mimetype, len-1); in SETDEFAULTS_FUNC()
808 const uint32_t len = buffer_clen(b); in SETDEFAULTS_FUNC() local
809 if (len > 0 && '/' == b->ptr[len-1]) in SETDEFAULTS_FUNC()
810 buffer_truncate(b, len-1); /*remove end slash*/ in SETDEFAULTS_FUNC()
860 static int mod_deflate_cache_file_append (handler_ctx * const hctx, const char *out, size_t len) { in mod_deflate_cache_file_append() argument
863 wr = write(hctx->cache_fd, out, len); in mod_deflate_cache_file_append()
864 } while (wr > 0 ? ((out += wr), (len -= (size_t)wr)) : errno == EINTR); in mod_deflate_cache_file_append()
865 return (0 == len) ? 0 : -1; in mod_deflate_cache_file_append()
868 …ic int stream_http_chunk_append_mem(handler_ctx * const hctx, const char * const out, size_t len) { in stream_http_chunk_append_mem() argument
869 if (0 == len) return 0; in stream_http_chunk_append_mem()
871 ? http_chunk_append_mem(hctx->r, out, len) in stream_http_chunk_append_mem()
872 : mod_deflate_cache_file_append(hctx, out, len); in stream_http_chunk_append_mem()
914 size_t len; in stream_deflate_compress() local
926 len = hctx->output->size - z->avail_out; in stream_deflate_compress()
927 hctx->bytes_out += len; in stream_deflate_compress()
928 if (0 != stream_http_chunk_append_mem(hctx, hctx->output->ptr, len)) in stream_deflate_compress()
941 size_t len; in stream_deflate_flush() local
965 len = hctx->output->size - z->avail_out; in stream_deflate_flush()
966 if (z->avail_out == 0 || (len > 0 && (end || p->conf.sync_flush))) { in stream_deflate_flush()
967 hctx->bytes_out += len; in stream_deflate_flush()
968 if (0 != stream_http_chunk_append_mem(hctx, hctx->output->ptr, len)) in stream_deflate_flush()
1030 size_t len; in stream_bzip2_compress() local
1041 len = hctx->output->size - bz->avail_out; in stream_bzip2_compress()
1042 hctx->bytes_out += len; in stream_bzip2_compress()
1043 if (0 != stream_http_chunk_append_mem(hctx, hctx->output->ptr, len)) in stream_bzip2_compress()
1056 size_t len; in stream_bzip2_flush() local
1080 len = hctx->output->size - bz->avail_out; in stream_bzip2_flush()
1081 if (bz->avail_out == 0 || (len > 0 && (end || p->conf.sync_flush))) { in stream_bzip2_flush()
1082 hctx->bytes_out += len; in stream_bzip2_flush()
1083 if (0 != stream_http_chunk_append_mem(hctx, hctx->output->ptr, len)) in stream_bzip2_flush()
1134 const uint32_t len = buffer_clen(vb); in stream_br_init() local
1140 || (len > 4 in stream_br_init()
1141 && (0 == strncmp(vb->ptr+len-5, "+json", sizeof("+json")-1) in stream_br_init()
1142 || 0 == strncmp(vb->ptr+len-4, "+xml", sizeof("+xml")-1)))) in stream_br_init()
1499 static off_t mod_deflate_using_libdeflate_setjmp_cb (void *dst, const void *src, off_t len) in mod_deflate_using_libdeflate_setjmp_cb() argument
1506 ? libdeflate_gzip_compress(params->compressor, in, (size_t)len, in mod_deflate_using_libdeflate_setjmp_cb()
1508 : libdeflate_zlib_compress(params->compressor, in, (size_t)len, in mod_deflate_using_libdeflate_setjmp_cb()
1638 static off_t mod_deflate_file_chunk_setjmp_cb (void *dst, const void *src, off_t len) in mod_deflate_file_chunk_setjmp_cb() argument
1640 return mod_deflate_compress(dst, (const unsigned char *)src, len); in mod_deflate_file_chunk_setjmp_cb()
1657 off_t len = chunk_file_view_dlen(cfv, c->offset); in mod_deflate_file_chunk_mmap() local
1658 if (len > n) len = n; in mod_deflate_file_chunk_mmap()
1659 off_t rc = sys_setjmp_eval3(mod_deflate_file_chunk_setjmp_cb, hctx, p, len); in mod_deflate_file_chunk_mmap()
1666 len = -1; /*return -1;*/ in mod_deflate_file_chunk_mmap()
1668 return len; in mod_deflate_file_chunk_mmap()
1690 off_t len, max; in deflate_compress_response() local
1696 len = chunkqueue_length(cq); in deflate_compress_response()
1699 cq->bytes_in -= len; in deflate_compress_response()
1700 cq->bytes_out -= len; in deflate_compress_response()
1705 if (p->conf.sync_flush && max > (len = p->conf.work_block_size << 10)) { in deflate_compress_response()
1706 max = len; in deflate_compress_response()
1716 len = buffer_clen(c->mem) - c->offset; in deflate_compress_response()
1717 if (len > max) len = max; in deflate_compress_response()
1718 if (mod_deflate_compress(hctx, (unsigned char *)c->mem->ptr+c->offset, len) < 0) { in deflate_compress_response()
1724 len = c->file.length - c->offset; in deflate_compress_response()
1725 if (len > max) len = max; in deflate_compress_response()
1726 if ((len = mod_deflate_file_chunk(r, hctx, c, len)) < 0) { in deflate_compress_response()
1737 max -= len; in deflate_compress_response()
1738 chunkqueue_mark_written(&hctx->in_queue, len); in deflate_compress_response()
1879 off_t len; in REQUEST_FUNC() local
1913 len = chunkqueue_length(&r->write_queue); in REQUEST_FUNC()
1914 if (len <= (off_t)p->conf.min_compress_size) return HANDLER_GO_ON; in REQUEST_FUNC()
1916 && len > ((off_t)p->conf.max_compress_size << 10)) { in REQUEST_FUNC()
2054 mod_deflate_note_ratio(r, sce->st.st_size, len); in REQUEST_FUNC()
2060 if (NULL == sce || sce->st.st_size != len) in REQUEST_FUNC()
2088 if (len > 131072 /* XXX: TBD what should min size be for optimization?*/ in REQUEST_FUNC()
2093 && chunkqueue_chunk_file_view(c, len, r->conf.errh) in REQUEST_FUNC()
2094 && chunk_file_view_dlen(c->file.view, c->offset) >= len) { /*(cfv)*/ in REQUEST_FUNC()
2096 hctx->bytes_in = len; in REQUEST_FUNC()
2110 if (len <= 65536 /*(p->tmp_buf is at least 64k)*/ in REQUEST_FUNC()
2117 hctx->bytes_in = len; in REQUEST_FUNC()
2147 && (len >> 1) < (off_t)((~(uint32_t)0u) >> 1)) in REQUEST_FUNC()
2148 BrotliEncoderSetParameter(hctx->u.br, BROTLI_PARAM_SIZE_HINT, (uint32_t)len); in REQUEST_FUNC()