| /lighttpd1.4/src/ |
| H A D | buffer.h | 239 #define light_bshift(b) ((uint64_t)1uL << (b)) argument 284 return b->used - (0 != b->used); in buffer_clen() 292 return b->size ? b->size - (b->used | (0 == b->used)) : 0; in buffer_string_space() 317 b->ptr ? buffer_truncate(b, 0) : (void)buffer_extend(b, 0); in buffer_blank() 336 b->used = 0; in buffer_clear() 346 return (b->used > 1 && b->ptr[b->used-2] == '/'); in buffer_has_slash_suffix() 350 return (b->used > 1 && b->ptr[b->used-2] == '/'); in buffer_has_pathsep_suffix() 375 return NULL == b || buffer_is_unset(b); in buffer_is_empty() 381 return NULL == b || buffer_is_blank(b); in buffer_string_is_empty() 388 return NULL != b ? buffer_clen(b) : 0; in buffer_string_length() [all …]
|
| H A D | buffer.c | 19 buffer * const b = calloc(1, sizeof(*b)); in buffer_init() local 21 return b; in buffer_init() 28 free(b); in buffer_free() 41 tmp = *src; *src = *b; *b = tmp; in buffer_move() 61 b->ptr = realloc(b->ptr, sz); in __attribute_nonnull__() 85 force_assert(size >= b->size || b->ptr); in buffer_string_prepare_copy() 134 b->used += x + (0 == b->used); in buffer_extend() 244 if (0 == b->used) b->used = 1; in buffer_append_path_len() 344 b->used += (uint32_t)rv + (0 == b->used); in buffer_append_strftime() 840 b->used = (dst - b->ptr) + 1; in buffer_urldecode_path() [all …]
|
| H A D | mod_status.c | 140 ? buffer_append_str3(b, in mod_status_header_append_sort() 144 : buffer_append_str3(b, in mod_status_header_append_sort() 191 buffer_append_char(b, '/'); in mod_status_html_rtable_r() 239 buffer_clear(b); in mod_status_html_rtable() 380 buffer_append_string_len(b, in mod_status_handle_server_status_html() 388 buffer_append_string_len(b, in mod_status_handle_server_status_html() 396 buffer_append_char(b, ')'); in mod_status_handle_server_status_html() 413 buffer_append_int(b, days); in mod_status_handle_server_status_html() 423 buffer_append_int(b, mins); in mod_status_handle_server_status_html() 626 buffer_append_int(b, avg); in mod_status_handle_server_status_json() [all …]
|
| H A D | algo_sha1.c | 85 R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); in SHA1_Transform() 86 R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); in SHA1_Transform() 87 R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); in SHA1_Transform() 88 R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); in SHA1_Transform() 89 R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); in SHA1_Transform() 90 R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); in SHA1_Transform() 91 R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); in SHA1_Transform() 92 R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); in SHA1_Transform() 93 R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); in SHA1_Transform() 94 R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); in SHA1_Transform() [all …]
|
| H A D | burl.c | 49 #define li_utf8_invalid_byte(b) ((b) >= 0xF5 || ((b)|0x1) == 0xC1) argument 212 const char * const s = b->ptr; in burl_contains_ctrls() 224 char * const s = b->ptr; in burl_normalize_qs20_to_plus_fix() 234 buffer_truncate(b, j); in burl_normalize_qs20_to_plus_fix() 253 char * const s = b->ptr; in burl_normalize_2F_to_slash_fix() 270 buffer_truncate(b, j); in burl_normalize_2F_to_slash_fix() 316 buffer_path_simplify(b); in burl_normalize_path() 358 qs = burl_scan_qmark(b); in burl_normalize() 415 buffer_commit(b, j); in burl_append_encode_nde() 449 buffer_commit(b, j); in burl_append_encode_psnde() [all …]
|
| H A D | algo_md5.c | 102 #define FF(a, b, c, d, x, s, ac) { \ argument 103 (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ 105 (a) += (b); \ 107 #define GG(a, b, c, d, x, s, ac) { \ argument 108 (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ 110 (a) += (b); \ 112 #define HH(a, b, c, d, x, s, ac) { \ argument 115 (a) += (b); \ 117 #define II(a, b, c, d, x, s, ac) { \ argument 120 (a) += (b); \ [all …]
|
| H A D | log.c | 130 memcpy(b->ptr+buffer_clen(b)-nlen-2, n, nlen); in __attribute_nonnull__() 187 char *s = b->ptr + blen; in __attribute_nonnull__() 200 s = buffer_extend(b, n); in __attribute_nonnull__() 213 buffer_truncate(b, blen+i); in __attribute_nonnull__() 225 buffer * const restrict b = &log_errh->b; /*(use shared temp buffer)*/ in __attribute_nonnull__() local 226 buffer_clear(b); in __attribute_nonnull__() 229 log_buffer_timestamp(b); in __attribute_nonnull__() 232 return b; in __attribute_nonnull__() 279 log_error_write(errh, b); in log_error_va_list_impl() 281 buffer_clear(b); in log_error_va_list_impl() [all …]
|
| H A D | mod_proxy.c | 488 if (b->ptr[off] != '/') { in http_header_remap_uri() 607 buffer_commit(b, j); in buffer_append_string_backslash_escaped() 611 buffer *b = NULL; in proxy_set_Forwarded() local 781 b = r->http_host; in proxy_set_Forwarded() 782 if (b && !buffer_is_blank(b)) { in proxy_set_Forwarded() 791 b = &r->uri.scheme; in proxy_set_Forwarded() 850 buffer_append_str3(b, in proxy_create_env() 855 http_header_remap_uri(b, buffer_clen(b) - buffer_clen(&r->target), in proxy_create_env() 874 http_header_remap_host(b, buffer_clen(b) - alen, &hctx->conf.header, 1, alen); in proxy_create_env() 878 b->ptr[b->used-2] = '0'; /*(overwrite end of request line)*/ in proxy_create_env() [all …]
|
| H A D | mod_accesslog.c | 398 buffer *b; in SETDEFAULTS_FUNC() local 399 *(const buffer **)&b = cpv->v.b; in SETDEFAULTS_FUNC() 417 buffer_truncate(b, (size_t)(t - b->ptr)); in SETDEFAULTS_FUNC() 609 if (!buffer_string_is_empty(b)) in accesslog_append_buffer() 711 ptr = b->ptr + buffer_clen(b); in accesslog_append_time() 877 buffer_append_char(b, '-'); in log_access_record_cold() 943 buffer_append_char(b, ' '); in log_access_record() 945 buffer_append_char(b, ' '); in log_access_record() 992 : &fdlog->b; in REQUESTDONE_FUNC() 1002 if (!buffer_is_blank(b)) in REQUESTDONE_FUNC() [all …]
|
| H A D | mod_authn_ldap.c | 160 while (*(b = e)) { in mod_authn_add_scheme() 162 while (*b==' '||*b=='\t'||*b=='\r'||*b=='\n'||*b==',') ++b; in mod_authn_add_scheme() 164 e = b; in mod_authn_add_scheme() 176 buffer_append_string_len(tb, b, (size_t)(e - b)); in mod_authn_add_scheme() 238 buffer *b; in SETDEFAULTS_FUNC() local 239 *(const buffer **)&b = cpv->v.b; in SETDEFAULTS_FUNC() 260 *(const buffer **)&b = cpv->v.b; in SETDEFAULTS_FUNC() 387 switch (b[len]) { in mod_authn_append_ldap_dn_escape() 739 for (const char *b = template->ptr, *d; *b; b = d+1) { in mod_authn_ldap_basic() local 741 buffer_append_string_len(ldap_filter, b, (size_t)(d - b)); in mod_authn_ldap_basic() [all …]
|
| H A D | keyvalue.c | 194 burl_append(b, ctx->subject + off, len, flags); in pcre_keyvalue_buffer_append_match() 316 if (NULL != strchr(b->ptr, '?')) { in pcre_keyvalue_buffer_subst_ext() 318 buffer_append_char(b, '&'); in pcre_keyvalue_buffer_subst_ext() 321 buffer_append_char(b, '?'); in pcre_keyvalue_buffer_subst_ext() 366 buffer_clear(b); in pcre_keyvalue_buffer_subst() 459 const int used = (int)buffer_clen(b); in pcre_keyvalue_burl_percent_toupper() 473 const int used = (int)buffer_clen(b); in pcre_keyvalue_burl_percent_percent_toupper() 491 const int used = (int)buffer_clen(b); in pcre_keyvalue_burl_percent_high_UTF8() 508 buffer_copy_string_len(b, (char *)p, (size_t)j); in pcre_keyvalue_burl_percent_high_UTF8() 515 const int used = (int)buffer_clen(b); in pcre_keyvalue_burl_percent_percent_high_UTF8() [all …]
|
| H A D | configfile.c | 1109 buffer *b; in config_insert() local 1110 *(const buffer **)&b = cpv->v.b; in config_insert() 1131 memcpy(b->ptr+buffer_clen(b)+1, "server", 6); in config_insert() 1331 memmove(b->ptr+1, b->ptr, buffer_clen(b)-1); in config_finalize() 1527 buffer_commit(b, n); in config_print_string() 1712 if (!buffer_is_blank(cpv->v.b)) fn = cpv->v.b->ptr; in config_log_error_open() 2183 dlen = buffer_clen(b); in config_parse_stdin() 2191 avail = chunk_buffer_prepare_append(b, b->size+avail); in config_parse_stdin() 2203 chunk_buffer_release(b); in config_parse_stdin() 2377 if (b->ptr[0] != '[') in config_remoteip_normalize_ipv6() [all …]
|
| H A D | sock_addr.c | 138 if (b->plain.sa_family == AF_INET) { in sock_addr_is_addr_eq_bits() 314 buffer_copy_string(b, s); in sock_addr_inet_ntop_copy_buffer() 325 buffer_append_string(b, s); in sock_addr_inet_ntop_append_buffer() 334 buffer_append_char(b, ':'); in sock_addr_stringify_append_buffer() 339 buffer_append_char(b, '['); in sock_addr_stringify_append_buffer() 345 buffer_truncate(b, buffer_clen(b)-1); in sock_addr_stringify_append_buffer() 399 buffer_append_string(b, hbuf); in sock_addr_nameinfo_append_buffer() 414 buffer_append_char(b, '['); in sock_addr_nameinfo_append_buffer() 416 buffer_append_char(b, ']'); in sock_addr_nameinfo_append_buffer() 418 buffer_append_string(b, hbuf); in sock_addr_nameinfo_append_buffer() [all …]
|
| H A D | mod_evhost.c | 45 buffer *b; in mod_evhost_free_path_pieces() local 46 *(const buffer **)&b = path_pieces; in mod_evhost_free_path_pieces() 48 free(b); in mod_evhost_free_path_pieces() 179 if (!buffer_is_blank(cpv->v.b)) { in SETDEFAULTS_FUNC() 279 buffer_clear(b); in mod_evhost_build_doc_root_path() 287 buffer_append_char(b, '%'); in mod_evhost_build_doc_root_path() 313 buffer_append_string_buffer(b, &ds->value); in mod_evhost_build_doc_root_path() 318 buffer_append_string_buffer(b, path_pieces); in mod_evhost_build_doc_root_path() 322 buffer_append_slash(b); in mod_evhost_build_doc_root_path() 339 if (!stat_cache_path_isdir(b)) { in mod_evhost_uri_handler() [all …]
|
| H A D | http-header-glue.c | 515 buffer_urldecode_path(b); in http_response_xsendfile2() 522 buffer_path_simplify(b); in http_response_xsendfile2() 524 buffer_to_lower(b); in http_response_xsendfile2() 537 b->ptr); in http_response_xsendfile2() 1083 memmove(b->ptr, b->ptr+hlen, dlen); in http_response_check_1xx() 1084 buffer_truncate(b, dlen); in http_response_check_1xx() 1125 blen = buffer_clen(b); in http_response_parse_headers() 1173 && http_response_check_1xx(r, b, bstart - b->ptr, blen)); in http_response_parse_headers() 1326 n = read(fd, b->ptr+buffer_clen(b), avail); in http_response_read() 1350 b->ptr[buffer_clen(b)+n] = '\0'; in http_response_read() [all …]
|
| H A D | mod_simple_vhost.c | 40 pconf->server_root = cpv->v.b; in mod_simple_vhost_merge_config_cpv() 43 pconf->default_host = cpv->v.b; in mod_simple_vhost_merge_config_cpv() 46 pconf->document_root = cpv->v.b; in mod_simple_vhost_merge_config_cpv() 103 if (!buffer_is_blank(cpv->v.b)) { in SETDEFAULTS_FUNC() 104 buffer *b; in SETDEFAULTS_FUNC() local 105 *(const buffer **)&b = cpv->v.b; in SETDEFAULTS_FUNC() 106 buffer_append_slash(b); in SETDEFAULTS_FUNC() 109 cpv->v.b = NULL; in SETDEFAULTS_FUNC() 112 if (buffer_is_blank(cpv->v.b)) in SETDEFAULTS_FUNC() 113 cpv->v.b = NULL; in SETDEFAULTS_FUNC() [all …]
|
| H A D | sock_addr_cache.c | 12 int sock_addr_cache_inet_ntop_copy_buffer(buffer * const restrict b, const sock_addr * const restri… in sock_addr_cache_inet_ntop_copy_buffer() argument 27 buffer_copy_string(b, ntop4_strs[i].s); in sock_addr_cache_inet_ntop_copy_buffer() 37 buffer_copy_string(b, ntop6_strs[i].s); in sock_addr_cache_inet_ntop_copy_buffer() 47 if (0 != sock_addr_inet_ntop_copy_buffer(b, saddr)) { in sock_addr_cache_inet_ntop_copy_buffer() 48 buffer_blank(b); in sock_addr_cache_inet_ntop_copy_buffer() 55 memcpy(ntop4_strs+ndx4, b->ptr, buffer_clen(b)+1); in sock_addr_cache_inet_ntop_copy_buffer() 61 memcpy(ntop6_strs+ndx6, b->ptr, buffer_clen(b)+1); in sock_addr_cache_inet_ntop_copy_buffer()
|
| H A D | mod_wolfssl.c | 667 for (; (b = strstr(b, PEM_BEGIN_CERT)); b += sizeof(PEM_BEGIN_CERT)-1) in mod_wolfssl_load_pem_file() 669 b = data; in mod_wolfssl_load_pem_file() 670 for (; (b = strstr(b, PEM_BEGIN_TRUSTED_CERT)); in mod_wolfssl_load_pem_file() 694 if (*b == '\r') ++b; in mod_wolfssl_load_pem_file() 695 if (*b == '\n') ++b; in mod_wolfssl_load_pem_file() 707 if (*b == '\r') ++b; in mod_wolfssl_load_pem_file() 708 if (*b == '\n') ++b; in mod_wolfssl_load_pem_file() 780 if (*b == '\r') ++b; in mod_wolfssl_evp_pkey_load_pem_file() 781 if (*b == '\n') ++b; in mod_wolfssl_evp_pkey_load_pem_file() 1423 return b; in mod_openssl_load_stapling_file() [all …]
|
| H A D | mod_scgi.c | 194 buffer_copy_string_len(b, CONST_STR_LEN(" ")); in scgi_create_env() 199 buffer_clear(b); in scgi_create_env() 209 buffer_append_int(tb, buffer_clen(b)-10); in scgi_create_env() 213 memcpy(b->ptr+offset, tb->ptr, len); in scgi_create_env() 214 buffer_append_char(b, ','); in scgi_create_env() 217 size_t len = buffer_clen(b)-10; in scgi_create_env() 221 buffer_clear(b); in scgi_create_env() 226 b->ptr[offset] = 0; in scgi_create_env() 228 b->ptr[offset+2] = (len >> 8) & 0xff; in scgi_create_env() 229 b->ptr[offset+3] = 0; in scgi_create_env() [all …]
|
| H A D | array.c | 215 return array_keycmp(k, klen, b->ptr, b->used-1); in array_keycmpb() 270 int cmp = array_keycmp(k, klen, b->ptr, b->used-1); in array_get_index() 541 force_assert(b); in array_match_key_prefix() 555 const uint32_t blen = buffer_clen(b); in array_match_value_prefix() 569 const uint32_t blen = buffer_clen(b); in array_match_value_prefix_nc() 583 const uint32_t blen = buffer_clen(b); in array_match_key_suffix() 598 const uint32_t blen = buffer_clen(b); in array_match_key_suffix_nc() 613 const uint32_t blen = buffer_clen(b); in array_match_value_suffix() 628 const uint32_t blen = buffer_clen(b); in array_match_value_suffix_nc() 643 const uint32_t blen = buffer_clen(b); in array_match_path_or_ext() [all …]
|
| H A D | mod_magnet.c | 346 if (b && !buffer_is_unset(b)) in magnet_push_buffer() 450 UNUSED(b); in magnet_tmpbuf_release() 477 b->size = 0; in magnet_checkbuffer() 478 return b; in magnet_checkbuffer() 1024 lua_pushlstring(L, b->ptr, (size_t)(p - b->ptr)); in magnet_quoteddec() 1050 lua_pushlstring(L, b->ptr, (size_t)(p - b->ptr)); in magnet_quotedenc() 1137 buffer_truncate(b, d - b->ptr); in magnet_buffer_append_bsdec() 1459 lua_pushlstring(L, b, (size_t)(++s-b)); in magnet_push_quoted_string_range() 1462 lua_pushlstring(L, b, (size_t)(s-b)); in magnet_push_quoted_string_range() 1483 lua_pushlstring(L, b, (size_t)(s-b)); in magnet_cookie_param_push_token() [all …]
|
| /lighttpd1.4/src/t/ |
| H A D | test_buffer.c | 105 assert(space + buffer_string_length(b) == b->size - 1); in test_buffer_string_space() 106 buffer_commit(b, b->size - 1); in test_buffer_string_space() 107 assert(b->used == b->size); in test_buffer_string_space() 111 buffer_free(b); in test_buffer_string_space() 119 buffer_clear(b); in test_buffer_append_path_len() 122 buffer_clear(b); in test_buffer_append_path_len() 144 buffer_free(b); in test_buffer_append_path_len() 152 buffer_clear(b); in test_buffer_append_bs_escaped() 155 buffer_clear(b); in test_buffer_append_bs_escaped() 158 buffer_clear(b); in test_buffer_append_bs_escaped() [all …]
|
| H A D | test_configfile.c | 53 buffer * const b = buffer_init(); in test_configfile_addrbuf_eq_remote_ip_mask() local 59 buffer_copy_string(b, rmtmask[i].string); in test_configfile_addrbuf_eq_remote_ip_mask() 65 char *slash = strchr(b->ptr, '/'); in test_configfile_addrbuf_eq_remote_ip_mask() 68 uint32_t len = slash - b->ptr; in test_configfile_addrbuf_eq_remote_ip_mask() 69 int family = strchr(b->ptr, ':') ? AF_INET6 : AF_INET; in test_configfile_addrbuf_eq_remote_ip_mask() 70 char *after = buffer_string_prepare_append(b, 1 + 7 + 28); in test_configfile_addrbuf_eq_remote_ip_mask() 75 int rc = sock_addr_inet_pton(saddr, b->ptr, family, 0); in test_configfile_addrbuf_eq_remote_ip_mask() 76 if (nm_bits) b->ptr[len]='/'; in test_configfile_addrbuf_eq_remote_ip_mask() 80 (((uintptr_t)b->ptr + b->used + 1 + 7) & ~7); in test_configfile_addrbuf_eq_remote_ip_mask() 81 int bits = ((unsigned char *)b->ptr)[b->used]; in test_configfile_addrbuf_eq_remote_ip_mask() [all …]
|
| H A D | test_request.c | 54 buffer *b; in test_request_http_request_parse() local 328 b = http_header_request_get(r, HTTP_HEADER_LOCATION, in test_request_http_request_parse() 330 assert(b && buffer_eq_slen(b, CONST_STR_LEN("foo, foobar baz"))); in test_request_http_request_parse() 339 b = http_header_request_get(r, HTTP_HEADER_LOCATION, in test_request_http_request_parse() 341 assert(b && buffer_eq_slen(b, CONST_STR_LEN("foobar baz"))); in test_request_http_request_parse() 352 assert(b && buffer_eq_slen(b, CONST_STR_LEN("foobar baz"))); in test_request_http_request_parse() 425 assert(b && buffer_eq_slen(b, CONST_STR_LEN("foo"))); in test_request_http_request_parse() 434 assert(b && buffer_eq_slen(b, CONST_STR_LEN("foo bc"))); in test_request_http_request_parse() 536 assert(b && buffer_eq_slen(b, CONST_STR_LEN("zzz.example.org"))); in test_request_http_request_parse() 545 assert(b && buffer_eq_slen(b, CONST_STR_LEN("zzz.example.org"))); in test_request_http_request_parse() [all …]
|
| H A D | test_mod_evhost.c | 15 …st_build_doc_root_path_loop(struct ttt *tt, size_t nelts, buffer *authority, buffer *b, array *a) { in test_mod_evhost_build_doc_root_path_loop() argument 20 mod_evhost_build_doc_root_path(b, a, authority, path_pieces); in test_mod_evhost_build_doc_root_path_loop() 21 assert(buffer_eq_slen(b, t->expect, t->elen)); in test_mod_evhost_build_doc_root_path_loop() 28 buffer *b = buffer_init(); in test_mod_evhost_build_doc_root_path() local 55 test_mod_evhost_build_doc_root_path_loop(tt1, sizeof(tt1)/sizeof(tt1[0]), authority, b, a); in test_mod_evhost_build_doc_root_path() 58 test_mod_evhost_build_doc_root_path_loop(tt2, sizeof(tt2)/sizeof(tt2[0]), authority, b, a); in test_mod_evhost_build_doc_root_path() 61 test_mod_evhost_build_doc_root_path_loop(tt3, sizeof(tt3)/sizeof(tt3[0]), authority, b, a); in test_mod_evhost_build_doc_root_path() 64 buffer_free(b); in test_mod_evhost_build_doc_root_path()
|