259 |
|
|
260 |
int n; |
int n; |
261 |
char buf[STRLEN]; |
char buf[STRLEN]; |
|
char req[2*STRLEN]; |
|
262 |
char *auth= get_basic_authentication_header(); |
char *auth= get_basic_authentication_header(); |
263 |
|
|
264 |
snprintf(req, 2*STRLEN, |
socket_print(sock, "GET /%s?action=status HTTP/1.0\r\n%s\r\n", |
265 |
"GET /%s?action=status HTTP/1.0\r\n%s\r\n", s->name, auth); |
s->name, auth); |
|
|
|
266 |
free(auth); |
free(auth); |
267 |
|
|
|
socket_write(sock, req, sizeof(req)); |
|
|
|
|
268 |
if(0>(n= socket_read(sock, buf, STRLEN))) { |
if(0>(n= socket_read(sock, buf, STRLEN))) { |
269 |
|
|
270 |
local_status(s); |
local_status(s); |
271 |
socket_close(&sock); |
socket_free(&sock); |
272 |
|
|
273 |
return TRUE; |
return TRUE; |
274 |
|
|
275 |
} |
} |
276 |
|
|
277 |
socket_close(&sock); |
socket_free(&sock); |
278 |
|
|
279 |
|
|
280 |
/* If everything has gone well the returned string starts with |
/* If everything has gone well the returned string starts with |