Bläddra i källkod

sync with git

master
Dirk Engling 2 år sedan
förälder
incheckning
e52170435f
31 ändrade filer med 64 tillägg och 52 borttagningar
  1. +1
    -1
      Makefile
  2. +5
    -2
      opentracker.c
  3. +1
    -1
      ot_accesslist.c
  4. +2
    -2
      ot_accesslist.h
  5. +1
    -1
      ot_clean.c
  6. +2
    -2
      ot_clean.h
  7. +5
    -1
      ot_fullscrape.c
  8. +2
    -2
      ot_fullscrape.h
  9. +3
    -3
      ot_http.c
  10. +2
    -2
      ot_http.h
  11. +1
    -1
      ot_iovec.c
  12. +2
    -2
      ot_iovec.h
  13. +1
    -1
      ot_livesync.c
  14. +2
    -2
      ot_livesync.h
  15. +1
    -1
      ot_mutex.c
  16. +5
    -4
      ot_mutex.h
  17. +1
    -1
      ot_rijndael.c
  18. +4
    -2
      ot_rijndael.h
  19. +1
    -1
      ot_stats.c
  20. +5
    -2
      ot_stats.h
  21. +1
    -1
      ot_sync.c
  22. +2
    -2
      ot_sync.h
  23. +1
    -1
      ot_udp.c
  24. +2
    -2
      ot_udp.h
  25. +1
    -1
      ot_vector.c
  26. +2
    -2
      ot_vector.h
  27. +2
    -3
      proxy.c
  28. +1
    -1
      scan_urlencoded_query.c
  29. +2
    -2
      scan_urlencoded_query.h
  30. +1
    -1
      trackerlogic.c
  31. +2
    -2
      trackerlogic.h

+ 1
- 1
Makefile Visa fil

@@ -1,4 +1,4 @@
# $Id: Makefile,v 1.73 2012/06/08 19:21:46 erdgeist Exp $
# $Id: Makefile,v 1.74 2018/01/29 17:45:20 erdgeist Exp $

CC?=gcc



+ 5
- 2
opentracker.c Visa fil

@@ -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.239 2014/10/06 22:32:28 git Exp $ */
$Id: opentracker.c,v 1.240 2018/01/29 17:43:33 erdgeist Exp $ */

/* System */
#include <stdlib.h>
@@ -48,6 +48,7 @@ static char * g_serverdir;
static char * g_serveruser;
static unsigned int g_udp_workers;

