From d768bf6e818c963a21b82003d1d7cc5351c0a01b Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Fri, 19 Oct 2007 22:36:28 +0000 Subject: Enable _DEBUG_HTTPERROR to avoid warning... --- opentracker.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/opentracker.c b/opentracker.c index 4ad42f0..051a67c 100644 --- a/opentracker.c +++ b/opentracker.c @@ -59,7 +59,6 @@ static char *accesslist_filename = NULL; static char static_inbuf[8192]; static char static_outbuf[8192]; -static char static_tmpbuf[8192]; #define OT_MAXMULTISCRAPE_COUNT 64 static ot_hash multiscrape_buf[OT_MAXMULTISCRAPE_COUNT]; @@ -227,7 +226,8 @@ static void httpresponse( const int64 s, char *data, size_t l ) { size_t reply_size = 0, reply_off; #ifdef _DEBUG_HTTPERROR - memcpy( debug_request, data, sizeof( debug_request ) ); + memcpy( debug_request, data, l ); + data[l] = 0; #endif /* This one implicitely tests strlen < 5, too -- remember, it is \n terminated */ @@ -376,15 +376,13 @@ LOG_TO_STDERR( "stats: %d.%d.%d.%d - mode: s24s old\n", h->ip[0], h->ip[1], h->i case 6: /* scrape ? */ if( byte_diff( data, 6, "scrape") ) HTTPERROR_404; - /* We want the pure plain un-unescaped text */ - memmove( static_tmpbuf, static_inbuf, 8192 ); - /* Full scrape... you might want to limit that */ if( !byte_diff( data, 12, "scrape HTTP/" ) ) { LOG_TO_STDERR( "[%08d] scrp: %d.%d.%d.%d - FULL SCRAPE\n", (unsigned int)(g_now - ot_start_time), h->ip[0], h->ip[1], h->ip[2], h->ip[3] ); -write( 2, static_tmpbuf, l ); - +#ifdef _DEBUG_HTTPERROR +write( 2, debug_request, l ); +#endif if( !( reply_size = return_fullscrape_for_tracker( &reply ) ) ) HTTPERROR_500; ot_overall_tcp_successfulannounces++; return sendmmapdata( s, reply, reply_size ); -- cgit v1.2.3