Lines Matching refs:len
63 … char * http_request_check_uri_strict (const uint8_t * const restrict s, const uint_fast32_t len) { in __attribute_nonnull__()
64 for (uint_fast32_t i = 0; i < len; ++i) { in __attribute_nonnull__()
74 …st char * http_request_check_line_strict (const char * const restrict s, const uint_fast32_t len) { in __attribute_nonnull__()
75 for (uint_fast32_t i = 0; i < len; ++i) { in __attribute_nonnull__()
86 …t char * http_request_check_line_minimal (const char * const restrict s, const uint_fast32_t len) { in __attribute_nonnull__()
87 for (uint_fast32_t i = 0; i < len; ++i) { in __attribute_nonnull__()
110 uint32_t len = buffer_clen(host); in request_check_hostname() local
111 const char * const colon = memchr(h, ':', len); in request_check_hostname()
112 uint32_t hlen = colon ? (uint32_t)(colon - h) : len; in request_check_hostname()
119 --len; in request_check_hostname()
121 memmove(host->ptr+hlen, colon, len - hlen); in request_check_hostname()
122 buffer_truncate(host, len); in request_check_hostname()
241 size_t len; in http_request_host_normalize() local
261 len = (size_t)((percent ? percent : bracket) - (b->ptr+1)); in http_request_host_normalize()
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()
279 if (len + (size_t)(bracket - percent) >= sizeof(buf)) return -1; in http_request_host_normalize()
280 if (len < sizeof(laddr.s)) memcpy(laddr.s, buf, (laddr.n = len)); in http_request_host_normalize()
281 memcpy(buf+len, percent, (size_t)(bracket - percent)); in http_request_host_normalize()
282 len += (size_t)(bracket - percent); in http_request_host_normalize()
285 buffer_append_str2(b, buf, len, CONST_STR_LEN("]")); in http_request_host_normalize()
502 …quest_st * const restrict r, const char * const restrict ptr, const size_t len, const unsigned int… in http_request_parse_proto_loose() argument
503 const char * proto = memchr(ptr, ' ', len); in http_request_parse_proto_loose()
506 proto = memchr(proto+1, ' ', len - (proto+1 - ptr)); in http_request_parse_proto_loose()
532 …quest_st * const restrict r, const char * const restrict uri, const size_t len, const unsigned int… in http_request_parse_reqline_uri() argument
534 if ((len > 7 && buffer_eq_icase_ssn(uri, "http://", 7) in http_request_parse_reqline_uri()
535 && NULL != (nuri = memchr(uri + 7, '/', len-7))) in http_request_parse_reqline_uri()
537 (len > 8 && buffer_eq_icase_ssn(uri, "https://", 8) in http_request_parse_reqline_uri()
538 && NULL != (nuri = memchr(uri + 8, '/', len-8)))) { in http_request_parse_reqline_uri()
550 || (HTTP_METHOD_OPTIONS == r->http_method && uri[0] == '*' && 1 == len)) { in http_request_parse_reqline_uri()
619 const uint32_t len = buffer_clen(&r->target);/*(http_header_strict)*/ in http_request_validate_pseudohdrs() local
623 : http_request_check_uri_strict((const uint8_t *)r->target.ptr, len) in http_request_validate_pseudohdrs()
624 : http_request_check_line_minimal(r->target.ptr, len); in http_request_validate_pseudohdrs()
861 size_t len = hoff[2]; in http_request_parse_reqline() local
866 if (len < 13) /* minimum len with (!http_header_strict): "x x HTTP/1.0\n" */ in http_request_parse_reqline()
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()
888 const char *p = ptr + len - 8; in http_request_parse_reqline()
901 int status = http_request_parse_proto_loose(r,ptr,len,http_parseopts); in http_request_parse_reqline()
904 for (p = ptr + len - 9; p[-1] != ' '; --p) ; in http_request_parse_reqline()
911 while (i < len && ptr[i] != ' ') ++i; in http_request_parse_reqline()
924 len = (size_t)(p - uri - 1); in http_request_parse_reqline()
927 uri = http_request_parse_reqline_uri(r, uri, len, http_parseopts); in http_request_parse_reqline()
929 len = (size_t)(p - uri - 1); in http_request_parse_reqline()
932 if (0 == len) in http_request_parse_reqline()
939 : http_request_check_uri_strict((const uint8_t *)uri, len) in http_request_parse_reqline()
944 buffer_copy_string_len(&r->target, uri, len); in http_request_parse_reqline()
945 buffer_copy_string_len(&r->target_orig, uri, len); in http_request_parse_reqline()
1006 r->rqst_header_len -= len; in http_request_parse_target()
1007 len = buffer_clen(target); in http_request_parse_target()
1008 r->rqst_header_len += len; in http_request_parse_target()
1009 if (len > MAX_HTTP_REQUEST_URI) { in http_request_parse_target()