static void panic( const char *routing ) __attribute__ ((noreturn));
static void panic( const char *routine ) {
fprintf( stderr, "%s: %s\n", routine, strerror(errno) );
exit( 111 );
@@ -639,6 +640,8 @@ int main( int argc, char **argv ) {
panic( "selfpipe failed: " );
if( !io_fd( g_self_pipe[0] ) )
panic( "selfpipe io_fd failed: " );
if( !io_fd( g_self_pipe[1] ) )
panic( "selfpipe io_fd failed: " );
io_setcookie( g_self_pipe[0], (void*)FLAG_SELFPIPE );
io_wantread( g_self_pipe[0] );

@@ -662,4 +665,4 @@ int main( int argc, char **argv ) {
return 0;
}

const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.239 $\n";
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.240 $\n";

+ 1
- 1
ot_accesslist.c Visa fil

@@ -310,4 +310,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.31 $\n";
const char *g_version_accesslist_c = "$Source: /home/cvsroot/opentracker/ot_accesslist.c,v $: $Revision: 1.32 $\n";

+ 2
- 2
ot_accesslist.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_ACCESSLIST_H__
#define __OT_ACCESSLIST_H__
#ifndef OT_ACCESSLIST_H__
#define OT_ACCESSLIST_H__

#if defined ( WANT_ACCESSLIST_BLACK ) && defined (WANT_ACCESSLIST_WHITE )
# error WANT_ACCESSLIST_BLACK and WANT_ACCESSLIST_WHITE are exclusive.


+ 1
- 1
ot_clean.c Visa fil

@@ -136,4 +136,4 @@ void clean_deinit( void ) {
pthread_cancel( thread_id );
}

const char *g_version_clean_c = "$Source: /home/cvsroot/opentracker/ot_clean.c,v $: $Revision: 1.21 $\n";
const char *g_version_clean_c = "$Source: /home/cvsroot/opentracker/ot_clean.c,v $: $Revision: 1.22 $\n";

+ 2
- 2
ot_clean.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_CLEAN_H__
#define __OT_CLEAN_H__
#ifndef OT_CLEAN_H__
#define OT_CLEAN_H__

/* The amount of time a clean cycle should take */
#define OT_CLEAN_INTERVAL_MINUTES 2


+ 5
- 1
ot_fullscrape.c Visa fil

@@ -175,6 +175,10 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
to_hex( r, *hash ); r+= 2 * sizeof(ot_hash);
r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count );
break;
case TASK_FULLSCRAPE_TPB_ASCII_PLUS:
to_hex( r, *hash ); r+= 2 * sizeof(ot_hash);
r += sprintf( r, ":%zd:%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count, peer_list->down_count );
break;
case TASK_FULLSCRAPE_TPB_BINARY:
memcpy( r, *hash, sizeof(ot_hash) ); r += sizeof(ot_hash);
*(uint32_t*)(r+0) = htonl( (uint32_t) peer_list->seed_count );
@@ -242,4 +246,4 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
}
#endif

const char *g_version_fullscrape_c = "$Source: /home/cvsroot/opentracker/ot_fullscrape.c,v $: $Revision: 1.36 $\n";
const char *g_version_fullscrape_c = "$Source: /home/cvsroot/opentracker/ot_fullscrape.c,v $: $Revision: 1.37 $\n";

+ 2
- 2
ot_fullscrape.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_FULLSCRAPE_H__
#define __OT_FULLSCRAPE_H__
#ifndef OT_FULLSCRAPE_H__
#define OT_FULLSCRAPE_H__

#ifdef WANT_FULLSCRAPE



+ 3
- 3
ot_http.c Visa fil

@@ -184,7 +184,7 @@ static const ot_keywords keywords_mode[] =
{ NULL, -3 } };
static const ot_keywords keywords_format[] =
{ { "bin", TASK_FULLSCRAPE_TPB_BINARY }, { "ben", TASK_FULLSCRAPE }, { "url", TASK_FULLSCRAPE_TPB_URLENCODED },
{ "txt", TASK_FULLSCRAPE_TPB_ASCII }, { NULL, -3 } };
{ "txt", TASK_FULLSCRAPE_TPB_ASCII }, { "txtp", TASK_FULLSCRAPE_TPB_ASCII_PLUS }, { NULL, -3 } };

int mode = TASK_STATS_PEERS, scanon = 1, format = 0;

@@ -497,8 +497,8 @@ static ssize_t http_handle_announce( const int64 sock, struct ot_workstruct *ws,
return ws->reply_size = sprintf( ws->reply, "Successfully added.\n" );
//}
}
#endif
break;
#endif
case 9: /* matched "peer_id" */
/* ignore this, when we have less than 20 bytes */
if( scan_urlencoded_query( &read_ptr, write_ptr = read_ptr, SCAN_SEARCHPATH_VALUE ) != 20 ) HTTPERROR_400_PARAM;
@@ -632,4 +632,4 @@ ssize_t http_handle_request( const int64 sock, struct ot_workstruct *ws ) {
return ws->reply_size;
}

const char *g_version_http_c = "$Source: /home/cvsroot/opentracker/ot_http.c,v $: $Revision: 1.55 $\n";
const char *g_version_http_c = "$Source: /home/cvsroot/opentracker/ot_http.c,v $: $Revision: 1.56 $\n";

+ 2
- 2
ot_http.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_HTTP_H__
#define __OT_HTTP_H__
#ifndef OT_HTTP_H__
#define OT_HTTP_H__

