| 465 | } |
| 466 | |
| 467 | int main(int argc, char* argv[]) |
| 468 | { |
| 469 | acl::sslbase_conf* ssl_conf = NULL; |
| 470 | int ch, conn_timeout = 5, rw_timeout = 5; |
| 471 | std::vector<acl::string> name_servers; |
| 472 | acl::string addr("127.0.0.1:80"); |
| 473 | acl::string host("www.baidu.com"), url("/"), ssl_path; |
| 474 | bool enable_gzip = false, keep_alive = false, debug = false; |
| 475 | bool ws_enable = false, enable_unzip = false; |
| 476 | |
| 477 | while ((ch = getopt(argc, argv, "hs:S:N:H:L:t:i:ZUKDW")) > 0) { |
| 478 | switch (ch) { |
| 479 | case 'h': |
| 480 | usage(argv[0]); |
| 481 | return (0); |
| 482 | case 's': |
| 483 | addr = optarg; |
| 484 | break; |
| 485 | case 'S': |
| 486 | ssl_path = optarg; |
| 487 | break; |
| 488 | case 'L': |
| 489 | url = optarg; |
| 490 | break; |
| 491 | case 'N': |
| 492 | add_dns(name_servers, optarg); |
| 493 | break; |
| 494 | case 'H': |
| 495 | host = optarg; |
| 496 | break; |
| 497 | case 't': |
| 498 | conn_timeout = atoi(optarg); |
| 499 | break; |
| 500 | case 'i': |
| 501 | rw_timeout = atoi(optarg); |
| 502 | break; |
| 503 | case 'Z': |
| 504 | enable_gzip = true; |
| 505 | break; |
| 506 | case 'U': |
| 507 | enable_unzip = true; |
| 508 | break; |
| 509 | case 'K': |
| 510 | keep_alive = true; |
| 511 | break; |
| 512 | case 'D': |
| 513 | debug = true; |
| 514 | break; |
| 515 | case 'W': |
| 516 | ws_enable = true; |
| 517 | break; |
| 518 | default: |
| 519 | break; |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | if (name_servers.empty()) { |
| 524 | name_servers.push_back("8.8.8.8:53"); |
nothing calls this directly
no test coverage detected
searching dependent graphs…