Lines Matching refs:b
258 free(r->gw_dechunk->b.ptr); in http_response_body_clear()
282 free(r->gw_dechunk->b.ptr); in http_response_header_clear()
485 buffer * const b = r->tmp_buf; in http_response_xsendfile2() local
510 buffer_copy_string_len(b, filename, range - filename); in http_response_xsendfile2()
515 buffer_urldecode_path(b); in http_response_xsendfile2()
516 if (!buffer_is_valid_UTF8(b)) { in http_response_xsendfile2()
518 "X-Sendfile2 invalid UTF-8 after url-decode: %s", b->ptr); in http_response_xsendfile2()
522 buffer_path_simplify(b); in http_response_xsendfile2()
524 buffer_to_lower(b); in http_response_xsendfile2()
526 if (buffer_is_blank(b)) { in http_response_xsendfile2()
532 ? array_match_value_prefix(xdocroot, b) in http_response_xsendfile2()
533 : array_match_value_prefix_nc(xdocroot, b); in http_response_xsendfile2()
537 b->ptr); in http_response_xsendfile2()
543 sce = stat_cache_get_entry_open(b, r->conf.follow_symlink); in http_response_xsendfile2()
547 "X-Sendfile2: %s", b->ptr); in http_response_xsendfile2()
552 "send-file error: wrong filetype for X-Sendfile2: %s", b->ptr); in http_response_xsendfile2()
753 …plice(request_st * const r, http_response_opts * const opts, buffer * const b, const int fd, unsig… in http_response_append_splice() argument
761 if (!buffer_is_blank(b)) { in http_response_append_splice()
763 int rc = http_response_append_buffer(r, b, 0); /*(0 to flush)*/ in http_response_append_splice()
764 chunk_buffer_yield(b); /*(improve large buf reuse)*/ in http_response_append_splice()
1074 http_response_check_1xx (request_st * const r, buffer * const restrict b, uint32_t hlen, uint32_t d… in http_response_check_1xx() argument
1083 memmove(b->ptr, b->ptr+hlen, dlen); in http_response_check_1xx()
1084 buffer_truncate(b, dlen); in http_response_check_1xx()
1095 …p_response_parse_headers(request_st * const r, http_response_opts * const opts, buffer * const b) { in http_response_parse_headers() argument
1125 blen = buffer_clen(b); in http_response_parse_headers()
1126 header_len = http_header_parse_hoff(b->ptr, blen, hoff); in http_response_parse_headers()
1136 is_nph = hoff[2] >= 12 && 0 == memcmp(b->ptr, "HTTP/", 5); in http_response_parse_headers()
1138 const char * colon = memchr(b->ptr, ':', hoff[2]-1); in http_response_parse_headers()
1140 if (hoff[2] <= 2 && (1 == hoff[2] || b->ptr[0] == '\r')) { in http_response_parse_headers()
1146 if (0 != http_chunk_append_buffer(r, b)) { in http_response_parse_headers()
1166 bstart = b->ptr + header_len; in http_response_parse_headers()
1169 if (0 != http_response_process_headers(r, opts, b->ptr, hoff, is_nph)) in http_response_parse_headers()
1173 && http_response_check_1xx(r, b, bstart - b->ptr, blen)); in http_response_parse_headers()
1235 …_read(request_st * const r, http_response_opts * const opts, buffer * const b, fdnode * const fdn)… in http_response_read() argument
1242 avail = buffer_string_space(b); in http_response_read()
1249 int rc = http_response_append_splice(r, opts, b, fd, toread); in http_response_read()
1259 uint32_t blen = buffer_clen(b); in http_response_read()
1305 if (buffer_is_blank(b)) in http_response_read()
1306 chunk_buffer_yield(b); /*(improve large buf reuse)*/ in http_response_read()
1323 avail = chunk_buffer_prepare_append(b, avail); in http_response_read()
1326 n = read(fd, b->ptr+buffer_clen(b), avail); in http_response_read()
1337 if (buffer_is_blank(b)) in http_response_read()
1338 chunk_buffer_yield(b); /*(improve large buf reuse)*/ in http_response_read()
1347 buffer_commit(b, (size_t)n); in http_response_read()
1350 b->ptr[buffer_clen(b)+n] = '\0'; in http_response_read()
1354 handler_t rc = opts->parse(r, opts, b, (size_t)n); in http_response_read()
1357 if (buffer_is_blank(b)) in http_response_read()
1358 chunk_buffer_yield(b); /*(improve large buf reuse)*/ in http_response_read()
1361 int rc = http_response_append_buffer(r, b, 0); /*(0 to flush)*/ in http_response_read()
1362 chunk_buffer_yield(b); /*(improve large buf reuse)*/ in http_response_read()
1376 handler_t rc = http_response_parse_headers(r, opts, b); in http_response_read()
1380 buffer_clear(b); in http_response_read()
1407 int rc = http_response_append_buffer(r, b, simple_accum); in http_response_read()
1434 if (buffer_is_blank(b)) chunk_buffer_yield(b); /*(improve large buf reuse)*/ in http_response_read()