| /lighttpd1.4/src/ |
| H A D | http_chunk.c | 38 do { buf[--i] = "0123456789abcdef"[len & 0x0F]; } while (len >>= 4); in http_chunk_len_append() 55 do { buf[--i] = "0123456789abcdef"[len & 0x0F]; } while (len >>= 4); in http_chunk_len_append_tempfile() 96 if (len <= 0) in http_chunk_append_file_ref_range() 212 if (0 == len) return 0; in http_chunk_append_buffer() 236 if (0 == len) return 0; in http_chunk_append_mem() 256 if (0 == len) return 0; in http_chunk_transfer_cqlen() 292 while (len) { in http_chunk_decode_append_data() 404 len -= hsz; in http_chunk_decode_append_data() 413 if (clen > len) clen = len; in http_chunk_decode_append_data() 418 len -= clen; in http_chunk_decode_append_data() [all …]
|
| H A D | chunk.c | 498 if (len > 0) { in chunkqueue_append_file_fd() 613 size_t sz = *len ? *len : (chunk_buf_sz >> 1); in chunkqueue_get_memory() 620 *len = avail; in chunkqueue_get_memory() 738 clen = len; in chunkqueue_steal() 913 } while (len); in chunkqueue_append_mem_to_tempfile() 972 if (clen > len) clen = len; in chunkqueue_append_cqmem_to_tempfile() 1185 if (len < clen) clen = len; in chunkqueue_steal_with_tempfiles() 1192 if (len < clen) clen = len; in chunkqueue_steal_with_tempfiles() 1229 if (len < clen) clen = len; in chunkqueue_append_cq_range() 1370 if (len) in chunkqueue_write_data() [all …]
|
| H A D | buffer.c | 119 ? b->ptr + len in buffer_string_prepare_append() 138 ? b->ptr + len in buffer_extend() 140 b->used = len+x+1; in buffer_extend() 172 d[len] = '\0'; in buffer_copy_string_len() 194 memcpy(buffer_extend(b, len), s, len); in buffer_append_string_len() 219 size_t len = 0; in buffer_append_iovec() local 269 b->used = len+1; in buffer_copy_string_len_lc() 270 d[len] = '\0'; in buffer_copy_string_len_lc() 354 return len; in li_itostrn() 363 return len; in li_utostrn() [all …]
|
| H A D | algo_xxhash.h | 2484 len &= 31; in XXH64_finalize() 3496 XXH_ASSERT(1 <= len && len <= 3); in XXH3_len_1to3_64b() 3519 XXH_ASSERT(4 <= len && len <= 8); in XXH3_len_4to8_64b() 3535 XXH_ASSERT(9 <= len && len <= 16); in XXH3_len_9to16_64b() 3623 XXH_ASSERT(16 < len && len <= 128); in XXH3_len_17to128_64b() 3653 XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); in XXH3_len_129to240_64b() 5074 XXH_ASSERT(1 <= len && len <= 3); in XXH3_len_1to3_128b() 5103 XXH_ASSERT(4 <= len && len <= 8); in XXH3_len_4to8_128b() 5130 XXH_ASSERT(9 <= len && len <= 16); in XXH3_len_9to16_128b() 5237 XXH_ASSERT(16 < len && len <= 128); in XXH3_len_17to128_128b() [all …]
|
| H A D | http_range.c | 97 ranges[1] = len-1; in http_range_parse_next() 99 ranges[1] = n < len ? n : len-1; in http_range_parse_next() 104 ranges[0] = len > -n ? len + n : 0;/*('n' is negative here)*/ in http_range_parse_next() 105 ranges[1] = len-1; in http_range_parse_next() 159 uint32_t len = sizeof("bytes ")-1; in http_range_single() local 161 len += (uint32_t)li_itostrn(cr+len, sizeof(cr)-len, ranges[0]); in http_range_single() 162 cr[len++] = '-'; in http_range_single() 163 len += (uint32_t)li_itostrn(cr+len, sizeof(cr)-len, ranges[1]); in http_range_single() 164 cr[len++] = '/'; in http_range_single() 165 len += (uint32_t)li_itostrn(cr+len, sizeof(cr)-len, complete_length); in http_range_single() [all …]
|
| H A D | stat_cache.c | 351 if (blen > len && b->ptr[len] == '/' && 0 == memcmp(b->ptr, name, len)) in fam_dir_invalidate_tree() 379 uint32_t len = in->len; in stat_cache_handle_fdevent_in() local 409 if (len) { in stat_cache_handle_fdevent_in() 410 do { --len; } while (len && in->name[len-1] == '\0'); in stat_cache_handle_fdevent_in() 483 uint32_t len; in stat_cache_handle_fdevent_fn() local 1104 if (name[len-1] == '/') { if (0 == --len) len = 1; } in stat_cache_update_entry() 1138 if (name[len-1] == '/') { if (0 == --len) len = 1; } in stat_cache_delete_entry() 1172 if (blen > len && b->ptr[len] == '/' && 0 == memcmp(b->ptr, name, len)) { in stat_cache_invalidate_dir_tree_walk() 1205 if (blen > len && b->ptr[len] == '/' && 0 == memcmp(b->ptr, name, len)) in stat_cache_tag_dir_tree() 1240 if (name[len-1] == '/') { if (0 == --len) len = 1; } in stat_cache_delete_dir() [all …]
|
| H A D | buffer.h | 122 #define buffer_append_uint_hex(b,len) buffer_append_uint_hex_lc((b),(len)) argument 124 void buffer_append_uint_hex_lc(buffer *b, uintmax_t len); 308 static inline void buffer_truncate(buffer *b, uint32_t len); 309 static inline void buffer_truncate(buffer *b, uint32_t len) { in buffer_truncate() argument 311 b->used = len + 1; in buffer_truncate() 330 const uint32_t len = buffer_clen(b); in buffer_append_slash() local 331 if (len > 0 && '/' != b->ptr[len-1]) in buffer_append_slash() 398 static inline void buffer_string_set_length(buffer *b, uint32_t len); 400 if (len < b->size) in buffer_string_set_length() 401 buffer_truncate(b, len); in buffer_string_set_length() [all …]
|
| H A D | request.c | 119 --len; in request_check_hostname() 241 size_t len; in http_request_host_normalize() local 262 if (laddr.n == len && 0 == memcmp(laddr.s, b->ptr+1, len)) { in http_request_host_normalize() 276 len = strlen(buf); in http_request_host_normalize() 280 if (len < sizeof(laddr.s)) memcpy(laddr.s, buf, (laddr.n = len)); in http_request_host_normalize() 861 size_t len = hoff[2]; in http_request_parse_reqline() local 868 if (ptr[len-2] == '\r') in http_request_parse_reqline() 869 len-=2; in http_request_parse_reqline() 871 len-=1; in http_request_parse_reqline() 924 len = (size_t)(p - uri - 1); in http_request_parse_reqline() [all …]
|
| H A D | http_etag.c | 47 http_etag_remix (buffer * const etag, const char * const str, const uint32_t len) in http_etag_remix() argument 49 uint32_t h = dekhash(str, len, len); /*(pass len as initial hash value)*/ in http_etag_remix() 74 uint32_t len = 0; in http_etag_create() local 77 x[len++] = (uint64_t)st->st_ino; in http_etag_create() 80 x[len++] = (uint64_t)st->st_size; in http_etag_create() 83 x[len++] = (uint64_t)st->st_mtime; in http_etag_create() 86 x[len++] = (uint64_t)st->st_mtimespec.tv_nsec; in http_etag_create() 88 x[len++] = (uint64_t)st->st_mtim.tv_nsec; in http_etag_create() 94 http_etag_remix(etag, (char *)x, len << 3); in http_etag_create()
|
| H A D | mod_magnet.c | 456 size_t len; member 466 cb.len = 0; in magnet_checkconstbuffer() 892 int rc = (d1.len == d2.len) in magnet_digest_eq() 976 int rc = li_hex2bin(p, s.len >> 1, s.ptr, s.len); in magnet_hexdec() 1151 size_t len = s.len; in magnet_bsdec() local 1155 len -= 2; in magnet_bsdec() 1630 v.len in magnet_reqhdr_set() 2187 http_header_env_set(r, key.ptr, key.len, val.ptr, val.len); in magnet_envvar_set() 2241 if (len < 0 || sce->st.st_size - off < len) in magnet_respbody_add() 2558 len = -1; in magnet_attach_content() [all …]
|
| H A D | mod_ajp13.c | 196 if (0 == len || len == UINT16_MAX) in ajp13_enc_string() 202 memcpy(x+n, s, len); in ajp13_enc_string() 203 n += len; in ajp13_enc_string() 508 if (len) { in ajp13_enc_server_name() 682 uint32_t len; in ajp13_expand_headers() local 696 if (len) buffer_append_string_len(b, (char *)ptr, len); in ajp13_expand_headers() 697 ptr += len+1; in ajp13_expand_headers() 708 if (len == 0xA000 || len > 0xA00B) break; in ajp13_expand_headers() 734 ptr += len+1; in ajp13_expand_headers() 742 plen -= len+1; in ajp13_expand_headers() [all …]
|
| H A D | chunk.h | 86 …e(chunkqueue * restrict cq, const buffer * restrict fn, off_t offset, off_t len); /* copies "fn" */ 88 void chunkqueue_append_mem(chunkqueue * restrict cq, const char * restrict mem, size_t len); /* cop… 89 void chunkqueue_append_mem_min(chunkqueue * restrict cq, const char * restrict mem, size_t len); /*… 116 ssize_t chunkqueue_append_splice_pipe_tempfile(chunkqueue * restrict cq, int fd, unsigned int len, … 117 ssize_t chunkqueue_append_splice_sock_tempfile(chunkqueue * restrict cq, int fd, unsigned int len, … 133 char * chunkqueue_get_memory(chunkqueue * restrict cq, size_t * restrict len); 135 void chunkqueue_use_memory(chunkqueue * restrict cq, chunk *ckpt, size_t len); 136 void chunkqueue_update_file(chunkqueue * restrict cq, chunk *c, off_t len); 141 void chunkqueue_mark_written(chunkqueue *cq, off_t len); 148 void chunkqueue_steal(chunkqueue * restrict dest, chunkqueue * restrict src, off_t len); [all …]
|
| H A D | mod_deflate.c | 809 if (len > 0 && '/' == b->ptr[len-1]) in SETDEFAULTS_FUNC() 914 size_t len; in stream_deflate_compress() local 941 size_t len; in stream_deflate_flush() local 1030 size_t len; in stream_bzip2_compress() local 1056 size_t len; in stream_bzip2_flush() local 1658 if (len > n) len = n; in mod_deflate_file_chunk_mmap() 1706 max = len; in deflate_compress_response() 1717 if (len > max) len = max; in deflate_compress_response() 1725 if (len > max) len = max; in deflate_compress_response() 1737 max -= len; in deflate_compress_response() [all …]
|
| H A D | h2.c | 478 if (len > 8) { in h2_recv_goaway() 853 for (; len >= 6; len -= 6, s += 6) { in h2_parse_frame_settings() 919 if (len) { in h2_parse_frame_settings() 951 if (0 != len) in h2_recv_settings() 1114 wupd = len; in h2_recv_data() 2089 data += len; in h2_send_hpack() 2090 dlen -= len; in h2_send_hpack() 2609 data += len; 2610 sent += len; 2611 dlen -= len; [all …]
|
| H A D | algo_md.h | 19 static inline uint32_t djbhash(const char *str, const uint32_t len, uint32_t hash); 20 static inline uint32_t djbhash(const char *str, const uint32_t len, uint32_t hash) in djbhash() argument 23 for (uint32_t i = 0; i < len; ++i) hash = ((hash << 5) + hash) ^ s[i]; in djbhash() 34 static inline uint32_t dekhash (const char *str, const uint32_t len, uint32_t hash); 35 static inline uint32_t dekhash (const char *str, const uint32_t len, uint32_t hash) in dekhash() argument 38 for (uint32_t i = 0; i < len; ++i) hash = (hash << 5) ^ (hash >> 27) ^ s[i]; in dekhash()
|
| H A D | burl.c | 296 for (int i = 0, len = qs < 0 ? used : qs; i < len; ++i) { in burl_normalize_path() local 302 while (i < len && s[i] != '/') ++i; in burl_normalize_path() 393 for (unsigned int i = 0; i < len; ++i, ++j) { in burl_append_encode_nde() 427 for (unsigned int i = 0; i < len; ++i, ++j) { in burl_append_encode_psnde() 460 for (unsigned int i = 0; i < len; ++i, ++j) { in burl_append_encode_all() 500 if (0 == len) return; in burl_append() 503 buffer_append_string_len(b, str, len); in burl_append() 510 buffer_append_string_len(b, str, len); in burl_append() 513 burl_append_encode_all(b, str, len); in burl_append() 516 burl_append_encode_nde(b, str, len); in burl_append() [all …]
|
| H A D | mod_auth.c | 293 if (0 == len) { in mod_auth_algorithm_parse() 299 if (len > 5 in mod_auth_algorithm_parse() 300 && (s[len-5] ) == '-' in mod_auth_algorithm_parse() 306 len -= 5; in mod_auth_algorithm_parse() 312 if (3 == len in mod_auth_algorithm_parse() 321 else if (len >= 7 in mod_auth_algorithm_parse() 368 size_t len; in mod_auth_require_parse() local 957 if (dp->len[e_qop]) { in mod_auth_digest_mutate() 1296 uint32_t len = dp->len[e_userstar]; in mod_auth_digest_validate_userstar() local 1325 len = buffer_clen(tb); in mod_auth_digest_validate_userstar() [all …]
|
| H A D | ck.c | 82 void ck_memclear_s_hook (void *buf, rsize_t len); 88 (void)(len); /* UNUSED */ in ck_memclear_s_hook() 170 ck_getenv_s (size_t * const restrict len, 176 return getenv_s(len, value, maxsize, name); 182 if (NULL != len) 183 *len = 0; 192 if (NULL != len) 193 *len = vlen; 205 if (NULL != len) 206 *len = 0; [all …]
|
| H A D | plugin_config.h | 209 #define plugin_stats_get_ptr(s, len) \ argument 210 array_get_int_ptr(&plugin_stats, (s), (len)) 212 #define plugin_stats_incr(s, len) \ argument 213 (++(*array_get_int_ptr(&plugin_stats, (s), (len)))) 218 #define plugin_stats_decr(s, len) \ argument 219 (--(*array_get_int_ptr(&plugin_stats, (s), (len)))) 221 #define plugin_stats_set(s, len, val) \ argument 222 (*array_get_int_ptr(&plugin_stats, (s), (len)) = (val))
|
| H A D | http_chunk.h | 11 int http_chunk_append_mem(request_st *r, const char * mem, size_t len); /* copies memory */ 13 int http_chunk_decode_append_mem(request_st * const r, const char * const mem, const size_t len); 15 int http_chunk_transfer_cqlen(request_st *r, chunkqueue *src, size_t len); 18 …_file_fd_range(request_st *r, const buffer *fn, int fd, off_t offset, off_t len); /* copies "fn" */ 19 …_ref_range(request_st *r, struct stat_cache_entry *sce, off_t offset, off_t len); /* copies "fn" */
|
| H A D | http_cgi.c | 95 http_cgi_encode_varname (buffer * const b, const char * const restrict s, const size_t len, const i… in http_cgi_encode_varname() argument 97 char * const restrict p = buffer_string_prepare_copy(b, len + 5); in http_cgi_encode_varname() 102 if (len == 12 && buffer_eq_icase_ssn(s, "Content-Type", 12)) { in http_cgi_encode_varname() 111 for (i = 0; i < len; ++i) {/* uppercase alpha, pass numeric, map rest '_' */ in http_cgi_encode_varname() 127 uint32_t len; in http_cgi_headers() local 144 len = opts->strip_request_uri ? buffer_clen(opts->strip_request_uri) : 0; in http_cgi_headers() 145 if (len) { in http_cgi_headers() 149 if (n < len || 0 != memcmp(s, opts->strip_request_uri->ptr, len) in http_cgi_headers() 150 || s[len] != '/') in http_cgi_headers() 151 len = 0; in http_cgi_headers() [all …]
|
| H A D | response.c | 84 len = 0; in http_response_write_header_partial_1xx() 248 pathinfo = r->physical.path.ptr + len; in http_response_physical_path_check() 285 && buffer_eq_icase_ssn(r->target.ptr + reqlen - len, pathinfo, len)) { in http_response_physical_path_check() 290 buffer_copy_string_len(&r->pathinfo, r->target.ptr + reqlen - len, len); in http_response_physical_path_check() 478 size_t len = buffer_clen(b); in http_response_prepare() local 481 if (len > 1 && in http_response_prepare() 482 b->ptr[len - 1] == '/' && in http_response_prepare() 483 (b->ptr[len - 2] == ' ' || b->ptr[len - 2] == '.')) { in http_response_prepare() 484 len -= 2; in http_response_prepare() 487 while (len > 0 && ( ' ' == b->ptr[len-1] || '.' == b->ptr[len-1] ) ) --len; in http_response_prepare() [all …]
|
| H A D | mod_scgi.c | 146 size_t len; in scgi_env_add_scgi() local 150 len = key_len + val_len + 2; in scgi_env_add_scgi() 152 char *dst = buffer_extend(env, len); in scgi_env_add_scgi() 206 size_t len; in scgi_create_env() local 211 len = buffer_clen(tb); in scgi_create_env() 212 offset = 10 - len; in scgi_create_env() 213 memcpy(b->ptr+offset, tb->ptr, len); in scgi_create_env() 217 size_t len = buffer_clen(b)-10; in scgi_create_env() local 218 if (len > USHRT_MAX) { in scgi_create_env() 227 b->ptr[offset+1] = len & 0xff; /* little-endian */ in scgi_create_env() [all …]
|
| /lighttpd1.4/tests/ |
| H A D | fcgi-responder.c | 93 part = len - offset > FCGI_MAX_LENGTH ? FCGI_MAX_LENGTH : len - offset; in fcgi_puts() 127 *len = vlen; in fcgi_getenv() 140 if (e) *len = strlen(e); in fcgi_getenv() 149 int len; in fcgi_process_params() local 157 if (2 == len && 0 == memcmp(p, "lf", 2)) in fcgi_process_params() 159 else if (4 == len && 0 == memcmp(p, "crlf", 4)) in fcgi_process_params() 181 if (7 == len && 0 == memcmp(p, "auth-ok", 7)) in fcgi_process_params() 208 else if (len > 4 && 0 == memcmp(p, "env=", 4)) in fcgi_process_params() 209 cdata = fcgi_getenv(r, rlen, p+4, len-4, &len); in fcgi_process_params() 210 else if (8 == len && 0 == memcmp(p, "auth-var", 8)) in fcgi_process_params() [all …]
|
| /lighttpd1.4/src/ls-hpack/ |
| H A D | lshpack.c | 1464 uint32_t len; in hdec_dec_str() local 1479 (*src) += len; in hdec_dec_str() 1483 if (dst_len < len) in hdec_dec_str() 1493 ret = len; in hdec_dec_str() 1776 if (len < 0) in lshpack_dec_decode() 1809 if (len < 0) in lshpack_dec_decode() 1818 if (len > UINT16_MAX) in lshpack_dec_decode() 1893 switch (len) in lshpack_dec_huff_decode() 1963 if (len && dst + len <= dst_end) in lshpack_dec_huff_decode() 2007 if (len && dst + len <= dst_end) in lshpack_dec_huff_decode() [all …]
|