diff options
Diffstat (limited to 'web/attachments/113160-check_http.diff')
-rw-r--r-- | web/attachments/113160-check_http.diff | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/web/attachments/113160-check_http.diff b/web/attachments/113160-check_http.diff new file mode 100644 index 0000000..c2b1a45 --- /dev/null +++ b/web/attachments/113160-check_http.diff | |||
@@ -0,0 +1,65 @@ | |||
1 | --- check_http.c.old 2004-12-01 15:57:08.000000000 +0100 | ||
2 | +++ check_http.c 2004-12-06 11:56:11.000000000 +0100 | ||
3 | @@ -112,6 +112,7 @@ | ||
4 | char *http_method; | ||
5 | char *http_post_data; | ||
6 | char buffer[MAX_INPUT_BUFFER]; | ||
7 | +int do_soap = FALSE; | ||
8 | |||
9 | int process_arguments (int, char **); | ||
10 | static char *base64 (const char *bin, size_t len); | ||
11 | @@ -210,6 +211,7 @@ | ||
12 | {"min", required_argument, 0, 'm'}, | ||
13 | {"use-ipv4", no_argument, 0, '4'}, | ||
14 | {"use-ipv6", no_argument, 0, '6'}, | ||
15 | + {"soap", no_argument, 0, 'W'}, | ||
16 | {0, 0, 0, 0} | ||
17 | }; | ||
18 | |||
19 | @@ -230,7 +232,7 @@ | ||
20 | } | ||
21 | |||
22 | while (1) { | ||
23 | - c = getopt_long (argc, argv, "Vvh46t:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", longopts, &option); | ||
24 | + c = getopt_long (argc, argv, "Vvh46tW:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", longopts, &option); | ||
25 | if (c == -1 || c == EOF) | ||
26 | break; | ||
27 | |||
28 | @@ -384,6 +386,9 @@ | ||
29 | case 'm': /* min_page_length */ | ||
30 | min_page_len = atoi (optarg); | ||
31 | break; | ||
32 | + case 'W': /* use SOAP mode */ | ||
33 | + do_soap = TRUE; | ||
34 | + break; | ||
35 | } | ||
36 | } | ||
37 | |||
38 | @@ -519,9 +524,16 @@ | ||
39 | |||
40 | /* either send http POST data */ | ||
41 | if (http_post_data) { | ||
42 | - asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf); | ||
43 | - asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); | ||
44 | - asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); | ||
45 | + if (do_soap) { | ||
46 | + asprintf (&buf, "%sSOAPAction:\r\n", buf); | ||
47 | + asprintf (&buf, "%sContent-Type: text/xml; charset=utf-8\r\n", buf); | ||
48 | + asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); | ||
49 | + asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); | ||
50 | + } else { | ||
51 | + asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf); | ||
52 | + asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); | ||
53 | + asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); | ||
54 | + } | ||
55 | } | ||
56 | else { | ||
57 | /* or just a newline so the server knows we're done with the request */ | ||
58 | @@ -1214,6 +1226,6 @@ | ||
59 | [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ | ||
60 | [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\ | ||
61 | [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\ | ||
62 | - [-P string] [-m min_pg_size] [-4|-6]\n"), progname); | ||
63 | + [-P string] [-m min_pg_size] [-4|-6] [-W]\n"), progname); | ||
64 | printf (_(UT_HLP_VRS), progname, progname); | ||
65 | } | ||