/[monit]/monit/protocols/http.c
ViewVC logotype

Diff of /monit/protocols/http.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by hauk, Thu Jul 24 00:35:25 2003 UTC revision 1.19 by hauk, Tue Jul 29 23:41:13 2003 UTC
# Line 78  int check_http(Socket_T s) { Line 78  int check_http(Socket_T s) {
78    char msg[STRLEN];    char msg[STRLEN];
79    char host[STRLEN];    char host[STRLEN];
80    char proto[STRLEN];    char proto[STRLEN];
81      char *request= NULL;
   ASSERT(s);  
82        
83    if(socket_print(s, "GET / HTTP/1.1\r\n"    ASSERT(s);
84    
85      if(socket_get_Port(s)) {
86        request= ((Port_T)(socket_get_Port(s)))->request;
87        request= request?request:"/";
88      }
89        
90      if(socket_print(s, "GET %s HTTP/1.1\r\n"
91                    "Host: %s\r\n"                    "Host: %s\r\n"
92                    "Accept: */*\r\n"                    "Accept: */*\r\n"
93                    "User-Agent: %s/%s\r\n"                    "User-Agent: %s/%s\r\n"
94                    "Connection: close\r\n\r\n",                    "Connection: close\r\n\r\n",
95                    get_host_header(s, host), prog, VERSION) < 0) {                    request, get_host_header(s, host), prog, VERSION) < 0) {
96      log("HTTP: error sending data -- %s\n", STRERROR);      log("HTTP: error sending data -- %s\n", STRERROR);
97      return FALSE;      return FALSE;
98    }    }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26