summaryrefslogtreecommitdiffstats
path: root/web/attachments/266466-check_http.extented_status_codes.patch
blob: 47ff717f3cb8d55ab31ac99433c7ad81d7b47e7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
169c170,198
< 
---
>  
> /* checks if status code statcode is in server reply reply */
>  int
>  check_statuscode (char * reply, char * statcode)
>   {
>         int status = 0;
>         char scode[4] = "201";
>         int ipos = 0;
>         char *kpos = strchr(statcode, ',');
>  
>         while (kpos)
>         {
>                 memcpy(scode, &statcode[ipos], 3);
>                 ipos += 4;
>                 kpos = strchr(&statcode[ipos], ',');
>  
>                 if (strstr(reply, scode))
>                 {
>                         status = 1;
>                 }
>         }
>  
>         memcpy(scode, &statcode[ipos], 3);
>         if (strstr(reply, scode))
>         {
>                 status = 1;
>         }
>         return status;
> }
871c913
<   if (!strstr (status_line, server_expect)) {
---
>   if (!check_statuscode(status_line, server_expect)) {
874c916
<                 _("Invalid HTTP response received from host\n"));
---
>                 _("Invalid HTTP response received from host \"%s\"\n"), status_line);
877,878c919,920
<                 _("Invalid HTTP response received from host on port %d\n"),
<                 server_port);
---
>                 _("Invalid HTTP response received from host on port %d \"%s\"\n"),
>                 server_port, status_line);