diff options
Diffstat (limited to 'web/attachments/266466-check_http.extented_status_codes.patch')
| -rw-r--r-- | web/attachments/266466-check_http.extented_status_codes.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/web/attachments/266466-check_http.extented_status_codes.patch b/web/attachments/266466-check_http.extented_status_codes.patch new file mode 100644 index 0000000..47ff717 --- /dev/null +++ b/web/attachments/266466-check_http.extented_status_codes.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | 169c170,198 | ||
| 2 | < | ||
| 3 | --- | ||
| 4 | > | ||
| 5 | > /* checks if status code statcode is in server reply reply */ | ||
| 6 | > int | ||
| 7 | > check_statuscode (char * reply, char * statcode) | ||
| 8 | > { | ||
| 9 | > int status = 0; | ||
| 10 | > char scode[4] = "201"; | ||
| 11 | > int ipos = 0; | ||
| 12 | > char *kpos = strchr(statcode, ','); | ||
| 13 | > | ||
| 14 | > while (kpos) | ||
| 15 | > { | ||
| 16 | > memcpy(scode, &statcode[ipos], 3); | ||
| 17 | > ipos += 4; | ||
| 18 | > kpos = strchr(&statcode[ipos], ','); | ||
| 19 | > | ||
| 20 | > if (strstr(reply, scode)) | ||
| 21 | > { | ||
| 22 | > status = 1; | ||
| 23 | > } | ||
| 24 | > } | ||
| 25 | > | ||
| 26 | > memcpy(scode, &statcode[ipos], 3); | ||
| 27 | > if (strstr(reply, scode)) | ||
| 28 | > { | ||
| 29 | > status = 1; | ||
| 30 | > } | ||
| 31 | > return status; | ||
| 32 | > } | ||
| 33 | 871c913 | ||
| 34 | < if (!strstr (status_line, server_expect)) { | ||
| 35 | --- | ||
| 36 | > if (!check_statuscode(status_line, server_expect)) { | ||
| 37 | 874c916 | ||
| 38 | < _("Invalid HTTP response received from host\n")); | ||
| 39 | --- | ||
| 40 | > _("Invalid HTTP response received from host \"%s\"\n"), status_line); | ||
| 41 | 877,878c919,920 | ||
| 42 | < _("Invalid HTTP response received from host on port %d\n"), | ||
| 43 | < server_port); | ||
| 44 | --- | ||
| 45 | > _("Invalid HTTP response received from host on port %d \"%s\"\n"), | ||
| 46 | > server_port, status_line); | ||
