]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
README\!
authorerdgeist <>
Fri, 5 Jan 2007 00:00:42 +0000 (00:00 +0000)
committererdgeist <>
Fri, 5 Jan 2007 00:00:42 +0000 (00:00 +0000)
README [new file with mode: 0644]
opentracker.c
scan_urlencoded_query.c
scan_urlencoded_query.h
testsuite.sh
trackerlogic.c
trackerlogic.h

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..17db7de
--- /dev/null
+++ b/README
@@ -0,0 +1,21 @@
+This is opentracker. An open bittorrent tracker.
+
+You need libowfat (http://www.fefe.de/libowfat/).
+
+Steps to go:
+
+fetch http://dl.fefe.de/libowfat-0.24.tar.bz2
+tar xjf libowfat-0.24.tar.bz2
+cd libowfat
+make
+cd ..
+fetch http://erdgeist.org/arts/software/opentracker/opentracker-1.0.tar.bz2
+tar xjf opentracker-1.0.tar.bz2
+cd opentracker-1.0
+make
+./opentracker
+
+This tracker is open in a sense that everyone announcing a torrent is welcome to do so and will be informed about anyone else announcing the same torrent. Unless 
+-DWANT_IP_FROM_QUERY_STRING is enabled (which is meant for debugging purposes only), only source IPs are accepted. The tracker implements a minimal set of 
+essential features only but was able respond to far more than 10000 requests per second on a Sun Fire 2200 M2 (thats where we found no more clients able to fire 
+more of our testsuite.sh script).
index 680caa429496d1b5c5f22aaad9288baa0e7f6ccc..de98bb3b2bc8266ab74732ec08038adacfa86235 100644 (file)
@@ -1,3 +1,8 @@
+/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 
+   It is considered beerware. Prost. Skol. Cheers or whatever.
+   Some of the stuff below is stolen from Fefes example libowfat httpd.
+*/
+
 #include "socket.h"
 #include "io.h"
 #include "buffer.h"
@@ -351,7 +356,7 @@ int main()
         panic("io_fd");
 
     signal( SIGINT, graceful );
-    if( init_logic( "." ) == -1 )
+    if( init_logic( ) == -1 )
       panic("Logic not started");
 
     io_wantread(s);
index a21ec04807dc81f6d9bde7a437e889ec5ec63a73..ec145f9731e358e2fa9138cab6f30dcc325721ae 100644 (file)
@@ -1,3 +1,6 @@
+/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 
+   It is considered beerware. Prost. Skol. Cheers or whatever. */
+
 #include "scan.h"
 #include "scan_urlencoded_query.h"
 
index 5cc66305b72ceb6616aa0e6b68b392f65b20ce97..83f9be0e051ac425eb42706b820b4b6ca0b0dfd0 100644 (file)
@@ -1,3 +1,6 @@
+/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 
+   It is considered beerware. Prost. Skol. Cheers or whatever. */
+
 #ifndef __SCAN_URLENCODED_QUERY_H__
 #define __SCAN_URLENCODED_QUERY_H__
 
index 001bc5f86fbe69a650c0f884bd50434155f8f123..6b2dad977f9d1481df87c70a8ca4d0260ffd7957 100644 (file)
@@ -1,13 +1,12 @@
 #!/bin/sh
 
 while true; do
-  request_string="GET /announce?info_hash=012345678901234567%$(printf %02X `jot -r 1 0 255`)%$(printf %02X `jot -r 1 0 255`)&\
-ip=10.1.1.`jot -r 1 0 255`&\
-port=`jot -r 1 0 255` HTTP/1.0\n"
+  request_string="GET /announce?info_hash=0123456789012345678%$(printf %02X $(( $RANDOM & 0xff )) )&\
+ip=10.1.1.$(( $RANDOM & 0xff ))&port=$(( $RANDOM & 0xff )) HTTP/1.0\n"
 
   echo -e $request_string
   echo
-  echo -e $request_string | nc erdgeist.org 6969 | tr -C "[:print:]" _
+  echo -e $request_string | nc 213.73.88.214 6969 | tr -C "[:print:]" _
   echo
 
 done
index 083161d149d2c7dfec82964fc5715b92c1523b76..84330dfa3e436c9e13f2b36f5f824521bc8b1c93 100644 (file)
@@ -1,3 +1,6 @@
+/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
+   It is considered beerware. Prost. Skol. Cheers or whatever. */
+
 #include "trackerlogic.h"
 
 #include <stdlib.h>
@@ -269,63 +272,16 @@ void remove_peer_from_torrent( ot_hash *hash, ot_peer *peer ) {
     }
 }
 
-#if 0
-void dump_knowledge( void ) {
-  int ati, tli, pli;
-  for( ati = 0; ati<256; ++ati ) {
-    ot_vector *torrent_list = &all_torrents[ati];
-    for( tli = 0; tli<torrent_list->size; ++tli ) {
-      ot_torrent *torrent = &torrent_list->data[tli];
-      for( pool = 0; pool<OT_POOLS_COUNT; ++pool ) {
-        for( pli=0; pli<torrent->peer_list->peers[pool].size; ++pli ) {
-
-
-        }
-      }
-    }
-  }
-}
-#endif
-
 void cleanup_torrents( void ) {
 
 }
 
-int init_logic( char *directory ) {
-  glob_t globber;
-  int i;
-
-  if( directory ) {
-   if( chdir( directory ))
-     return -1;
-  }
-
+int init_logic( ) {
   srandom( time(NULL));
 
   // Initialize control structures
   byte_zero( all_torrents, sizeof (all_torrents));
 
-  // Scan directory for filenames in the form [0-9A-F]{20}
-  // * I know this looks ugly, but I've seen A-F to match umlauts as well in strange locales
-  // * lower case for .. better being safe than sorry, this is not expensive here :)
-  if( !glob(
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    "[0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef][0-9ABCDEFabcdef]"
-    , GLOB_NOCHECK, 0, &globber) )
-  {
-    for( i=0; i<globber.gl_matchc; ++i )
-      printf( "Found: %s\n", globber.gl_pathv[i] );
-  }
-
-  globfree( &globber );
   return 0;
 }
 
index 03c8e9ef55ec1fe4d0a75b1cdaa3baf9aa2e3104..06a9dd1d9139618d0e84a023a4768ae49c38779d 100644 (file)
@@ -1,3 +1,6 @@
+/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 
+   It is considered beerware. Prost. Skol. Cheers or whatever. */
+
 #ifndef __TRACKERLOGIC_H__
 #define __TRACKERLOGIC_H__
 
@@ -72,7 +75,7 @@ typedef struct {
 // Exported functions
 //
 
-int  init_logic( char *chdir_directory );
+int  init_logic( );
 void deinit_logic( );
 
 ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer );