Debugging for failed requests.

dynamic-accesslists
erdgeist 18 years ago
parent 00843757c0
commit 2d0215d793

@ -1,5 +1,5 @@
CC?=gcc CC?=gcc
FEATURES=#-D_DEBUG_FDS -DWANT_IP_FROM_QUERY_STRING -DWANT_BLACKLIST -DWANT_CLOSED_TRACKER FEATURES=#-DWANT_IP_FROM_QUERY_STRING -DWANT_BLACKLIST -DWANT_CLOSED_TRACKER -D_DEBUG_HTTPERROR
#DEBUG_OPTS=-g -ggdb -pg # -fprofile-arcs -ftest-coverage #DEBUG_OPTS=-g -ggdb -pg # -fprofile-arcs -ftest-coverage
DEBUG_OPTS=-s -Os DEBUG_OPTS=-s -Os
CFLAGS+=-I../libowfat -Wall -pipe # -pedantic -ansi CFLAGS+=-I../libowfat -Wall -pipe # -pedantic -ansi

@ -134,6 +134,9 @@ void senddata(int64 s, struct http_data* h, char *buffer, size_t size ) {
void httperror(int64 s,struct http_data* h,const char* title,const char* message) { void httperror(int64 s,struct http_data* h,const char* title,const char* message) {
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", 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",
title, strlen(message)+strlen(title)+16-4,title+4); title, strlen(message)+strlen(title)+16-4,title+4);
#ifdef _DEBUG_HTTPERROR
fprintf( stderr, "DEBUG: invalid request was: %s\n", (char*)array_start( &h->r ) );
#endif
senddata(s,h,static_scratch,reply_size); senddata(s,h,static_scratch,reply_size);
} }

Loading…
Cancel
Save