Lines Matching refs:s
647 static int find_end_quoted_string (const char * const s, int i) { in find_end_quoted_string() argument
650 } while (s[i] != '"' && s[i] != '\0' && (s[i] != '\\' || s[++i] != '\0')); in find_end_quoted_string()
655 static int find_next_semicolon_or_comma_or_eq (const char * const s, int i) { in find_next_semicolon_or_comma_or_eq() argument
656 for (; s[i] != '=' && s[i] != ';' && s[i] != ',' && s[i] != '\0'; ++i) { in find_next_semicolon_or_comma_or_eq()
657 if (s[i] == '"') { in find_next_semicolon_or_comma_or_eq()
658 i = find_end_quoted_string(s, i); in find_next_semicolon_or_comma_or_eq()
659 if (s[i] == '\0') return -1; in find_next_semicolon_or_comma_or_eq()
666 static int find_next_semicolon_or_comma (const char * const s, int i) { in find_next_semicolon_or_comma() argument
667 for (; s[i] != ';' && s[i] != ',' && s[i] != '\0'; ++i) { in find_next_semicolon_or_comma()
668 if (s[i] == '"') { in find_next_semicolon_or_comma()
669 i = find_end_quoted_string(s, i); in find_next_semicolon_or_comma()
670 if (s[i] == '\0') return -1; in find_next_semicolon_or_comma()
720 char * const s = forwarded->ptr; in mod_extforward_Forwarded() local
726 while (s[i] == ' ' || s[i] == '\t') ++i; in mod_extforward_Forwarded()
727 if (s[i] == ';') { ++i; continue; } in mod_extforward_Forwarded()
728 if (s[i] == ',') { in mod_extforward_Forwarded()
734 if (s[i] == '\0') break; in mod_extforward_Forwarded()
737 i = find_next_semicolon_or_comma_or_eq(s, i); in mod_extforward_Forwarded()
743 if (s[i] != '=') continue; in mod_extforward_Forwarded()
746 i = find_next_semicolon_or_comma(s, i); in mod_extforward_Forwarded()
782 || !buffer_eq_icase_ssn(s+offsets[j], "for", 3)) in mod_extforward_Forwarded()
791 while (vlen > v && (s[vlen-1] == ' ' || s[vlen-1] == '\t')) --vlen; in mod_extforward_Forwarded()
792 if (vlen > v+1 && s[v] == '"' && s[vlen-1] == '"') { in mod_extforward_Forwarded()
795 if (s[v] == '[') { in mod_extforward_Forwarded()
799 do { --vlen; } while (vlen > v && s[vlen] != ']'); in mod_extforward_Forwarded()
805 else if (s[v] != '_' && s[v] != '/' && s[v] != 'u') { in mod_extforward_Forwarded()
807 for (klen=vlen, vlen=v; vlen < klen && s[vlen] != ':'; ++vlen) ; in mod_extforward_Forwarded()
821 int trusted = is_proxy_trusted(p, s+v, vlen-v); in mod_extforward_Forwarded()
823 if (s[v] != '_' && s[v] != '/' in mod_extforward_Forwarded()
824 && (7 != (vlen - v) || 0 != memcmp(s+v, "unknown", 7))) { in mod_extforward_Forwarded()
838 char *ipend = s+offsets[ofor+2]+offsets[ofor+3]; in mod_extforward_Forwarded()
842 rc = mod_extforward_set_addr(r, p, s+offsets[ofor+2], offsets[ofor+3]); in mod_extforward_Forwarded()
861 if (buffer_eq_icase_ssn(s+offsets[j], "by", 2)) in mod_extforward_Forwarded()
868 if (buffer_eq_icase_ssn(s+offsets[j], "for", 3)) in mod_extforward_Forwarded()
873 if (buffer_eq_icase_ssn(s+offsets[j], "host", 4)) in mod_extforward_Forwarded()
877 if (buffer_eq_icase_ssn(s+offsets[j], "proto", 5)) in mod_extforward_Forwarded()
881 if (buffer_eq_icase_ssn(s+offsets[j], "remote_user", 11)) in mod_extforward_Forwarded()
895 while (vlen > v && (s[vlen-1] == ' ' || s[vlen-1] == '\t')) --vlen; in mod_extforward_Forwarded()
896 if (vlen > v+1 && s[v] == '"' && s[vlen-1] == '"') { ++v; --vlen; } in mod_extforward_Forwarded()
897 mod_extforward_set_proto(r, s+v, vlen-v); in mod_extforward_Forwarded()
921 && buffer_eq_icase_ssn(s+offsets[j], "host", 4)) in mod_extforward_Forwarded()
940 while (vlen > v && (s[vlen-1] == ' ' || s[vlen-1] == '\t')) --vlen; in mod_extforward_Forwarded()
941 if (vlen > v+1 && s[v] == '"' && s[vlen-1] == '"') { in mod_extforward_Forwarded()
943 buffer_copy_string_len_lc(r->http_host, s+v, vlen-v); in mod_extforward_Forwarded()
950 buffer_copy_string_len_lc(r->http_host, s+v, vlen-v); in mod_extforward_Forwarded()
971 && buffer_eq_icase_ssn(s+offsets[j], "remote_user", 11)) in mod_extforward_Forwarded()
980 while (vlen > v && (s[vlen-1] == ' ' || s[vlen-1] == '\t')) --vlen; in mod_extforward_Forwarded()
981 if (vlen > v+1 && s[v] == '"' && s[vlen-1] == '"') { in mod_extforward_Forwarded()
985 CONST_STR_LEN("REMOTE_USER"), s+v, vlen-v); in mod_extforward_Forwarded()
995 CONST_STR_LEN("REMOTE_USER"), s+v, vlen-v); in mod_extforward_Forwarded()
1011 && buffer_eq_icase_ssn(s+offsets[j], "for", 3)) { in mod_extforward_Forwarded()
1017 buffer_append_string_len(xff, s+v, vlen); in mod_extforward_Forwarded()
1018 if (s[v-1] != '=') { /*(must have been quoted-string)*/ in mod_extforward_Forwarded()
1390 static int mod_extforward_str_to_port (const char * const s) in mod_extforward_str_to_port() argument
1395 if (!light_isdigit(s[i])) return -1; in mod_extforward_str_to_port()
1396 port += (s[i] - '0'); in mod_extforward_str_to_port()
1397 if (s[i+1] == '\0') return port; in mod_extforward_str_to_port()
1416 char *s = hdr->v1.line + sizeof("PROXY")-1; /*checked in hap_PROXY_recv()*/ in mod_extforward_hap_PROXY_v1() local
1420 if (*s != ' ') return -1; in mod_extforward_hap_PROXY_v1()
1421 ++s; in mod_extforward_hap_PROXY_v1()
1422 if (s[0] == 'T' && s[1] == 'C' && s[2] == 'P' && s[4] == ' ') { in mod_extforward_hap_PROXY_v1()
1423 if (s[3] == '4') { in mod_extforward_hap_PROXY_v1()
1425 } else if (s[3] == '6') { in mod_extforward_hap_PROXY_v1()
1431 s += 5; in mod_extforward_hap_PROXY_v1()
1433 else if (0 == memcmp(s, "UNKNOWN", sizeof("UNKNOWN")-1) in mod_extforward_hap_PROXY_v1()
1434 && (s[7] == '\0' || s[7] == ' ')) { in mod_extforward_hap_PROXY_v1()
1442 src_addr = s; in mod_extforward_hap_PROXY_v1()