| 484 | } |
| 485 | |
| 486 | string curl_status_code(const string& curl_options, int32_t port = FLAGS_webserver_port) { |
| 487 | string cmd = Substitute("curl -s -f -w \"%{http_code}\" $0 'http://127.0.0.1:$1'", |
| 488 | curl_options, port); |
| 489 | cout << cmd << endl; |
| 490 | string result = exec(cmd.c_str()); |
| 491 | if (result.size() > 3) { |
| 492 | // In some cases the stdout of curl can contain extra characters before the status |
| 493 | // code (see IMPALA-13702 for details). As http status codes are expected to be 3 |
| 494 | // digits it is always ok to return the last 3 characters. |
| 495 | result = result.substr(result.size() - 3, 3); |
| 496 | } |
| 497 | return result; |
| 498 | } |
| 499 | |
| 500 | class CookieJar { |
| 501 | public: |
no test coverage detected