diff options
-rw-r--r-- | ot_stats.c | 10 | ||||
-rw-r--r-- | trackerlogic.c | 2 |
2 files changed, 10 insertions, 2 deletions
@@ -642,9 +642,17 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event | |||
642 | case EVENT_COMPLETED: | 642 | case EVENT_COMPLETED: |
643 | #ifdef WANT_SYSLOGS | 643 | #ifdef WANT_SYSLOGS |
644 | if( event_data) { | 644 | if( event_data) { |
645 | char timestring[64]; | ||
645 | char hex_out[42]; | 646 | char hex_out[42]; |
647 | struct tm time_now; | ||
648 | time_t ttt; | ||
649 | |||
650 | time( &ttt ); | ||
651 | localtime_r( &ttt, &time_now ); | ||
652 | strftime( timestring, sizeof( timestring ), "%FT%T%z", &time_now ); | ||
653 | |||
646 | to_hex( hex_out, (uint8_t*)event_data ); | 654 | to_hex( hex_out, (uint8_t*)event_data ); |
647 | syslog( LOG_INFO, "event=completed info_hash=%s", hex_out ); | 655 | syslog( LOG_INFO, "time=%s event=completed info_hash=%s", timestring, hex_out ); |
648 | } | 656 | } |
649 | #endif | 657 | #endif |
650 | ot_overall_completed++; | 658 | ot_overall_completed++; |
diff --git a/trackerlogic.c b/trackerlogic.c index f70dd94..5348927 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -165,7 +165,7 @@ size_t add_peer_to_torrent_and_return_peers( ot_hash hash, ot_peer *peer, PROTO_ | |||
165 | torrent->peer_list->seed_count++; | 165 | torrent->peer_list->seed_count++; |
166 | if( !(OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) && (OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) ) { | 166 | if( !(OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) && (OT_PEERFLAG(peer) & PEER_FLAG_COMPLETED ) ) { |
167 | torrent->peer_list->down_count++; | 167 | torrent->peer_list->down_count++; |
168 | stats_issue_event( EVENT_COMPLETED, 0, 0 ); | 168 | stats_issue_event( EVENT_COMPLETED, 0, (uintptr_t)torrent->hash ); |
169 | } | 169 | } |
170 | if( OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) | 170 | if( OT_PEERFLAG(peer_dest) & PEER_FLAG_COMPLETED ) |
171 | OT_PEERFLAG( peer ) |= PEER_FLAG_COMPLETED; | 171 | OT_PEERFLAG( peer ) |= PEER_FLAG_COMPLETED; |