--- check_http.c 2003-05-02 18:28:50.000000000 -0500 +++ check_http_orig.c 2003-02-22 01:22:02.000000000 -0600 @@ -41,7 +41,7 @@ certificate expiration times.\n" #define OPTIONS "\ -(-H | -I ) [-u ] [-p ] [-E header]\n\ +(-H | -I ) [-u ] [-p ]\n\ [-w ] [-c ] [-t ] [-L]\n\ [-a auth] [-f ] [-e ]\n\ [-s string] [-l] [-r | -R ]\n\ @@ -61,8 +61,6 @@ URL to GET or POST (default: /)\n\ -p, --port=INTEGER\n\ Port number (default: %d)\n\ - -E, --extra-header=HEADER\n\ - Extra HTTP header (name: value)\n\ -P, --post=STRING\n\ URL encoded http POST data\n\ -w, --warning=INTEGER\n\ @@ -222,7 +220,6 @@ int sd; char *http_method = "GET"; char *http_post_data = ""; -char *http_extra_headers = NULL; char buffer[MAX_INPUT_BUFFER]; void print_usage (void); @@ -305,7 +302,6 @@ {"nohtml", no_argument, 0, 'n'}, {"ssl", no_argument, 0, 'S'}, {"verbose", no_argument, 0, 'v'}, - {"extra-header", required_argument, 0, 'E'}, {"post", required_argument, 0, 'P'}, {"IP-address", required_argument, 0, 'I'}, {"string", required_argument, 0, 's'}, @@ -335,7 +331,7 @@ strcpy (argv[c], "-n"); } -#define OPTCHARS "Vvht:c:w:H:E:P:I:a:e:p:s:R:r:u:f:C:nlLS" +#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLS" while (1) { #ifdef HAVE_GETOPT_H @@ -434,17 +430,6 @@ strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1); user_auth[MAX_INPUT_BUFFER - 1] = 0; break; - case 'E': /* extra HTTP header as name: value */ - if (strstr (optarg, ": ") == NULL) - usage2 ("invalid HTTP header syntax: should be of the form 'name: value'", optarg); - if (http_extra_headers == NULL) { - asprintf (&http_extra_headers, "%s\r\n", optarg); - } else { - char *old_headers = http_extra_headers; - asprintf (&http_extra_headers, "%s%s\r\n", old_headers, optarg); - free (old_headers); - } - break; case 'P': /* HTTP POST data in URL encoded format */ asprintf (&http_method, "%s", "POST"); asprintf (&http_post_data, "%s", optarg); @@ -610,11 +595,6 @@ asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth); } - /* send extra headers if requested */ - if (http_extra_headers != NULL) { - asprintf (&buf, "%s%s", buf, http_extra_headers); - } - /* either send http POST data */ if (strlen (http_post_data)) { asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf);