summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorerdgeist <>2007-09-26 16:49:13 +0000
committererdgeist <>2007-09-26 16:49:13 +0000
commitc350fa0b3c323979f73d079d389219e7f98edc1b (patch)
tree61bb2ce1140874c5d5db98c26a043d836ae5d5ea /opentracker.c
parentc4f924810ee0aa390ccbcf306149512646875757 (diff)
New stats for s24s code, this is debug, do not use in real world
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/opentracker.c b/opentracker.c
index 646184c..02aeb4a 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -281,6 +281,8 @@ static void httpresponse( const int64 s, char *data ) {
281 mode = STATS_UDP; 281 mode = STATS_UDP;
282 else if( !byte_diff(data,4,"s24s")) 282 else if( !byte_diff(data,4,"s24s"))
283 mode = STATS_SLASH24S; 283 mode = STATS_SLASH24S;
284 else if( !byte_diff(data,4,"s24S"))
285 mode = STATS_SLASH24S_OLD;
284 else 286 else
285 HTTPERROR_400_PARAM; 287 HTTPERROR_400_PARAM;
286 } 288 }
@@ -312,8 +314,21 @@ static void httpresponse( const int64 s, char *data ) {
312 if( !( reply_size = return_stats_for_tracker( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, mode ) ) ) HTTPERROR_500; 314 if( !( reply_size = return_stats_for_tracker( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, mode ) ) ) HTTPERROR_500;
313 break; 315 break;
314 case STATS_SLASH24S: 316 case STATS_SLASH24S:
315 if( !( reply_size = return_stats_for_slash24s( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, 25, 64 ) ) ) HTTPERROR_500; 317{
318 ot_dword diff; struct timeval tv1, tv2; gettimeofday( &tv1, NULL );
319 if( !( reply_size = return_stats_for_slash24s( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, 25, 16 ) ) ) HTTPERROR_500;
320 gettimeofday( &tv2, NULL ); diff = ( tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec;
321 reply_size += sprintf( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf + reply_size, "Time taken: %ld\n", diff );
316 break; 322 break;
323}
324 case STATS_SLASH24S_OLD:
325{
326 ot_dword diff; struct timeval tv1, tv2; gettimeofday( &tv1, NULL );
327 if( !( reply_size = return_stats_for_slash24s_old( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, 25, 16 ) ) ) HTTPERROR_500;
328 gettimeofday( &tv2, NULL ); diff = ( tv2.tv_sec - tv1.tv_sec ) * 1000000 + tv2.tv_usec - tv1.tv_usec;
329 reply_size += sprintf( SUCCESS_HTTP_HEADER_LENGTH + static_outbuf + reply_size, "Time taken: %ld\n", diff );
330 break;
331}
317 } 332 }
318 break; 333 break;
319 334