typedef enum {
STRUCT_HTTP_FLAG_WAITINGFORTASK = 1,


+ 1
- 1
ot_iovec.c Visa fil

@@ -73,4 +73,4 @@ size_t iovec_length( int *iovec_entries, struct iovec **iovector ) {
return length;
}

const char *g_version_iovec_c = "$Source: /home/cvsroot/opentracker/ot_iovec.c,v $: $Revision: 1.6 $\n";
const char *g_version_iovec_c = "$Source: /home/cvsroot/opentracker/ot_iovec.c,v $: $Revision: 1.7 $\n";

+ 2
- 2
ot_iovec.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_IOVEC_H__
#define __OT_IOVEC_H__
#ifndef OT_IOVEC_H__
#define OT_IOVEC_H__

#include <sys/uio.h>



+ 1
- 1
ot_livesync.c Visa fil

@@ -213,4 +213,4 @@ static void * livesync_worker( void * args ) {
}

#endif
const char *g_version_livesync_c = "$Source: /home/cvsroot/opentracker/ot_livesync.c,v $: $Revision: 1.19 $\n";
const char *g_version_livesync_c = "$Source: /home/cvsroot/opentracker/ot_livesync.c,v $: $Revision: 1.20 $\n";

+ 2
- 2
ot_livesync.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_LIVESYNC_H__
#define __OT_LIVESYNC_H__
#ifndef OT_LIVESYNC_H__
#define OT_LIVESYNC_H__

#include "io.h"
#include "trackerlogic.h"


+ 1
- 1
ot_mutex.c Visa fil

@@ -333,4 +333,4 @@ void mutex_deinit( ) {
byte_zero( all_torrents, sizeof( all_torrents ) );
}

const char *g_version_mutex_c = "$Source: /home/cvsroot/opentracker/ot_mutex.c,v $: $Revision: 1.23 $\n";
const char *g_version_mutex_c = "$Source: /home/cvsroot/opentracker/ot_mutex.c,v $: $Revision: 1.24 $\n";

+ 5
- 4
ot_mutex.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_MUTEX_H__
#define __OT_MUTEX_H__
#ifndef OT_MUTEX_H__
#define OT_MUTEX_H__

#include <sys/uio.h>

@@ -47,8 +47,9 @@ typedef enum {
TASK_FULLSCRAPE = 0x0200, /* Default mode */
TASK_FULLSCRAPE_TPB_BINARY = 0x0201,
TASK_FULLSCRAPE_TPB_ASCII = 0x0202,
TASK_FULLSCRAPE_TPB_URLENCODED = 0x0203,
TASK_FULLSCRAPE_TRACKERSTATE = 0x0204,
TASK_FULLSCRAPE_TPB_ASCII_PLUS = 0x0203,
TASK_FULLSCRAPE_TPB_URLENCODED = 0x0204,
TASK_FULLSCRAPE_TRACKERSTATE = 0x0205,

TASK_DMEM = 0x0300,



+ 1
- 1
ot_rijndael.c Visa fil

@@ -487,4 +487,4 @@ void rijndaelEncrypt128(const uint32_t rk[44], const uint8_t pt[16], uint8_t ct[
PUTU32(ct + 12, s3);
}

const char *g_version_rijndael_c = "$Source: /home/cvsroot/opentracker/ot_rijndael.c,v $: $Revision: 1.2 $\n";
const char *g_version_rijndael_c = "$Source: /home/cvsroot/opentracker/ot_rijndael.c,v $: $Revision: 1.3 $\n";

+ 4
- 2
ot_rijndael.h Visa fil

@@ -9,12 +9,14 @@

$id$ */

#ifndef __OT_RIJNDAEL_H__
#define __OT_RIJNDAEL_H__
#ifndef OT_RIJNDAEL_H__
#define OT_RIJNDAEL_H__

#include <stdint.h>

int rijndaelKeySetupEnc128(uint32_t rk[44], const uint8_t cipherKey[] );
void rijndaelEncrypt128(const uint32_t rk[44], const uint8_t pt[16], uint8_t ct[16]);

extern const char *g_version_rijndael_c;

#endif

+ 1
- 1
ot_stats.c Visa fil

@@ -770,4 +770,4 @@ void stats_deinit( ) {
pthread_cancel( thread_id );
}

const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.75 $\n";
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.76 $\n";

+ 5
- 2
ot_stats.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_STATS_H__
#define __OT_STATS_H__
#ifndef OT_STATS_H__
#define OT_STATS_H__

typedef enum {
EVENT_ACCEPT,
@@ -46,4 +46,7 @@ size_t stats_return_tracker_version( char *reply );
void stats_init( );
void stats_deinit( );

extern const char *g_version_rijndael_c;
extern const char *g_version_livesync_c;

#endif

+ 1
- 1
ot_sync.c Visa fil

@@ -163,4 +163,4 @@ void sync_deliver( int64 socket ) {

#endif

const char *g_version_sync_c = "$Source: /home/cvsroot/opentracker/ot_sync.c,v $: $Revision: 1.9 $\n";
const char *g_version_sync_c = "$Source: /home/cvsroot/opentracker/ot_sync.c,v $: $Revision: 1.10 $\n";

+ 2
- 2
ot_sync.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_SYNC_H__
#define __OT_SYNC_H__
#ifndef OT_SYNC_H__
#define OT_SYNC_H__

#ifdef WANT_SYNC_BATCH
enum { SYNC_IN, SYNC_OUT };


+ 1
- 1
ot_udp.c Visa fil

@@ -212,4 +212,4 @@ void udp_init( int64 sock, unsigned int worker_count ) {
pthread_create( &thread_id, NULL, udp_worker, (void *)sock );
}

const char *g_version_udp_c = "$Source: /home/cvsroot/opentracker/ot_udp.c,v $: $Revision: 1.32 $\n";
const char *g_version_udp_c = "$Source: /home/cvsroot/opentracker/ot_udp.c,v $: $Revision: 1.33 $\n";

+ 2
- 2
ot_udp.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_UDP_H__
#define __OT_UDP_H__
#ifndef OT_UDP_H__
#define OT_UDP_H__

void udp_init( int64 sock, unsigned int worker_count );
int handle_udp6( int64 serversocket, struct ot_workstruct *ws );


+ 1
- 1
ot_vector.c Visa fil

@@ -263,4 +263,4 @@ void vector_fixup_peers( ot_vector * vector ) {
vector->data = realloc( vector->data, vector->space * sizeof( ot_peer ) );
}

const char *g_version_vector_c = "$Source: /home/cvsroot/opentracker/ot_vector.c,v $: $Revision: 1.19 $\n";
const char *g_version_vector_c = "$Source: /home/cvsroot/opentracker/ot_vector.c,v $: $Revision: 1.20 $\n";

+ 2
- 2
ot_vector.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_VECTOR_H__
#define __OT_VECTOR_H__
#ifndef OT_VECTOR_H__
#define OT_VECTOR_H__

/* These defines control vectors behaviour */
#define OT_VECTOR_MIN_MEMBERS 2


+ 2
- 3
proxy.c Visa fil

@@ -1,7 +1,7 @@
/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
It is considered beerware. Prost. Skol. Cheers or whatever.

$Id: proxy.c,v 1.16 2010/08/15 16:38:43 erdgeist Exp $ */
$Id: proxy.c,v 1.17 2018/01/29 17:46:15 erdgeist Exp $ */

/* System */
#include <stdint.h>
@@ -715,8 +715,7 @@ unlock_continue:
void *tmp = malloc( mem );
if( tmp ) {
memcpy( tmp, ptr, mem );
if( !iob_addbuf_free( &g_connections[i].outdata, tmp, mem ) )
free( tmp );
iob_addbuf_free( &g_connections[i].outdata, tmp, mem );
io_wantwrite( g_connections[i].fd );
}
}


+ 1
- 1
scan_urlencoded_query.c Visa fil

@@ -140,4 +140,4 @@ ssize_t scan_fixed_int( char *data, size_t len, int *tmp ) {
return len;
}

const char *g_version_scan_urlencoded_query_c = "$Source: /home/cvsroot/opentracker/scan_urlencoded_query.c,v $: $Revision: 1.34 $\n";
const char *g_version_scan_urlencoded_query_c = "$Source: /home/cvsroot/opentracker/scan_urlencoded_query.c,v $: $Revision: 1.35 $\n";

+ 2
- 2
scan_urlencoded_query.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __SCAN_URLENCODED_QUERY_H__
#define __SCAN_URLENCODED_QUERY_H__
#ifndef SCAN_URLENCODED_QUERY_H__
#define SCAN_URLENCODED_QUERY_H__

#include <sys/types.h>



+ 1
- 1
trackerlogic.c Visa fil

@@ -454,4 +454,4 @@ void trackerlogic_deinit( void ) {
mutex_deinit( );
}

const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.138 $\n";
const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.139 $\n";

+ 2
- 2
trackerlogic.h Visa fil

@@ -3,8 +3,8 @@

$id$ */

#ifndef __OT_TRACKERLOGIC_H__
#define __OT_TRACKERLOGIC_H__
#ifndef OT_TRACKERLOGIC_H__
#define OT_TRACKERLOGIC_H__

#include <sys/types.h>
#include <sys/time.h>


Laddar…
Avbryt
Spara