sync with git

master
Dirk Engling 5 years ago
parent f3471b7667
commit e52170435f

@ -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

@ -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";

@ -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";

@ -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.

@ -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";

@ -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

@ -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";

@ -3,8 +3,8 @@
$id$ */
#ifndef __OT_FULLSCRAPE_H__
#define __OT_FULLSCRAPE_H__
#ifndef OT_FULLSCRAPE_H__
#define OT_FULLSCRAPE_H__
#ifdef WANT_FULLSCRAPE

@ -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";

@ -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,

@ -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";

@ -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>

@ -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";

@ -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"

@ -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";

@ -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,

@ -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";

@ -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

@ -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";

@ -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

@ -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";

@ -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 };

@ -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";

@ -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 );

@ -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";

@ -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

@ -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 );
}
}

@ -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";

@ -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>

@ -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";

@ -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>

Loading…
Cancel
Save