MCPcopy Create free account
hub / github.com/apache/impala / curl_status_code

Function curl_status_code

be/src/util/webserver-test.cc:486–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486string 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
500class CookieJar {
501public:

Callers 1

TESTFunction · 0.85

Calls 4

SubstituteFunction · 0.85
execFunction · 0.85
substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected