diff options
| author | erdgeist <> | 2006-12-16 01:22:48 +0000 |
|---|---|---|
| committer | erdgeist <> | 2006-12-16 01:22:48 +0000 |
| commit | 6286c1cea533604c5c91cd245cf3cffb6e00943e (patch) | |
| tree | 0bc81e67c5f6e3ce1cbc082ee0de30aa88778633 | |
| parent | 808e37056660b9f2601559f8b7a70b7416519827 (diff) | |
Made answer http/1.1
| -rw-r--r-- | opentracker.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/opentracker.c b/opentracker.c index 53a2517..57d505a 100644 --- a/opentracker.c +++ b/opentracker.c | |||
| @@ -301,13 +301,10 @@ e404: | |||
| 301 | goto bailout; | 301 | goto bailout; |
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | c=h->hdrbuf=(char*)malloc(500); | 304 | c=h->hdrbuf=(char*)malloc(80); |
| 305 | c+=fmt_str(c,"HTTP/1.1 200 OK\r\nContent-Type: text/plain"); | 305 | c+=fmt_str(c,"HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: "); |
| 306 | c+=fmt_str(c,"\r\nContent-Length: "); | ||
| 307 | c+=fmt_ulonglong(c, reply_size ); | 306 | c+=fmt_ulonglong(c, reply_size ); |
| 308 | c+=fmt_str(c,"\r\nLast-Modified: "); | 307 | c+=fmt_str(c,"\r\n\r\n"); |
| 309 | c+=fmt_httpdate(c,time(0)); | ||
| 310 | c+=fmt_str(c,"\r\nConnection: close\r\n\r\n"); | ||
| 311 | iob_addbuf(&h->iob,h->hdrbuf,c - h->hdrbuf); | 308 | iob_addbuf(&h->iob,h->hdrbuf,c - h->hdrbuf); |
| 312 | if( reply && reply_size ) iob_addbuf_free(&h->iob,reply, reply_size ); | 309 | if( reply && reply_size ) iob_addbuf_free(&h->iob,reply, reply_size ); |
| 313 | 310 | ||
| @@ -331,7 +328,7 @@ int main() | |||
| 331 | uint16 port; | 328 | uint16 port; |
| 332 | 329 | ||
| 333 | ot_start_time = time( NULL ); | 330 | ot_start_time = time( NULL ); |
| 334 | if (socket_bind4_reuse(s,NULL,9090)==-1) | 331 | if (socket_bind4_reuse(s,NULL,6969)==-1) |
| 335 | panic("socket_bind4_reuse"); | 332 | panic("socket_bind4_reuse"); |
| 336 | 333 | ||
| 337 | if (socket_listen(s,16)==-1) | 334 | if (socket_listen(s,16)==-1) |
