Browse Source

Add our own time stamps to the completed logs.

master
Dirk Engling 11 years ago
parent
commit
addc3f7bc0
  1. 12
      ot_stats.c
  2. 4
      trackerlogic.c

12
ot_stats.c

@ -642,9 +642,17 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event
case EVENT_COMPLETED:
#ifdef WANT_SYSLOGS
if( event_data) {
char timestring[64];
char hex_out[42];
struct tm time_now;
time_t ttt;
time( &ttt );
localtime_r( &ttt, &time_now );
strftime( timestring, sizeof( timestring ), "%FT%T%z", &time_now );
to_hex( hex_out, (uint8_t*)event_data );
syslog( LOG_INFO, "event=completed info_hash=%s", hex_out );
syslog( LOG_INFO, "time=%s event=completed info_hash=%s", timestring, hex_out );
}
#endif
ot_overall_completed++;
@ -738,4 +746,4 @@ void stats_deinit( ) {
#endif
}
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.60 $\n";
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.61 $\n";

4
trackerlogic.c

@ -165,7 +165,7 @@ size_t add_peer_to_torrent_and_return_peers( ot_hash hash, ot_peer *peer, PROTO_
torrent->peer_list->seed_count++;
if( !(OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) && (OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) ) {
torrent->peer_list->down_count++;
stats_issue_event( EVENT_COMPLETED, 0, 0 );
stats_issue_event( EVENT_COMPLETED, 0, (uintptr_t)torrent->hash );
}
if( OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED )
OT_PEERFLAG( peer ) |= PEER_FLAG_COMPLETED;
@ -457,4 +457,4 @@ void trackerlogic_deinit( void ) {
mutex_deinit( );
}
const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.135 $\n";
const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.136 $\n";
Loading…
Cancel
Save