Browse Source

Display v4 addresses in v4 mode nicer

master
Dirk Engling 13 years ago
parent
commit
43e07caf4e
  1. 6
      opentracker.c
  2. 4
      ot_accesslist.c
  3. 6
      ot_stats.c

6
opentracker.c

@ -2,7 +2,7 @@
It is considered beerware. Prost. Skol. Cheers or whatever.
Some of the stuff below is stolen from Fefes example libowfat httpd.
$Id: opentracker.c,v 1.220 2009/03/18 14:49:13 erdgeist Exp $ */
$Id: opentracker.c,v 1.221 2009/06/16 12:17:53 erdgeist Exp $ */
/* System */
#include <stdlib.h>
@ -257,7 +257,7 @@ static int64_t ot_try_bind( ot_ip6 ip, uint16_t port, PROTO_FLAG proto ) {
char *protos[] = {"TCP","UDP","UDP mcast"};
char _debug[512];
int off = snprintf( _debug, sizeof(_debug), "Binding socket type %s to address [", protos[proto] );
off += fmt_ip6( _debug+off, ip);
off += fmt_ip6c( _debug+off, ip);
snprintf( _debug + off, sizeof(_debug)-off, "]:%d...", port);
fputs( _debug, stderr );
#endif
@ -564,4 +564,4 @@ while( scanon ) {
return 0;
}
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.220 $\n";
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.221 $\n";

4
ot_accesslist.c

@ -119,7 +119,7 @@ int accesslist_blessip( ot_ip6 ip, ot_permissions permissions ) {
{
char _debug[512];
int off = snprintf( _debug, sizeof(_debug), "Blessing ip address " );
off += fmt_ip6(_debug+off, ip );
off += fmt_ip6c(_debug+off, ip );
if( permissions & OT_PERMISSION_MAY_STAT ) off += snprintf( _debug+off, 512-off, " may_fetch_stats" );
if( permissions & OT_PERMISSION_MAY_LIVESYNC ) off += snprintf( _debug+off, 512-off, " may_sync_live" );
@ -142,4 +142,4 @@ int accesslist_isblessed( ot_ip6 ip, ot_permissions permissions ) {
return 0;
}
const char *g_version_accesslist_c = "$Source: /home/cvsroot/opentracker/ot_accesslist.c,v $: $Revision: 1.16 $\n";
const char *g_version_accesslist_c = "$Source: /home/cvsroot/opentracker/ot_accesslist.c,v $: $Revision: 1.17 $\n";

6
ot_stats.c

@ -603,7 +603,7 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event
ot_ip6 *ip = (ot_ip6*)event_data; /* ugly hack to transfer ip to stats */
char _debug[512];
int off = snprintf( _debug, sizeof(_debug), "[%08d] scrp: ", (unsigned int)(g_now_seconds - ot_start_time)/60 );
off += fmt_ip6( _debug+off, *ip );
off += fmt_ip6c( _debug+off, *ip );
off += snprintf( _debug+off, sizeof(_debug)-off, " - FULL SCRAPE\n" );
write( 2, _debug, off );
ot_full_scrape_request_count++;
@ -614,7 +614,7 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event
ot_ip6 *ip = (ot_ip6*)event_data; /* ugly hack to transfer ip to stats */
char _debug[512];
int off = snprintf( _debug, sizeof(_debug), "[%08d] scrp: ", (unsigned int)(g_now_seconds - ot_start_time)/60 );
off += fmt_ip6(_debug+off, *ip );
off += fmt_ip6c(_debug+off, *ip );
off += snprintf( _debug+off, sizeof(_debug)-off, " - FULL SCRAPE\n" );
write( 2, _debug, off );
ot_full_scrape_request_count++;
@ -667,4 +667,4 @@ void stats_deinit( ) {
pthread_cancel( thread_id );
}
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.49 $\n";
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.50 $\n";

Loading…
Cancel
Save