| verzia 1.15, 2001/11/19 20:15:07 |
verzia 1.16, 2002/05/09 16:10:49 |
|
|
| /* |
/* |
| * Author: Lubomir Host 'rajo' <host8@kepler.fmph.uniba.sk> |
* Author: Lubomir Host 'rajo' <host8@kepler.fmph.uniba.sk> |
| * $Log$ |
* $Log$ |
| |
* Revision 1.16 2002/05/09 16:10:49 host8 |
| |
* * Test of cvs commit (loginfo.sh changed). |
| |
* * New implementation of HTTP protocol, doesn't work yet. |
| |
* |
| * Revision 1.15 2001/11/19 20:15:07 host8 |
* Revision 1.15 2001/11/19 20:15:07 host8 |
| * Http protocol probably works fine. |
* Http protocol probably works fine. |
| * |
* |
| Riadok 406 static char *get_http_referer(HTTP_REQUE |
|
| Riadok 410 static char *get_http_referer(HTTP_REQUE |
|
| count = get_size_requests(req); |
count = get_size_requests(req); |
| |
|
| if (count > 0) { |
if (count > 0) { |
| return (req[count -1]->host); |
return (req[count - 1]->referer); |
| } |
} |
| |
|
| return (NULL); |
return (NULL); |
| } |
} |
| // }}} |
// }}} |
| |
// static char * http_clean_referer(HTTP_REQUEST **req) {{{ |
| |
void http_clean_referer(HTTP_REQUEST **req) |
| |
{ |
| |
int i; |
| |
|
| |
for (i=0; req[i] != NULL; i++) { |
| |
if (req[i]->referer != NULL) |
| |
free(req[i]->referer); |
| |
} |
| |
return ; |
| |
} |
| |
// }}} |
| // static http_connect(HTTP_REQUEST *r) {{{ |
// static http_connect(HTTP_REQUEST *r) {{{ |
| static FILE *http_connect(HTTP_REQUEST *r) |
static FILE *http_connect(HTTP_REQUEST *r) |
| { |
{ |
| Riadok 612 static void http_read_source(HTTP_REQUES |
|
| Riadok 628 static void http_read_source(HTTP_REQUES |
|
| info=0; |
info=0; |
| if (strstr(buf, "HTTP/1.") != NULL) { |
if (strstr(buf, "HTTP/1.") != NULL) { |
| if ((buf+8) == strstr(buf, " 200 OK")) { |
if ((buf+8) == strstr(buf, " 200 OK")) { |
| |
// TODO: test this: |
| |
r->referer = strdup(r->host); |
| //http_set_referer(host, file); |
//http_set_referer(host, file); |
| } |
} |
| if ((buf+8) == strstr(buf, " 302 Object moved")) { |
if ((buf+8) == strstr(buf, " 302 Object moved")) { |