MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / http_parse_host_char

Function http_parse_host_char

libs/qhttpserver/http-parser/http_parser.c:2168–2231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2166}
2167
2168static enum http_host_state
2169http_parse_host_char(enum http_host_state s, const char ch) {
2170 switch(s) {
2171 case s_http_userinfo:
2172 case s_http_userinfo_start:
2173 if (ch == '@') {
2174 return s_http_host_start;
2175 }
2176
2177 if (IS_USERINFO_CHAR(ch)) {
2178 return s_http_userinfo;
2179 }
2180 break;
2181
2182 case s_http_host_start:
2183 if (ch == '[') {
2184 return s_http_host_v6_start;
2185 }
2186
2187 if (IS_HOST_CHAR(ch)) {
2188 return s_http_host;
2189 }
2190
2191 break;
2192
2193 case s_http_host:
2194 if (IS_HOST_CHAR(ch)) {
2195 return s_http_host;
2196 }
2197
2198 /* FALLTHROUGH */
2199 case s_http_host_v6_end:
2200 if (ch == ':') {
2201 return s_http_host_port_start;
2202 }
2203
2204 break;
2205
2206 case s_http_host_v6:
2207 if (ch == ']') {
2208 return s_http_host_v6_end;
2209 }
2210
2211 /* FALLTHROUGH */
2212 case s_http_host_v6_start:
2213 if (IS_HEX(ch) || ch == ':' || ch == '.') {
2214 return s_http_host_v6;
2215 }
2216
2217 break;
2218
2219 case s_http_host_port:
2220 case s_http_host_port_start:
2221 if (IS_NUM(ch)) {
2222 return s_http_host_port;
2223 }
2224
2225 break;

Callers 1

http_parse_hostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected