diff options
author | erdgeist <> | 2007-01-24 12:56:15 +0000 |
---|---|---|
committer | erdgeist <> | 2007-01-24 12:56:15 +0000 |
commit | 2d0215d79307deeaecff5494da115adafde5bccc (patch) | |
tree | bc130f37e5d84d3892bc7cd9566eab10322c96f3 | |
parent | 00843757c0a3ec3d3f678096289530c610091772 (diff) |
Debugging for failed requests.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | opentracker.c | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | CC?=gcc | 1 | CC?=gcc |
2 | FEATURES=#-D_DEBUG_FDS -DWANT_IP_FROM_QUERY_STRING -DWANT_BLACKLIST -DWANT_CLOSED_TRACKER | 2 | FEATURES=#-DWANT_IP_FROM_QUERY_STRING -DWANT_BLACKLIST -DWANT_CLOSED_TRACKER -D_DEBUG_HTTPERROR |
3 | #DEBUG_OPTS=-g -ggdb -pg # -fprofile-arcs -ftest-coverage | 3 | #DEBUG_OPTS=-g -ggdb -pg # -fprofile-arcs -ftest-coverage |
4 | DEBUG_OPTS=-s -Os | 4 | DEBUG_OPTS=-s -Os |
5 | CFLAGS+=-I../libowfat -Wall -pipe # -pedantic -ansi | 5 | CFLAGS+=-I../libowfat -Wall -pipe # -pedantic -ansi |
diff --git a/opentracker.c b/opentracker.c index e57cc84..2299844 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -134,6 +134,9 @@ void senddata(int64 s, struct http_data* h, char *buffer, size_t size ) { | |||
134 | void httperror(int64 s,struct http_data* h,const char* title,const char* message) { | 134 | void httperror(int64 s,struct http_data* h,const char* title,const char* message) { |
135 | size_t reply_size = sprintf( static_scratch, "HTTP/1.0 %s\r\nContent-Type: text/html\r\nConnection: close\r\nContent-Length: %zd\r\n\r\n<title>%s</title>\n", | 135 | size_t reply_size = sprintf( static_scratch, "HTTP/1.0 %s\r\nContent-Type: text/html\r\nConnection: close\r\nContent-Length: %zd\r\n\r\n<title>%s</title>\n", |
136 | title, strlen(message)+strlen(title)+16-4,title+4); | 136 | title, strlen(message)+strlen(title)+16-4,title+4); |
137 | #ifdef _DEBUG_HTTPERROR | ||
138 | fprintf( stderr, "DEBUG: invalid request was: %s\n", (char*)array_start( &h->r ) ); | ||
139 | #endif | ||
137 | senddata(s,h,static_scratch,reply_size); | 140 | senddata(s,h,static_scratch,reply_size); |
138 | } | 141 | } |
139 | 142 | ||