| 1095 | } |
| 1096 | |
| 1097 | static int get_curl_http_version_opt(const char *version_string, long *opt) |
| 1098 | { |
| 1099 | int i; |
| 1100 | static struct { |
| 1101 | const char *name; |
| 1102 | long opt_token; |
| 1103 | } choice[] = { |
| 1104 | { "HTTP/1.1", CURL_HTTP_VERSION_1_1 }, |
| 1105 | { "HTTP/2", CURL_HTTP_VERSION_2 } |
| 1106 | }; |
| 1107 | |
| 1108 | for (i = 0; i < ARRAY_SIZE(choice); i++) { |
| 1109 | if (!strcmp(version_string, choice[i].name)) { |
| 1110 | *opt = choice[i].opt_token; |
| 1111 | return 0; |
| 1112 | } |
| 1113 | } |
| 1114 | |
| 1115 | warning("unknown value given to http.version: '%s'", version_string); |
| 1116 | return -1; /* not found */ |
| 1117 | } |
| 1118 | |
| 1119 | static CURL *get_curl_handle(void) |
| 1120 | { |
no test coverage detected