MCPcopy Create free account
hub / github.com/apache/cloudberry / http_parse_host_char

Function http_parse_host_char

gpcontrib/gpcloud/lib/http_parser.cpp:2205–2285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2203}
2204
2205static enum http_host_state
2206http_parse_host_char(enum http_host_state s, const char ch) {
2207 switch(s) {
2208 case s_http_userinfo:
2209 case s_http_userinfo_start:
2210 if (ch == '@') {
2211 return s_http_host_start;
2212 }
2213
2214 if (IS_USERINFO_CHAR(ch)) {
2215 return s_http_userinfo;
2216 }
2217 break;
2218
2219 case s_http_host_start:
2220 if (ch == '[') {
2221 return s_http_host_v6_start;
2222 }
2223
2224 if (IS_HOST_CHAR(ch)) {
2225 return s_http_host;
2226 }
2227
2228 break;
2229
2230 case s_http_host:
2231 if (IS_HOST_CHAR(ch)) {
2232 return s_http_host;
2233 }
2234
2235 /* FALLTHROUGH */
2236 case s_http_host_v6_end:
2237 if (ch == ':') {
2238 return s_http_host_port_start;
2239 }
2240
2241 break;
2242
2243 case s_http_host_v6:
2244 if (ch == ']') {
2245 return s_http_host_v6_end;
2246 }
2247
2248 /* FALLTHROUGH */
2249 case s_http_host_v6_start:
2250 if (IS_HEX(ch) || ch == ':' || ch == '.') {
2251 return s_http_host_v6;
2252 }
2253
2254 if (s == s_http_host_v6 && ch == '%') {
2255 return s_http_host_v6_zone_start;
2256 }
2257 break;
2258
2259 case s_http_host_v6_zone:
2260 if (ch == ']') {
2261 return s_http_host_v6_end;
2262 }

Callers 1

http_parse_hostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected