bittorrent (3.4.2-11.4) direct (non packaging) changes

Summary

 BitTorrent/RawServer.py        |    4 
 BitTorrent/Storage.py          |    2 
 BitTorrent/btformats.py        |    5 
 BitTorrent/fmt.py              |   45 ++++++++
 BitTorrent/spewout.py          |   44 ++++++++
 BitTorrent/track.py            |    6 -
 BitTorrent/zurllib.py          |   10 +
 bittorrent.default             |   47 +++++++++
 bittorrent.init                |  125 ++++++++++++++++++++++++
 btcompletedir.py               |    2 
 btcompletedirgui.py            |   10 -
 btdownloadcurses.py            |   43 +-------
 btdownloadgui.py               |   41 ++-----
 btdownloadheadless.py          |   14 +-
 btlaunchmany.py                |   52 ++--------
 btlaunchmanycurses.py          |  211 ++++++++++++++++-------------------------
 btmakemetafile.py              |    2 
 btreannounce.py                |    6 -
 btrename.py                    |   64 ++++++------
 setup.py                       |    9 -
 www-doc/FAQ.html               |  143 +++++++++++++++++++++++++++
 www-doc/bittorrent_logo.png.uu |  113 +++++++++++++++++++++
 www-doc/documentation.html     |   49 +++++++++
 www-doc/donate.html            |   52 ++++++++++
 www-doc/download.html          |   88 +++++++++++++++++
 www-doc/guide.html             |   71 +++++++++++++
 www-doc/index.html             |   44 ++++++++
 www-doc/introduction.html      |   38 +++++++
 www-doc/press.html             |   35 ++++++
 www-doc/protocol.html          |  177 ++++++++++++++++++++++++++++++++++
 30 files changed, 1263 insertions(+), 289 deletions(-)

    
download this patch

Patch contents

--- bittorrent-3.4.2.orig/btrename.py
+++ bittorrent-3.4.2/btrename.py
@@ -1,33 +1,33 @@
 #!/usr/bin/env python
-
-# Written by Henry 'Pi' James
-# see LICENSE.txt for license information
-
-from sys import *
-from os.path import *
-from sha import *
-from BitTorrent.bencode import *
-
-NAME, EXT = splitext(basename(argv[0]))
-VERSION = '20021119'
-
-print '%s %s - change the suggested filename in a .torrent file' % (NAME, VERSION)
-print
-
-if len(argv) != 3:
-  print '%s file.torrent new.filename.ext' % argv[0]
-  print
-  exit(2) # common exit code for syntax error
-
-metainfo_file = open(argv[1], 'rb')
-metainfo = bdecode(metainfo_file.read())
-metainfo_file.close()
-print 'old filename: %s' % metainfo['info']['name']
-metainfo['info']['name'] = argv[2]
-print 'new filename: %s' % metainfo['info']['name']
-metainfo_file = open(argv[1], 'wb')
-metainfo_file.write(bencode(metainfo))
-metainfo_file.close
-print
-print 'done.'
-print
+
+# Written by Henry 'Pi' James
+# see LICENSE.txt for license information
+
+from sys import *
+from os.path import *
+from sha import *
+from BitTorrent.bencode import *
+
+NAME, EXT = splitext(basename(argv[0]))
+VERSION = '20021119'
+
+print '%s %s - change the suggested filename in a .torrent file' % (NAME, VERSION)
+print
+
+if len(argv) != 3:
+  print '%s file.torrent new.filename.ext' % argv[0]
+  print
+  exit(2) # common exit code for syntax error
+
+metainfo_file = open(argv[1], 'rb')
+metainfo = bdecode(metainfo_file.read())
+metainfo_file.close()
+print 'old filename: %s' % metainfo['info']['name']
+metainfo['info']['name'] = argv[2]
+print 'new filename: %s' % metainfo['info']['name']
+metainfo_file = open(argv[1], 'wb')
+metainfo_file.write(bencode(metainfo))
+metainfo_file.close
+print
+print 'done.'
+print
--- bittorrent-3.4.2.orig/btcompletedir.py
+++ bittorrent-3.4.2/btcompletedir.py
@@ -7,7 +7,7 @@
 from threading import Event
 from traceback import print_exc
 from sys import argv
-from btmakemetafile import calcsize, make_meta_file, ignore
+from BitTorrent.btmakemetafile import calcsize, make_meta_file, ignore
 
 def dummy(x):
     pass
--- bittorrent-3.4.2.orig/btdownloadheadless.py
+++ bittorrent-3.4.2/btdownloadheadless.py
@@ -55,6 +55,8 @@
 
     def error(self, errormsg):
         self.errors.append(errormsg)
+        if len(self.errors) > 5: 
+            self.errors = self.errors[-5:]
         self.display({})
 
     def display(self, dict):
@@ -70,16 +72,16 @@
         if dict.has_key('activity') and not self.done:
             self.timeEst = dict['activity']
         if dict.has_key('downRate'):
-            self.downRate = '%.2f kB/s' % (float(dict['downRate']) / (1 << 10))
+            self.downRate = '%.2f K/s' % (float(dict['downRate']) / (1 << 10))
         if dict.has_key('upRate'):
-            self.upRate = '%.2f kB/s' % (float(dict['upRate']) / (1 << 10))
+            self.upRate = '%.2f K/s' % (float(dict['upRate']) / (1 << 10))
         if dict.has_key('upTotal'):
-            self.upTotal = '%.1f MiB' % (dict['upTotal'])
+            self.upTotal = '%.1f M' % (dict['upTotal'])
         if dict.has_key('downTotal'):
-            self.downTotal = '%.1f MiB' % (dict['downTotal'])
+            self.downTotal = '%.1f M' % (dict['downTotal'])
         print '\n\n'
         for err in self.errors:
-            print 'ERROR:\n' + err + '\n'
+            print 'ERROR: ' + err + '\n'
         print 'saving:        ', self.file
         print 'percent done:  ', self.percentDone
         print 'time left:     ', self.timeEst
@@ -95,7 +97,7 @@
         stdout.flush()
 
     def chooseFile(self, default, size, saveas, dir):
-        self.file = '%s (%.1f MB)' % (default, float(size) / (1 << 20))
+        self.file = '%s (%.1f M)' % (default, float(size) / (1 << 20))
         if saveas != '':
             default = saveas
         self.downloadTo = abspath(default)
--- bittorrent-3.4.2.orig/btlaunchmany.py
+++ bittorrent-3.4.2/btlaunchmany.py
@@ -8,6 +8,7 @@
 # see LICENSE.txt for license information
 
 from BitTorrent.download import download
+from BitTorrent.fmt import fmttime, fmtsize
 from threading import Thread, Event, Lock
 from os import listdir
 from os.path import abspath, join, exists, getsize
@@ -15,40 +16,6 @@
 from time import sleep
 import traceback
 
-def fmttime(n):
-    if n == -1:
-        return '(no seeds?)'
-    if n == 0:
-        return 'complete'
-    n = int(n)
-    m, s = divmod(n, 60)
-    h, m = divmod(m, 60)
-    if h > 1000000:
-        return 'n/a'
-    return '%d:%02d:%02d' % (h, m, s)
-
-def fmtsize(n, baseunit = 0, padded = 1):
-    unit = [' B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
-    i = baseunit
-    while i + 1 < len(unit) and n >= 999:
-        i += 1
-        n = float(n) / (1 << 10)
-    size = ''
-    if padded:
-        if n < 10:
-            size = '  '
-        elif n < 100:
-            size = ' '
-    if i != 0:
-        size += '%.1f %s' % (n, unit[i])
-    else:
-        if padded:
-            size += '%.0f   %s' % (n, unit[i])
-        else:
-            size += '%.0f %s' % (n, unit[i])
-    return size
-
-
 def dummy(*args, **kwargs):
     pass
 
@@ -124,7 +91,9 @@
         totaldown = 0
         totaluptotal = 0.0
         totaldowntotal = 0.0
-        for file, threadinfo in threads.items(): 
+        tdis = threads.items()
+        tdis.sort()
+        for file, threadinfo in tdis: 
             uprate = threadinfo.get('uprate', 0)
             downrate = threadinfo.get('downrate', 0)
             uptxt = fmtsize(uprate, padded = 0)
@@ -140,7 +109,7 @@
                 print '%s: try %d died, retry in %d' % (filename, trys, timeout)
             else:
                 status = threadinfo.get('status','')
-                print '%s: Spd: %s/%s Tot: %s/%s [%s]' % (filename, uptxt, downtxt, uptotaltxt, downtotaltxt, status)
+                print '%s: Spd: %s/s:%s/s Tot: %s:%s [%s]' % (filename, uptxt, downtxt, uptotaltxt, downtotaltxt, status)
             totalup += uprate
             totaldown += downrate
             totaluptotal += uptotal
@@ -150,7 +119,7 @@
         totaldowntxt = fmtsize(totaldown, padded = 0)
         totaluptotaltxt = fmtsize(totaluptotal, baseunit = 2, padded = 0)
         totaldowntotaltxt = fmtsize(totaldowntotal, baseunit = 2, padded = 0)
-        print 'All: Spd: %s/%s Tot: %s/%s' % (totaluptxt, totaldowntxt, totaluptotaltxt, totaldowntotaltxt)
+        print 'All: Spd: %s/s:%s/s Tot: %s:%s' % (totaluptxt, totaldowntxt, totaluptotaltxt, totaldowntotaltxt)
         print
         stdout.flush()
         sleep(interval)
@@ -176,7 +145,7 @@
         self.done = 1
         self.myinfo['done'] = 1
         self.activity = 'complete'
-        self.display({'fractionDone' : 1})
+        self.display({'fractionDone' : 1, 'downRate' : 0})
 
     def err(self, msg): 
         self.myinfo['errors'].append(msg)
@@ -187,20 +156,21 @@
         self.display() 
 
     def choose(self, default, size, saveas, dir):
+        global filecheck
         self.myinfo['downfile'] = default
         self.myinfo['filesize'] = fmtsize(size)
         if saveas == '': 
             saveas = default
         # it asks me where I want to save it before checking the file.. 
-        self.myinfo['savefile'] = self.file[:-len(ext)]
         if exists(self.file[:-len(ext)]) and (getsize(self.file[:-len(ext)]) > 0):
             # file will get checked
             while (not filecheck.acquire(0) and not self.myinfo['kill'].isSet()):
                 self.myinfo['status'] = 'disk wait'
                 sleep(0.1)
             if not self.myinfo['kill'].isSet():
-                self.myinfo['checking'] = 1
                 self.checking = 1
+                self.myinfo['checking'] = 1
+        self.myinfo['savefile'] = self.file[:-len(ext)]
         return self.file[:-len(ext)]
     
     def display(self, dict = {}):
@@ -216,7 +186,7 @@
             else:
                 self.activity = activity
         elif timeEst is not None: 
-            self.activity = fmttime(timeEst)
+            self.activity = fmttime(timeEst, 1)
         if fractionDone is not None: 
             self.myinfo['status'] = '%s %.0f%%' % (self.activity, fractionDone * 100)
         else:
--- bittorrent-3.4.2.orig/btlaunchmanycurses.py
+++ bittorrent-3.4.2/btlaunchmanycurses.py
@@ -4,10 +4,10 @@
 # originally heavily borrowed code from btlaunchmany.py by Bram Cohen
 # and btdownloadcurses.py written by Henry 'Pi' James
 # now not so much.
-# fmttime and fmtsize stolen from btdownloadcurses. 
 # see LICENSE.txt for license information
 
 from BitTorrent.download import download
+from BitTorrent.fmt import fmttime, fmtsize
 from threading import Thread, Event, Lock
 from os import listdir
 from os.path import abspath, join, exists, getsize
@@ -16,38 +16,6 @@
 from signal import signal, SIGWINCH 
 import traceback
 
-def fmttime(n):
-    if n == -1:
-        return 'download not progressing (no seeds?)'
-    if n == 0:
-        return 'download complete!'
-    n = int(n)
-    m, s = divmod(n, 60)
-    h, m = divmod(m, 60)
-    if h > 1000000:
-        return 'n/a'
-    return 'finishing in %d:%02d:%02d' % (h, m, s)
-
-def fmtsize(n, baseunit = 0, padded = 1):
-    unit = [' B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
-    i = baseunit
-    while i + 1 < len(unit) and n >= 999:
-        i += 1
-        n = float(n) / (1 << 10)
-    size = ''
-    if padded:
-        if n < 10:
-            size = '  '
-        elif n < 100:
-            size = ' '
-    if i != 0:
-        size += '%.1f %s' % (n, unit[i])
-    else:
-        if padded:
-            size += '%.0f   %s' % (n, unit[i])
-        else:
-            size += '%.0f %s' % (n, unit[i])
-    return size
 
 def dummy(*args, **kwargs):
     pass
@@ -57,6 +25,7 @@
 status = 'btlaunchmany starting..'
 filecheck = Lock()
 mainquitflag = Event()
+winchanging = 0
 
 def cleanup_and_quit():
     status = 'Killing torrents..'
@@ -126,67 +95,76 @@
 
 def display_thread(displaykiller, mainquitflag):
     interval = 0.1
-    global threads, status
+    global threads, status, mainwinh
     while 1:
-        inchar = mainwin.getch();
-        if inchar == 12: # ^L
-            winch_handler()
-        elif inchar == ord('q'): # quit
-            mainquitflag.set() 
-        # display file info
-        if (displaykiller.isSet()): 
-            break
-        mainwin.erase()
-        winpos = 0
-        totalup = 0
-        totaldown = 0
-        totaluptotal = 0.0
-        totaldowntotal = 0.0
-        for file, threadinfo in threads.items(): 
-            uprate = threadinfo.get('uprate', 0)
-            downrate = threadinfo.get('downrate', 0)
-            uptxt = '%s/s' % fmtsize(uprate)
-            downtxt = '%s/s' % fmtsize(downrate)
-            uptotal = threadinfo.get('uptotal', 0.0)
-            downtotal = threadinfo.get('downtotal', 0.0)
-            uptotaltxt = fmtsize(uptotal, baseunit = 2)
-            downtotaltxt = fmtsize(downtotal, baseunit = 2)
-            filesize = threadinfo.get('filesize', 'N/A')
-            mainwin.addnstr(winpos, 0, threadinfo.get('savefile', file), mainwinw - 28, curses.A_BOLD)
-            mainwin.addnstr(winpos, mainwinw - 30, filesize, 8)
-            mainwin.addnstr(winpos, mainwinw - 21, downtxt, 10)
-            mainwin.addnstr(winpos, mainwinw - 10, uptxt, 10)
-            winpos = winpos + 1
-            mainwin.addnstr(winpos, 0, '^--- ', 5) 
-            if threadinfo.get('timeout', 0) > 0:
-                mainwin.addnstr(winpos, 6, 'Try %d: died, retrying in %d' % (threadinfo.get('try', 1), threadinfo.get('timeout')), mainwinw - 21)
-            else:
-                mainwin.addnstr(winpos, 6, threadinfo.get('status',''), mainwinw - 21)
-            mainwin.addnstr(winpos, mainwinw - 21, downtotaltxt, 8)
-            mainwin.addnstr(winpos, mainwinw - 10, uptotaltxt, 8)
-            winpos = winpos + 1
-            totalup += uprate
-            totaldown += downrate
-            totaluptotal += uptotal
-            totaldowntotal += downtotal
-        # display statusline
-        statuswin.erase() 
-        statuswin.addnstr(0, 0, status, mainwinw)
-        # display totals line
-        totaluptxt = '%s/s' % fmtsize(totalup)
-        totaldowntxt = '%s/s' % fmtsize(totaldown)
-        totaluptotaltxt = fmtsize(totaluptotal, baseunit = 2)
-        totaldowntotaltxt = fmtsize(totaldowntotal, baseunit = 2)
-        
-        totalwin.erase()
-        totalwin.addnstr(0, mainwinw - 29, 'Totals:', 7);
-        totalwin.addnstr(0, mainwinw - 21, totaldowntxt, 10)
-        totalwin.addnstr(0, mainwinw - 10, totaluptxt, 10)
-        totalwin.addnstr(1, mainwinw - 21, totaldowntotaltxt, 8)
-        totalwin.addnstr(1, mainwinw - 10, totaluptotaltxt, 8)
-        curses.panel.update_panels()
-        curses.doupdate()
-        sleep(interval)
+      if winchanging != 1: # writing now is okay.
+          inchar = mainwin.getch();
+          if inchar == 12: # ^L
+              winch_handler()
+          elif inchar == ord('q'): # quit
+              mainquitflag.set() 
+          # display file info
+          if (displaykiller.isSet()): 
+              break
+          mainwin.erase()
+          winpos = 0
+          totalup = 0
+          totaldown = 0
+          totaluptotal = 0.0
+          totaldowntotal = 0.0
+          tdis = threads.items()
+          tdis.sort()
+          missed = 0
+          for file, threadinfo in tdis: 
+              if (winpos + 3) >= mainwinh: 
+                missed = missed + 1
+                continue
+              uprate = threadinfo.get('uprate', 0)
+              downrate = threadinfo.get('downrate', 0)
+              uptxt = '%s/s' % fmtsize(uprate)
+              downtxt = '%s/s' % fmtsize(downrate)
+              uptotal = threadinfo.get('uptotal', 0.0)
+              downtotal = threadinfo.get('downtotal', 0.0)
+              uptotaltxt = fmtsize(uptotal, baseunit = 2)
+              downtotaltxt = fmtsize(downtotal, baseunit = 2)
+              filesize = threadinfo.get('filesize', 'N/A')
+              mainwin.addnstr(winpos, 0, threadinfo.get('savefile', file), mainwinw - 28, curses.A_BOLD)
+              mainwin.addnstr(winpos, mainwinw - 30, filesize, 8)
+              mainwin.addnstr(winpos, mainwinw - 21, downtxt, 10)
+              mainwin.addnstr(winpos, mainwinw - 10, uptxt, 10)
+              winpos = winpos + 1
+              mainwin.addnstr(winpos, 0, '^--- ', 5) 
+              if threadinfo.get('timeout', 0) > 0:
+                  mainwin.addnstr(winpos, 6, 'Try %d: died, retrying in %d' % (threadinfo.get('try', 1), threadinfo.get('timeout')), mainwinw - 21)
+              else:
+                  mainwin.addnstr(winpos, 6, threadinfo.get('status',''), mainwinw - 21)
+              mainwin.addnstr(winpos, mainwinw - 21, downtotaltxt, 8)
+              mainwin.addnstr(winpos, mainwinw - 10, uptotaltxt, 8)
+              winpos = winpos + 1
+              totalup += uprate
+              totaldown += downrate
+              totaluptotal += uptotal
+              totaldowntotal += downtotal
+          if missed > 0:
+            mainwin.addnstr(winpos, 0, '(%d more)' % missed, mainwinw) 
+          # display statusline
+          statuswin.erase() 
+          statuswin.addnstr(0, 0, status, mainwinw)
+          # display totals line
+          totaluptxt = '%s/s' % fmtsize(totalup)
+          totaldowntxt = '%s/s' % fmtsize(totaldown)
+          totaluptotaltxt = fmtsize(totaluptotal, baseunit = 2)
+          totaldowntotaltxt = fmtsize(totaldowntotal, baseunit = 2)
+          
+          totalwin.erase()
+          totalwin.addnstr(0, mainwinw - 29, 'Totals:', 7);
+          totalwin.addnstr(0, mainwinw - 21, totaldowntxt, 10)
+          totalwin.addnstr(0, mainwinw - 10, totaluptxt, 10)
+          totalwin.addnstr(1, mainwinw - 21, totaldowntotaltxt, 8)
+          totalwin.addnstr(1, mainwinw - 10, totaluptotaltxt, 8)
+          curses.panel.update_panels()
+          curses.doupdate()
+      sleep(interval)
 
 class StatusUpdater:
     def __init__(self, file, params, name):
@@ -239,6 +217,9 @@
         return saveas
     
     def display(self, dict = {}):
+        global winchanging
+        if winchanging == 1: # If we write now, we could write off the edge of the 
+          return             # screen and make curses mad :(
         fractionDone = dict.get('fractionDone', None)
         timeEst = dict.get('timeEst', None)
         activity = dict.get('activity', None) 
@@ -285,15 +266,19 @@
 def winch_handler(signum = SIGWINCH, stackframe = None): 
     global scrwin, mainwin, mainwinw, headerwin, totalwin, statuswin
     global scrpan, mainpan, headerpan, totalpan, statuspan
+    global winchanging
+    winchanging = 1
     # SIGWINCH. Remake the frames!
     ## Curses Trickery
     curses.endwin()
-    # delete scrwin somehow?
     scrwin.refresh()
     scrwin = curses.newwin(0, 0, 0, 0)
-    scrh, scrw = scrwin.getmaxyx()
-    scrpan = curses.panel.new_panel(scrwin)
-    ### Curses Setup
+    make_curses_window()
+    winchanging = 0
+
+def make_curses_window(): 
+    global scrwin, mainwin, mainwinw, headerwin, totalwin, statuswin
+    global scrpan, mainpan, headerpan, totalpan, statuspan, mainwinh
     scrh, scrw = scrwin.getmaxyx()
     scrpan = curses.panel.new_panel(scrwin)
     mainwinh = scrh - 5  # - 2 (bars) - 1 (debugwin) - 1 (borderwin) - 1 (totalwin)
@@ -315,10 +300,12 @@
     mainwin.scrollok(0)
     headerwin.scrollok(0)
     totalwin.scrollok(0)
-    statuswin.addstr(0, 0, 'window resize: %s x %s' % (scrw, scrh))
+    statuswin.addstr(0, 0, 'window size: %s x %s' % (scrw, scrh))
     statuswin.scrollok(0)
     prepare_display()
 
+
+
 if __name__ == '__main__':
     if (len(argv) < 2):
         print """Usage: btlaunchmanycurses.py <directory> <global options>
@@ -327,7 +314,7 @@
 """
         exit(-1)
     dietrace = 0
-    try: 
+    try:
         import curses
         import curses.panel
         scrwin = curses.initscr()
@@ -338,31 +325,7 @@
         exit(-1)
     try:
         signal(SIGWINCH, winch_handler)
-        ### Curses Setup
-        scrh, scrw = scrwin.getmaxyx()
-        scrpan = curses.panel.new_panel(scrwin)
-        mainwinh = scrh - 5  # - 2 (bars) - 1 (debugwin) - 1 (borderwin) - 1 (totalwin)
-        mainwinw = scrw - 4  # - 2 (bars) - 2 (spaces)
-        mainwiny = 2         # + 1 (bar) + 1 (titles)
-        mainwinx = 2         # + 1 (bar) + 1 (space)
-        # + 1 to all windows so we can write at mainwinw
-        mainwin = curses.newwin(mainwinh, mainwinw+1, mainwiny, mainwinx)
-        mainpan = curses.panel.new_panel(mainwin)
-
-        headerwin = curses.newwin(1, mainwinw+1, 1, mainwinx)
-        headerpan = curses.panel.new_panel(headerwin)
-
-        totalwin = curses.newwin(2, mainwinw+1, scrh-4, mainwinx)
-        totalpan = curses.panel.new_panel(totalwin)
-
-        statuswin = curses.newwin(1, mainwinw+1, scrh-2, mainwinx)
-        statuspan = curses.panel.new_panel(statuswin)
-        mainwin.scrollok(0)
-        headerwin.scrollok(0)
-        totalwin.scrollok(0)
-        statuswin.addstr(0, 0, 'btlaunchmany started')
-        statuswin.scrollok(0)
-        prepare_display()
+        make_curses_window()
         displaykiller = Event()
         displaythread = Thread(target = display_thread, name = 'display', args = [displaykiller, mainquitflag])
         displaythread.setDaemon(1)
--- bittorrent-3.4.2.orig/btcompletedirgui.py
+++ bittorrent-3.4.2/btcompletedirgui.py
@@ -5,7 +5,7 @@
 
 from sys import argv, version
 
-from btcompletedir import completedir
+from BitTorrent.btcompletedir import completedir
 from threading import Event, Thread
 from os.path import join, split
 from sys import argv
@@ -40,11 +40,11 @@
 
         b = wxBoxSizer(wxHORIZONTAL)
         b.Add(self.dirCtl, 1, wxEXPAND)
-        b.Add(10, 10, 0, wxEXPAND)
+        b.Add((10, 10), 0, wxEXPAND)
         button = wxButton(panel, -1, 'add file')
         b.Add(button, 0, wxEXPAND)
         EVT_BUTTON(frame, button.GetId(), self.select)
-        b.Add(5, 5, 0, wxEXPAND)
+        b.Add((5, 5), 0, wxEXPAND)
         c = wxButton(panel, -1, 'add dir')
         b.Add(c, 0, wxEXPAND)
         EVT_BUTTON(frame, c.GetId(), self.selectdir)
@@ -66,7 +66,7 @@
         border = wxBoxSizer(wxVERTICAL)
         border.Add(gridSizer, 0, wxEXPAND | wxNORTH | wxEAST | wxWEST, 25)
         b2 = wxButton(panel, -1, 'make')
-        border.Add(10, 10, 1, wxEXPAND)
+        border.Add((10, 10), 1, wxEXPAND)
         border.Add(b2, 0, wxALIGN_CENTER | wxSOUTH, 20)
         EVT_BUTTON(frame, b2.GetId(), self.complete)
         panel.SetSizer(border)
@@ -119,7 +119,7 @@
         gridSizer.Add(self.currentLabel, 0, wxEXPAND)
         self.gauge = wxGauge(panel, -1, range = 1000, style = wxGA_SMOOTH)
         gridSizer.Add(self.gauge, 0, wxEXPAND)
-        gridSizer.Add(10, 10, 1, wxEXPAND)
+        gridSizer.Add((10, 10), 1, wxEXPAND)
         self.button = wxButton(panel, -1, 'cancel')
         gridSizer.Add(self.button, 0, wxALIGN_CENTER)
         gridSizer.AddGrowableRow(2)
--- bittorrent-3.4.2.orig/btreannounce.py
+++ bittorrent-3.4.2/btreannounce.py
@@ -1,11 +1,11 @@
 #!/usr/bin/env python
-
+
 # Written by Henry 'Pi' James and Bram Cohen
 # see LICENSE.txt for license information
-
+
 from sys import argv
 from BitTorrent.bencode import bencode, bdecode
-
+
 if len(argv) < 3:
     print '%s http://new.uri:port/announce file1.torrent file2.torrent' % argv[0]
     print
--- bittorrent-3.4.2.orig/setup.py
+++ bittorrent-3.4.2/setup.py
@@ -18,9 +18,8 @@
     
     packages = ["BitTorrent"],
 
-    scripts = ["btdownloadgui.py", "btdownloadheadless.py", "btdownloadlibrary.py", 
-        "bttrack.py", "btmakemetafile.py", "btlaunchmany.py", "btcompletedir.py",
-        "btdownloadcurses.py", "btcompletedirgui.py", "btlaunchmanycurses.py", 
-        "btmakemetafile.py", "btreannounce.py", "btrename.py", "btshowmetainfo.py",
-        "bttest.py"]
+    scripts = ["btdownloadgui.py", "btdownloadheadless.py", 
+        "bttrack.py", "btmakemetafile.py", "btlaunchmany.py",
+        "btdownloadcurses.py", "btlaunchmanycurses.py", 
+        "btmakemetafile.py", "btreannounce.py", "btrename.py", "btshowmetainfo.py", "btcompletedir.py", "btcompletedirgui.py"]
     )
--- bittorrent-3.4.2.orig/btdownloadgui.py
+++ bittorrent-3.4.2/btdownloadgui.py
@@ -3,14 +3,17 @@
 # Written by Bram Cohen and Myers Carpenter
 # see LICENSE.txt for license information
 
-from sys import argv
+from sys import argv, exit
 from BitTorrent import version
 from BitTorrent.download import download
-from btdownloadheadless import print_spew
+from BitTorrent.spewout import print_spew
 from threading import Event, Thread
 from os.path import join, split, exists
 from os import getcwd
+
 from wxPython.wx import *
+wxEVT_INVOKE = wxNewEventType()
+
 from time import strftime, time
 from webbrowser import open_new
 from traceback import print_exc
@@ -105,7 +108,7 @@
         
         colSizer.Add(gridSizer, 0, wxEXPAND)
         colSizer.Add(rategridSizer, 0, wxEXPAND)
-        colSizer.Add(50, 50, 0, wxEXPAND)
+        colSizer.Add((50, 50), 0, wxEXPAND)
         self.cancelButton = wxButton(panel, -1, 'Cancel')
         colSizer.Add(self.cancelButton, 0, wxALIGN_CENTER)
         colSizer.AddGrowableCol(0)
@@ -163,13 +166,15 @@
             if timeEst is not None:
                 self.timeEstText.SetLabel(hours(timeEst))
             if downRate is not None:
-                self.downRateText.SetLabel('%.0f KiB/s' % (float(downRate) / (1 << 10)))
+                self.downRateText.SetLabel('%.0f K/s' % (float(downRate) / (1 << 10)))
             if upRate is not None:
-                self.upRateText.SetLabel('%.0f KiB/s' % (float(upRate) / (1 << 10)))
+                self.upRateText.SetLabel('%.0f K/s' % (float(upRate) / (1 << 10)))
             if downTotal is not None:
                 self.downTotalText.SetLabel('%.1f M' % (downTotal))
             if upTotal is not None:
                 self.upTotalText.SetLabel('%.1f M' % (upTotal))
+            self.frame.Refresh()
+            self.frame.Update()
             self.last_update_time = time()
         except:
             print_exc()
@@ -228,7 +233,7 @@
                 return
             saveas = dl.GetPath()
         bucket[0] = saveas
-        self.fileNameText.SetLabel('%s (%.1f MB)' % (default, float(size) / (1 << 20)))
+        self.fileNameText.SetLabel('%s (%.1f M)' % (default, float(size) / (1 << 20)))
         self.timeEstText.SetLabel('Starting up...')
         self.fileDestText.SetLabel(saveas)
         self.filename = default
@@ -266,30 +271,6 @@
 
 def next(params, d, doneflag):
     try:
-        p = join(split(argv[0])[0], 'donated')
-        if not exists(p) and long(time()) % 3 == 0:
-            open_new('http://bitconjurer.org/BitTorrent/donate.html')
-            dlg = wxMessageDialog(d.frame, 'BitTorrent is Donation supported software. ' + 
-                'Please go to the donation page (which should be appearing for you now) and make a donation from there. ' + 
-                'Or you can click no and donate later.\n\nHave you made a donation yet?',
-                'Donate!', wxYES_NO | wxICON_INFORMATION | wxNO_DEFAULT)
-            if dlg.ShowModal() == wxID_YES:
-                dlg.Destroy()
-                dlg = wxMessageDialog(d.frame, 'Thanks for your donation! You will no longer be shown donation requests.\n\n' + 
-                    "If you haven't actually made a donation and are feeling guilty (as you should!) you can always get to " + 
-                    "the donation page by clicking the 'about' link in the upper-right corner of the main BitTorrent window and " + 
-                    'donating from there.', 'Thanks!', wxOK)
-                dlg.ShowModal()
-                dlg.Destroy()
-                try:
-                    open(p, 'wb').close()
-                except IOError, e:
-                    dlg = wxMessageDialog(d.frame, "Sorry, but I couldn't set the flag to not ask you for donations in the future - " + str(e),
-                        'Sorry!', wxOK | wxICON_ERROR)
-                    dlg.ShowModal()
-                    dlg.Destroy()
-            else:
-                dlg.Destroy()
         download(params, d.chooseFile, d.updateStatus, d.finished, d.error, doneflag, 100, d.newpath)
         if not d.fin:
             d.failed()
--- bittorrent-3.4.2.orig/btmakemetafile.py
+++ bittorrent-3.4.2/btmakemetafile.py
@@ -29,7 +29,7 @@
 def dummy(v):
     pass
 
-def make_meta_file(file, url, piece_len_exp, 
+def make_meta_file(file, url, piece_len_exp = 18, 
         flag = Event(), progress = dummy, progress_percent=1, comment = None, target = None):
     piece_length = 2 ** piece_len_exp
     a, b = split(file)
--- bittorrent-3.4.2.orig/bittorrent.init
+++ bittorrent-3.4.2/bittorrent.init
@@ -0,0 +1,125 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides:          bittorrent
+# Required-Start:    $network $local_fs
+# Required-Stop:     $network $local_fs
+# Should-Start:      
+# Should-Stop:       
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start a bittorrent tracker
+# Description:       Starts a bittorrent tracker, which
+#                    aids bittorrent clients by locating
+#                    other clients.
+### END INIT INFO
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="BitTorrent tracker"
+NAME=bttrack.bittorrent
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/bittorrent
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+PORT=6969
+DFILE=/var/lib/bittorrent/bttrack.state
+
+# Read config file if it is present.
+if [ -r /etc/default/bittorrent ]; then
+	. /etc/default/bittorrent
+fi
+
+# Add optional option $1 with argument $2 to OPTS, if $2 is nonempty
+add_opt () {
+	if ! test -z "$2" ; then
+		OPTS="$OPTS $1 $2"
+	fi
+}
+
+# Compose command-line arguments list for bttrack daemon, based on variables
+# set in /etc/default/$NAME
+OPTS=""
+add_opt --dfile "$DFILE"
+add_opt --port "$PORT"
+add_opt --bind "$BIND"
+add_opt --socket_timeout "$SOCKET_TIMEOUT"
+add_opt --save_dfile_interval "$SAVE_DFILE_INTERVAL"
+add_opt --timeout_downloaders_interval "$TIMEOUT_DOWNLOADERS_INTERVAL"
+add_opt --reannounce_interval "$REANNOUNCE_INTERVAL"
+add_opt --respose_size "$RESPONSE_SIZE"
+add_opt --timeout_check_interval "$TIMEOUT_CHECK_INTERVAL"
+add_opt --nat_check "$NAT_CHECK"
+add_opt --min_time_between_log_flushes "$MIN_TIME_BETWEEN_LOG_FLUSHES"
+add_opt --allowed_dir "$ALLOWED_DIR"
+add_opt --parse_allowed_interval "$PARSE_ALLOWED_INTERVAL"
+add_opt --show_names "$SHOW_NAMES"
+add_opt --logfile "$DAEMONLOGFILE"
+DAEMONOPTS="$OPTS"
+
+# Add arguments for start-stop-daemon, based on variables set in
+# /etc/default/$NAME
+OPTS=""
+add_opt --chuid "$DAEMONUSER"
+add_opt --chroot "$DAEMONCHROOT"
+add_opt --chdir "$DAEMONCHDIR"
+add_opt --nicelevel "$DAEMONNICE"
+METAOPTS="$OPTS"
+
+#
+#Function that starts the daemon/service.
+#
+d_start() {
+	if [ $START_BTTRACK -ne 1 ]; then
+		log_progress_msg "disabled in /etc/default/bittorrent"
+		return 1
+	else
+		start-stop-daemon --start --background --quiet \
+		--make-pidfile --pidfile "$PIDFILE" \
+		$METAOPTS \
+		--exec $DAEMON -- $DAEMONOPTS
+		return 0
+	fi
+}
+
+#
+#Function that stops the daemon/service.
+#
+d_stop() {
+	start-stop-daemon --stop --oknodo --quiet --pidfile "$PIDFILE"
+}
+
+case "$1" in
+  start)
+  	log_daemon_msg "Starting $DESC" "$NAME"
+	d_start
+	log_end_msg $?
+	;;
+  stop)
+  	log_daemon_msg "Stopping $DESC" "$NAME"
+	d_stop
+	log_end_msg 0
+	;;
+  restart|force-reload)
+  	log_daemon_msg "Restarting $DESC" "$NAME"
+	d_stop
+	sleep 1
+	d_start
+	log_end_msg $?
+	;;
+  status)
+  	exit 4
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+	exit 2
+	;;
+esac
+
+exit 0
--- bittorrent-3.4.2.orig/bittorrent.default
+++ bittorrent-3.4.2/bittorrent.default
@@ -0,0 +1,47 @@
+# Default configuration for bittorrent tracker, bttrack
+
+# If you want the bittorrent tracker to run, switch this to 1.
+# If you change this, you will probably want to change 
+# ALLOWED_DIR as well, or anyone will be able to track anything
+# just by pointing the .torrent at your server.
+START_BTTRACK=0
+
+# Set any bttrack option --foo by defining the variable FOO to the argument
+# you'd like to pass with the --foo option.  See `man bttrack` for a detailed
+# discussion of the options.
+
+# Persistent state file
+DFILE=/var/lib/bittorrent/bttrack.state
+
+# Port defaults to 80, which tends to be inconvenient
+PORT=6969
+
+# Only allow downloads for .torrent files in this directory
+#ALLOWED_DIR=/srv/ftp
+
+# The following options do not correspond to bttrack options; they influence how
+# bttrack's init script starts the daemon.
+
+# Run under this uid.  Must have access to all files and directories involved,
+# naturally, but should otherwise have minimal privileges to minimize any
+# security risk.
+#DAEMONUSER=bittorrent
+
+# chroot to this directory before starting the daemon.  This can also help keep
+# the daemon secure, but may interact with all sorts of file locations in
+# unexpected ways.
+#DAEMONCHROOT=/var/local/lib/bttrack-sandbox
+
+# Move to this directory before starting the daemon.  This may be useful in
+# conjunction with DAEMONCHROOT.
+#DAEMONCHDIR=/var/local/lib/bttrack-sandbox
+
+# Run the daemon at this "nice" priority.  Setting a positive value here will
+# dissuade the system from giving all its CPU time to bttrack requests from the
+# network.
+DAEMONNICE=5
+
+# Append log output from daemon to this file.  Make sure this log is rotated
+# from time to time so it doesn't fill up your disk.  The daemon will of course
+# need write access to the log file.
+DAEMONLOGFILE=/var/log/bittorrent/bttrack.log
--- bittorrent-3.4.2.orig/btdownloadcurses.py
+++ bittorrent-3.4.2/btdownloadcurses.py
@@ -4,24 +4,13 @@
 # see LICENSE.txt for license information
 
 from BitTorrent.download import download
+from BitTorrent.fmt import fmtsize, fmttime
 from threading import Event
 from os.path import abspath
 from signal import signal, SIGWINCH
 from sys import argv, stdout
 from time import strftime, time
 
-def fmttime(n):
-    if n == -1:
-        return 'download not progressing (file not being uploaded by others?)'
-    if n == 0:
-        return 'download complete!'
-    n = int(n)
-    m, s = divmod(n, 60)
-    h, m = divmod(m, 60)
-    if h > 1000000:
-        return 'n/a'
-    return 'finishing in %d:%02d:%02d' % (h, m, s)
-
 def commaize(n): 
     s = str(n)
     commad = s[-3:]
@@ -30,30 +19,11 @@
         commad = '%s,%s' % (s[-3:], commad)
     return commad
 
-def fmtsize(n, baseunit = 0, padded = 1):
-    unit = [' B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
-    i = baseunit
-    while i + 1 < len(unit) and n >= 999:
-        i += 1
-        n = float(n) / (1 << 10)
-    size = ''
-    if padded:
-        if n < 10:
-            size = '  '
-        elif n < 100:
-            size = ' '
-    if i != 0:
-        size += '%.1f %s' % (n, unit[i])
-    else:
-        if padded:
-            size += '%.0f   %s' % (n, unit[i])
-        else: 
-            size += '%.0f %s' % (n, unit[i])
-    return size
-
 def winch_handler(signum, stackframe):
     global scrwin, scrpan, labelwin, labelpan, fieldw, fieldh, fieldwin, fieldpan
+    global winchanging
     # SIGWINCH. Remake the frames!
+    winchanging = 1
     ## Curses Trickery
     curses.endwin()
     # delete scrwin somehow?
@@ -68,9 +38,13 @@
     fieldwin = curses.newwin(fieldh, fieldw, fieldy, fieldx)
     fieldpan = curses.panel.new_panel(fieldwin)
     prepare_display()
+    winchanging = 0
 
 # This flag stops the torrent when set.
 mainkillflag = Event()
+# This flag is set when winch is happening, so that we don't anger the curses gods
+# by writing off the side of the screen
+winchanging = 0
 
 class CursesDisplayer:
     def __init__(self, mainerrlist):
@@ -115,6 +89,9 @@
         if self.last_update_time + 0.1 > time() and dict.get('fractionDone') not in (0.0, 1.0) and not dict.has_key('activity'):
             return
         self.last_update_time = time()
+        global winchanging
+        if winchanging == 1: 
+          return
         global mainkillflag
         fractionDone = dict.get('fractionDone', None)
         timeEst = dict.get('timeEst', None)
--- bittorrent-3.4.2.orig/BitTorrent/fmt.py
+++ bittorrent-3.4.2/BitTorrent/fmt.py
@@ -0,0 +1,45 @@
+# Written by Michael Janssen
+# See LICENSE.txt for license information
+
+def fmttime(n, compact = 0):
+    if n == -1:
+        if compact: 
+            return '(no seeds?)'
+        else: 
+            return 'download not progressing (no seeds?)'
+    if n == 0:
+        if compact: 
+            return "complete"
+        else: 
+            return 'download complete!'
+    n = int(n)
+    m, s = divmod(n, 60)
+    h, m = divmod(m, 60)
+    if h > 1000000:
+        return 'n/a'
+    if compact: 
+        return '%d:%02d:%02d' % (h, m, s)
+    else: 
+        return 'finishing in %d:%02d:%02d' % (h, m, s)
+
+def fmtsize(n, baseunit = 0, padded = 1):
+    unit = [' B', ' K', ' M', ' G', ' T', ' P', ' E', ' Z', ' Y']
+    i = baseunit
+    while i + 1 < len(unit) and n >= 999:
+        i += 1
+        n = float(n) / (1 << 10)
+    size = ''
+    if padded:
+        if n < 10:
+            size = '  '
+        elif n < 100:
+            size = ' '
+    if i != 0:
+        size += '%.1f %s' % (n, unit[i])
+    else:
+        if padded:
+            size += '%.0f   %s' % (n, unit[i])
+        else:
+            size += '%.0f %s' % (n, unit[i])
+    return size
+
--- bittorrent-3.4.2.orig/BitTorrent/zurllib.py
+++ bittorrent-3.4.2/BitTorrent/zurllib.py
@@ -35,8 +35,14 @@
         if DEBUG: 
              pprint.pprint(headers.dict)
         url = fp.url
-        return addinfourldecompress(fp, headers, url)
-
+	resp = addinfourldecompress(fp, headers, url)
+	# As of Python 2.4 http_open response also has 'code' and 'msg'
+        # members, and HTTPErrorProcessor breaks if they don't exist.
+	if 'code' in dir(fp):
+	    resp.code = fp.code
+	if 'msg' in dir(fp):
+	    resp.msg = fp.msg
+	return resp
 
 class addinfourldecompress(addinfourl):
     """Do gzip decompression if necessary. Do addinfourl stuff too."""
--- bittorrent-3.4.2.orig/BitTorrent/track.py
+++ bittorrent-3.4.2/BitTorrent/track.py
@@ -258,7 +258,7 @@
                             szt = sz * n   # Transferred for this torrent
                             tt = tt + szt
                             if self.allow_get == 1:
-                                linkname = '<a href="/file?info_hash=' + quote(name) + '">' + self.allowed[name]['name'] + '</a>'
+                                linkname = '<a href="/file?info_hash=' + b2a_hex(name) + '">' + self.allowed[name]['name'] + '</a>'
                             else:
                                 linkname = self.allowed[name]['name']
                             s.write('<tr><td><code>%s</code></td><td>%s</td><td align="right">%s</td><td align="right">%i</td><td align="right">%i</td><td align="right">%i</td><td align="right">%s</td></tr>\n' \
@@ -308,8 +308,8 @@
                     fs[name]['name'] = self.allowed[name]['name']
             r = {'files': fs}
             return (200, 'OK', {'Content-Type': 'text/plain'}, bencode(r))
-        elif (path == 'file') and (self.allow_get == 1) and params.has_key('info_hash') and self.allowed.has_key(params['info_hash']):
-            hash = params['info_hash']
+        elif (path == 'file') and (self.allow_get == 1) and params.has_key('info_hash') and self.allowed.has_key(a2b_hex(params['info_hash'])):
+            hash = a2b_hex(params['info_hash'])
             fname = self.allowed[hash]['file']
             fpath = self.allowed[hash]['path']
             return (200, 'OK', {'Content-Type': 'application/x-bittorrent', 'Content-Disposition': 'attachment; filename=' + fname}, open(fpath, 'rb').read())
--- bittorrent-3.4.2.orig/BitTorrent/Storage.py
+++ bittorrent-3.4.2/BitTorrent/Storage.py
@@ -88,7 +88,7 @@
             h.seek(begin)
             h.write(s[total: total + end - begin])
             total += end - begin
-
+   
     def close(self):
         for h in self.handles.values():
             h.close()
--- bittorrent-3.4.2.orig/BitTorrent/spewout.py
+++ bittorrent-3.4.2/BitTorrent/spewout.py
@@ -0,0 +1,44 @@
+
+# This file created for Debian because btdownloadcurses can't 
+# find btdownloadheadless because we rename it.
+
+def print_spew(spew):
+    s = StringIO()
+    s.write('\n\n\n')
+    for c in spew:
+        s.write('%20s ' % c['ip'])
+        if c['initiation'] == 'local':
+            s.write('l')
+        else:
+            s.write('r')
+        rate, interested, choked = c['upload']
+        s.write(' %10s ' % str(int(rate)))
+        if c['is_optimistic_unchoke']:
+            s.write('*')
+        else:
+            s.write(' ')
+        if interested:
+            s.write('i')
+        else:
+            s.write(' ')
+        if choked:
+            s.write('c')
+        else:
+            s.write(' ')
+
+        rate, interested, choked, snubbed = c['download']
+        s.write(' %10s ' % str(int(rate)))
+        if interested:
+            s.write('i')
+        else:
+            s.write(' ')
+        if choked:
+            s.write('c')
+        else:
+            s.write(' ')
+        if snubbed:
+            s.write('s')
+        else:
+            s.write(' ')
+        s.write('\n')
+    print s.getvalue()
--- bittorrent-3.4.2.orig/BitTorrent/RawServer.py
+++ bittorrent-3.4.2/BitTorrent/RawServer.py
@@ -129,6 +129,10 @@
             handler = self.handler
         sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         sock.setblocking(0)
+        try:
+            sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 32)
+        except:
+            pass
         sock.bind((self.bindaddr, 0))
         try:
             sock.connect_ex(dns)
--- bittorrent-3.4.2.orig/BitTorrent/btformats.py
+++ bittorrent-3.4.2/BitTorrent/btformats.py
@@ -55,8 +55,9 @@
     if type(message) != DictType:
         raise ValueError
     check_info(message.get('info'))
-    if type(message.get('announce')) != StringType:
-        raise ValueError
+    announce = message.get('announce')
+    if type(announce) != StringType or len(announce) == 0:
+        raise ValueError, 'bad torrent file - announce is invalid'
 
 def check_peers(message):
     if type(message) != DictType:
--- bittorrent-3.4.2.orig/www-doc/documentation.html
+++ bittorrent-3.4.2/www-doc/documentation.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Documentation</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a class="current">Documentation</a>
+        <ul class="submenu">
+          <li><a href="guide.html">Guide</a></li>
+          <li><a href="protocol.html">Protocol</a></li>
+          <li><a href="http://bitconjurer.org/BitTorrent/bittorrentecon.pdf">Paper</a></li>
+        </ul>
+      </li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <p>For common users:</p>
+    <ul>
+      <li><a href="FAQ.html">Frequently asked questions</a></li>
+    </ul>
+    <p>For content distributors:</p>
+    <ul>
+      <li><a href="guide.html">File server's guide</a></li>
+    </ul>
+    <p>For developers:</p>
+    <ul>
+      <li><a href="protocol.html">BitTorrent protocol specification</a></li>
+    </ul>
+    <p>For academics:</p>
+    <ul>
+      <li><a href="http://bitconjurer.org/BitTorrent/bittorrentecon.pdf">BitTorrent Economics Paper</a> (PDF)</li>
+    </ul>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/FAQ.html
+++ bittorrent-3.4.2/www-doc/FAQ.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Frequently Asked Questions</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a class="current">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a></li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <dl>
+      <dt>Where can I find stuff to download using BitTorrent?</dt>
+      <dd>
+        <p>You can find lots of things <a href="http://bt.etree.org/">here</a> and from <a
+href="http://smiler.no-ip.org/BT/BTlinks.php">Smiler's BitTorrent links</a>.</p>
+      </dd>
+      <dt>Help! My download isn't working!</dt>
+      <dd>
+        <p>Please read this FAQ to see if it solves your problem, and if that doesn't work try <a
+href="http://btfaq.com/">this FAQ</a>. If that doesn't help, post a question to the <a
+href="http://groups.yahoo.com/group/BitTorrent_help/">technical support mailing list</a>. Be sure to mention what
+operating system you're running, the url of the file you're trying to download, what version of BitTorrent you're running, and explain <em>exactly</em> what behavior you're seeing.</p>
+        <p>Do <em>not</em> post questions about where to find files or announcements of files being avialable to this
+mailing list. For that, try using a search engine.</p>
+      </dd>
+      <dt>BitTorrent is great! How can I help?</dt>
+      <dd>
+        <p>You can give a <a href="donate.html">donation</a>.</p>
+      </dd>
+      <dt>What is BitTorrent uploading from my machine?</dt>
+      <dd>
+        <p>Pieces of the file you're currently downloading. BitTorrent trades pieces you have with pieces your
+peers have.</p>
+      </dd>
+      <dt>I don't want you stealing my bandwidth! How can I stop it from uploading?</dt>
+      <dd>
+        <p>You could hack the source to not upload, but then your download rate would suck. BitTorrent downloaders engage in tit-for-tat with their peers, so leeches have very little success downloading.</p>
+      </dd>
+      <dt>I get an error message starting with 'problem connecting to tracker', what should I do?</dt>
+      <dd>
+        <p>The tracker for the one particular file you're trying to download is probably down. Try to download again later.</p>
+        <p>Alternately, this error message may indicate that your net connection is down or doesn't allow arbitrary outgoing connections, which is necessary for BitTorrent to work.</p>
+      </dd>
+      <dt>BitTorrent makes my machine blue screen! What should I do?</dt>
+      <dd>
+        <p>If you have a DSL modem, especially an Alcatel, you should <a href="http://www.fastaccess.drivers.bellsouth.net/#alcatel">upgrade your drivers</a>. If you have a Linksys network card, you may have to <a href="http://groups.yahoo.com/group/BitTorrent/message/1365">upgrade your network card drivers</a> as well.</p>
+      </dd>
+      <dt>When I click on BitTorrent links is says 'file not found'. What do I do?</dt>
+      <dd>
+        <p>This problem was recently fixed. You should install the <a href="download.html">latest version</a>.</p>
+      </dd>
+      <dt>Can I use BitTorrent on Mac OS 9?</dt>
+      <dd>
+        <p>After installing <a href="http://www.cwi.nl/~jack/macpython.html">MacPython</a>, you should be able to use <code>btdownloadheadless.py</code> from the source.</p>
+      </dd>
+      <dt>Does BitTorrent support resuming?</dt>
+      <dd>
+        <p>Yes, just save your download to the same location as the existing partial download. BitTorrent will resume where it left off after checking the partial download.</p>
+      </dd>
+      <dt>How can I contribute to a file distribution without downloading?</dt>
+      <dd>
+        <p>Just leave BitTorrent running after it's done downloading. If you already have the complete file(s), restart downloading and resume to the existing file(s).</p>
+      </dd>
+      <dt>How do I know the download isn't corrupted?</dt>
+      <dd>
+        <p>BitTorrent does cryptographic hashing (SHA1) of all data. When you see "Download succeeded!" you can be sure that BitTorrent has already verified the integrity of the data. The integrity and authenticity of a BitTorrent download is as good as the original request to the tracker. Checking the MD5/CRC32/other hash of a file downloaded via BitTorrent is redundant.</p>
+      </dd>
+      <dt>I'm behind a firewall/NAT, can I use BitTorrent?</dt>
+      <dd>
+        <p>Yes, but you will get better performance if other peers can connect to you. <a href="http://knowbuddy.dyndns.org:81/torrent/btclientconfig.html#FWConfig">See here</a> for
+detailed instructions on how to allow incoming BitTorrent connections.</p>
+      </dd>
+      <dt>How many downloads can BitTorrent support?</dt>
+      <dd>
+        <p>For very popular files, BitTorrent can support roughly a thousand times as many downloads as http
+can. Recent changes may change this to ten thousand.</p>
+      </dd>
+      <dt>I published a file but whenever I try to download it hangs saying "connecting to peers" and/or the download just never starts.</dt>
+      <dd>
+        <p>You need to leave at least one downloader running which already has the whole file. Make sure other peers can connect to this downloader (preferably not behind firewall or NAT!)</p>
+      </dd>
+      <dt>I started a complete downloader but still noone can download, what gives?</dt>
+      <dd>
+        <p>If your tracker and downloader are on the same machine or within the same private IP range, you need to start the downloader with the <code>--ip</code> parameter, followed by it's public IP. Otherwise "localhost" could be assumed.</p>
+      </dd>
+      <dt>What language is BitTorrent written in?</dt>
+      <dd>
+        <p><a href="http://www.python.org/">Python.</a> And it uses <a href="http://www.wxwindows.org/">wxWindows</a>
+for its GUI.</p>
+      </dd>
+      <dt>When is the Java/C/whatever implementation going to be ready?</dt>
+      <dd>
+        <p>See the <a href="http://groups.yahoo.com/group/btports/">BitTorrent ports mailing list</a>.</p>
+      </dd>
+      <dt>How do I limit the amount of bandwidth consumed by BitTorrent?</dt>
+      <dd>
+        <p>Use the <code>--max_upload_rate</code> command line parameter, which takes an upload rate in kilobytes/sec.</p>
+      </dd>
+      <dt>Does BitTorrent contain spyware or adware?</dt>
+      <dd>
+        <p>No, BitTorrent contains no spyware, adware, or any other kind of -ware.</p>
+        <p>Some warez sites are distributing spyware-wrapped versions of the BitTorrent installer. Please only download
+the BitTorrent installer from this site.</p>
+      </dd>
+      <dt>What license is BitTorrent released under?</dt>
+      <dd>
+        <p><a href="http://opensource.org/licenses/mit-license.php">MIT License</a>, which basically lets you do anything you want with it so long as you leave the license notification in the source.</p>
+      </dd>
+      <dt>How can I download on a headless machine?</dt>
+      <dd>
+        <p>There are <code>btdownloadheadless.py</code>, <code>btdownloadcurses.py</code> and others available in the source distribution.</p>
+      </dd>
+      <dt>I can't use Paypal, can I still make a donation?</dt>
+      <dd>
+        <p>You can send a check or money order to:
+<blockquote>Bram Cohen<br>
+227 Bellevue Way NE Suite 152<br>
+Bellevue, WA 98004</blockquote></p>
+      </dd>
+      <dt>Where can I find more information about BitTorrent?</dt>
+      <dd>
+        <p>If you're looking for information on where to find files downloadable using BitTorrent, try using a
+<a href="http://google.com/">search engine</a>.</p>
+        <p>If you have a development or technical support question, see the <a href="documentation.html">documentation page</a>, the <a href="http://groups.yahoo.com/group/BitTorrent/">development mailing list</a>, or join #bittorrent on irc.freenode.net. (I repeat, this channel is <em>not</em> for file distribution!)</p>
+      </dd>
+    </dl>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/bittorrent_logo.png.uu
+++ bittorrent-3.4.2/www-doc/bittorrent_logo.png.uu
@@ -0,0 +1,113 @@
+begin 644 bittorrent_logo.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C%+\1L+#*(>_2,5IX%3E&=]\]U;RN>W`&,L3;T_<6!+:M77K*
+M,L$;``LWS[_M?DQ[I!QCY`SD(?/ZH#;]H^`JT:B!1557'X5?N2,=EF.,.@/!
+M:P%[+WNGKC:J$HX2N"ZQ//-=NZ/WE!+Q*L>0JF0@:KU2Q@L\XW<TTFLV>9GE
+M]L)1O841;0G)NUW:]D2AP\H<`[Z(7E=$[S/U7I7\1`*!#:ZV%[OCDW+7C.(M
+M3.7)6".]=_([F1RC3U497O<,1*KR#(3^3QFM\/\FIQ\MU<L+K1K\FEG-.XFZ
+M<TE70^.W9MXUN/1X8^W&NT?O=A[KA/)Y[<;.O9U0H(:V/Z_]?`3OM=I9_WUT
+MQ_1C%L;6I46QY<%5E<(1@)&P.-<QN+P\Q2RK\<R"$^E9C=../7AP[$%C5N,#
+MRGBP25%4*E_C39\V>]JT!2?L;A<]<G7@)%7%?:O^1T;R)B1<*3CW<UQU\#:'
+M^&4I3BNFKBA:,;5PZJ-";#PJ?(3++T54P395.9)W:F%1T0JGV)1PUZN<8,?$
+M7,%*89,:X*8FX9J5`O/*+;D_Y^[Q=ZRN]N]-<DSJ3>J%HC1Z$Q4EZ0^\-Z#2
+MO[?7O]K?/M'?WG%SW,E*P4KE+S@F#7L50OU2JHGZ_;K&#Y4W+1._]9D`G@">
+;`)X`'O7QO]BVR,66=S/3`````$E%3D2N0F""
+`
+end
--- bittorrent-3.4.2.orig/www-doc/download.html
+++ bittorrent-3.4.2/www-doc/download.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Download</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a class="current">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a></li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+        <p>Current version: <strong>3.4.2</strong>, released on April 4, 2004.</p>
+    <p>Available downloads:</p>
+    <ul>
+      <li><a href="http://prdownloads.sourceforge.net/bittorrent/BitTorrent-3.4.2.exe?download">Windows
+installer</a> (If you don't know what you want, you probably want this).
+<center>
+<script type="text/javascript"><!--
+google_ad_client = "pub-5952109563565748";
+google_ad_width = 468;
+google_ad_height = 60;
+google_ad_format = "468x60_as";
+google_ad_channel ="";
+google_color_bg = "FFFFDF";
+google_ad_type = "text_image";
+//--></script>
+<script type="text/javascript"
+  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>
+</center>
+</li>
+      <li><a href="http://prdownloads.sourceforge.net/bittorrent/BitTorrent_OSX_3.4.2.dmg?download">Mac OS X
+image</a></li>
+      <li>Debian package: <a href="http://packages.debian.org/testing/net/bittorrent.html">testing</a> or
+        <a href="http://packages.debian.org/unstable/net/bittorrent.html">unstable</a></li>
+      <li>Red Hat package: try a <a href="http://rpmfind.net/linux/rpm2html/search.php?query=BitTorrent">search</a></li>
+      <li>Python source: 
+        <a href="http://prdownloads.sourceforge.net/bittorrent/BitTorrent-3.4.2.zip?download">zip</a>, <a
+href="http://prdownloads.sourceforge.net/bittorrent/BitTorrent-3.4.2.tar.gz?download">tar</a> or
+        <a href="http://sourceforge.net/cvs/?group_id=33044">cvs</a></li>
+      <li>To create .torrent files under Windows: <a
+href="http://prdownloads.sourceforge.net/bittorrent/completedir-1.1.exe?download">CompleteDir</a></li>      
+    </ul>
+    <p>New in 3.4.2:</p>
+    <ul>
+      <li>Fixed some bugs, including an important tracker bug
+      <li>Added 'warning message' so trackers can send non-fatal human readable messages to clients
+      <li>Fixed problem where some users got 'could not find file' message
+    </ul>
+    <p>New in 3.4.1:</p>
+    <ul>
+      <li>Client no longer complains of connection to tracker problems when transfers are still working
+      <li>Lots and lots of bandwidth savings (the 'compact' tracker parameter)
+      <li>Better support for peers with dynamic IPs (the 'key' tracker parameter)
+      <li>Lots of bug fixes
+    </ul>
+    <p>New in 3.3:</p>
+    <ul>
+      <li>Files now only get allocated as they're downloaded and don't fragment the hard drive</li>
+      <li>Large torrents no longer hose the CPU</li>
+      <li>Better network utilization and more consistent download rates</li>
+      <li>Poorly seeded torrents get out faster</li>
+      <li>Several important bug fixes</li>
+    </ul>
+    <p>New in 3.2:</p>
+    <ul>
+      <li>Better network utilization</li>
+      <li>More even and consistent download rates</li>
+      <li>Read-only files now supported for seeding</li>
+      <li>The Windows build now takes command line arguments</li>
+      <li>Several bug fixes</li>
+    </ul>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/press.html
+++ bittorrent-3.4.2/www-doc/press.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Press</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a></li>
+      <li><a class="current">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <ul>
+      <li><p>2003-03-31: "Red Hat Linux 9 is out, and as of today the ISOs are officially available to Red Hat Network subscribers ($60/yr). Or, as of right now, you can grab the same ISOs using BitTorrent." - <a href="http://slashdot.org/article.pl?sid=03/03/31/1256236">slashdot</a></p></li>
+      <li><p>2002-07-26: "How do you simulate a slashdotting? Especially when you've already shrugged off one bona fide, slashdot.org appearence?" - <a href="http://www.ntk.net/2002/07/26/">NTK</a></p></li>
+      <li><p>2002-03-19: "Finally, real P2P with brains" - <a href="http://slashdot.org/article.pl?sid=02/03/20/0143248">slashdot</a></p></li>
+      <li><p>2002-01-09: "Two new services that aim to allow the burden of file downloads to be shared between web surfers" - <a href="http://www.newscientist.com/news/news.jsp?id=ns99991761">New Scientist</a></p></li>
+      <li><p>2001-11-19: BitTorrent has received a grant from <a href="http://linuxfund.org/">linuxfund</a>.</p></li>
+      <li><p>2001-07-16: "Bram Cohen's latest project is nothing if not ambitious: a novel way to share files that he hopes will best rivals like Napster, Freenet, and Gnutella." - <a href="http://wired.com/news/culture/0,1284,45248,00.html">Wired Online</a></p></li>
+    </ul>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/protocol.html
+++ bittorrent-3.4.2/www-doc/protocol.html
@@ -0,0 +1,177 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Protocol Specification</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a>
+        <ul class="submenu">
+          <li><a href="guide.html">Guide</a></li>
+          <li><a class="current">Protocol</a></li>
+          <li><a href="http://bitconjurer.org/BitTorrent/bittorrentecon.pdf">Paper</a></li>
+        </ul>
+      </li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <p>BitTorrent is a protocol for distributing files. It identifies content by URL and is designed to integrate seamlessly with the web. Its advantage over plain HTTP is that when multiple downloads of the same file happen concurrently, the downloaders upload to each other, making it possible for the file source to support very large numbers of downloaders with only a modest increase in its load.</p>
+    <p>A BitTorrent file distribution consists of these entities:</p>
+    <ul>
+      <li>An ordinary web server</li>
+      <li>A static 'metainfo' file</li>
+      <li>A BitTorrent tracker</li>
+      <li>An 'original' downloader</li>
+      <li>The end user web browsers</li>
+      <li>The end user downloaders</li>
+    </ul>
+    <p>There are ideally many end users for a single file.</p>
+    <p>To start serving, a host goes through the following steps:</p>
+    <ol>
+      <li>Start running a tracker (or, more likely, have one running already).</li>
+      <li>Start running an ordinary web server, such as apache, or have one already.</li>
+      <li>Associate the extension <code>.torrent</code> with mimetype <code>application/x-bittorrent</code> on their web server (or have done so already).</li>
+      <li>Generate a metainfo (.torrent) file using the complete file to be served and the URL of the tracker.</li>
+      <li>Put the metainfo file on the web server.</li>
+      <li>Link to the metainfo (.torrent) file from some other web page.</li>
+      <li>Start a downloader which already has the complete file (the 'origin').</li>
+    </ol>
+    <p>To start downloading, a user does the following:</p>
+    <ol>
+      <li>Install BitTorrent (or have done so already).</li>
+      <li>Surf the web.</li>
+      <li>Click on a link to a .torrent file.</li>
+      <li>Select where to save the file locally, or select a partial download to resume.</li>
+      <li>Wait for download to complete.</li>
+      <li>Tell downloader to exit (it keeps uploading until this happens).</li>
+    </ol>
+    <p>The connectivity is as follows:</p>
+    <ul>
+      <li>The web site is serving up static files as normal, but kicking off the BitTorrent helper app on the clients.</li>
+      <li>The tracker is receiving information from all downloaders and giving them random lists of peers. This is done over HTTP or HTTPS.</li>
+      <li>Downloaders are periodically checking in with the tracker to keep it informed of their progress, and are uploading to and downloading from each other via direct connections. These connections use the BitTorrent peer protocol, which operates over TCP.</li>
+      <li>The origin is uploading but not downloading at all, since it has the entire file. The origin is necessary to get the entire file into the network. Often for popular downloads the origin can be taken down after a while since several downloads may have completed and been left running indefinitely.</li>
+    </ul>
+    <p>Metainfo file and tracker responses are both sent in a simple, efficient, and extensible format called bencoding (pronounced 'bee encoding'). Bencoded messages are nested dictionaries and lists (as in Python), which can contain strings and integers. Extensibility is supported by ignoring unexpected dictionary keys, so additional optional ones can be added later.</p>
+    <p>Bencoding is done as follows:</p>
+    <ul>
+      <li>Strings are length-prefixed base ten followed by a colon and the string. For example <code>4:spam</code> corresponds to 'spam'.</li>
+      <li>Integers are represented by an 'i' followed by the number in base 10 followed by an 'e'. For example <code>i3e</code> corresponds to 3 and <code>i-3e</code> corresponds to -3. Integers have no size limitation. <code>i-0e</code> is invalid. All encodings with a leading zero, such as <code>i03e</code>, are invalid, other than <code>i0e</code>, which of course corresponds to 0.</li>
+      <li>Lists are encoded as an 'l' followed by their elements (also bencoded) followed by an 'e'. For example <code>l4:spam4:eggse</code> corresponds to ['spam', 'eggs'].</li>
+      <li>Dictionaries are encoded as a 'd' followed by a list of alternating keys and their corresponding values followed by an 'e'. For example, <code>d3:cow3:moo4:spam4:eggse</code> corresponds to {'cow': 'moo', 'spam': 'eggs'} and <code>d4:spaml1:a1:bee</code> corresponds to {'spam': ['a', 'b']} . Keys must be strings and appear in sorted order (sorted as raw strings, not alphanumerics).</li>
+    </ul>
+    <p>Metainfo files are bencoded dictionaries with the following keys:</p>
+    <dl>
+      <dt><code>announce</code></dt>
+      <dd>
+        <p>The URL of the tracker.</p>
+      </dd>
+    <dt><code>info</code></dt>
+    <dd>
+      <p>This maps to a dictionary, with keys described below.</p>
+      <p>The <code>name</code> key maps to a string which is the suggested name to save the file (or directory) as. It is purely advisory.</p>
+      <p><code>piece length</code> maps to the number of bytes in each piece the file is split into. For the purposes of transfer, files are split into fixed-size pieces which are all the same length except for possibly the last one which may be truncated. Piece length is almost always a power of two, most commonly 2<sup>18</sup> = 256 K (BitTorrent prior to version 3.2 uses 2<sup>20</sup> = 1 M as default).</p>
+      <p><code>pieces</code> maps to a string whose length is a multiple of 20. It is to be subdivided into strings of length 20, each of which is the SHA1 hash of the piece at the corresponding index.</p>
+      <p>There is also a key <code>length</code> or a key <code>files</code>, but not both or neither. If <code>length</code> is present then the download represents a single file, otherwise it represents a set of files which go in a directory structure.</p>
+      <p>In the single file case, <code>length</code> maps to the length of the file in bytes.</p>
+      <p>For the purposes of the other keys, the multi-file case is treated as only having a single file by concatenating the files in the order they appear in the files list. The files list is the value <code>files</code> maps to, and is a list of dictionaries containing the following keys:</p>
+      <dl>
+        <dt><code>length</code></dt>
+        <dd>The length of the file, in bytes.</dd>
+        <dt><code>path</code></dt>
+        <dd>A list of strings corresponding to subdirectory names, the last of which is the actual file name (a zero length list is an error case).</dd>
+      </dl>
+      <p>In the single file case, the <code>name</code> key is the name of a file, in the muliple file case, it's the name of a directory.</p>
+    </dd>
+    </dl>
+    <p>Tracker queries are two way. The tracker receives information via HTTP GET parameters and returns a bencoded message. Note that although the current tracker implementation has its own web server, the tracker could run very nicely as, for example, an apache module.</p>
+    <p>Tracker GET requests have the following keys:</p>
+    <dl>
+      <dt><code>info_hash</code></dt>
+      <dd>
+        <p>The 20 byte sha1 hash of the bencoded form of the <code>info</code> value from the metainfo file. Note that this is a substring of the metainfo file. This value will almost certainly have to be escaped.</p>
+      </dd>
+      <dt><code>peer_id</code></dt>
+      <dd>
+        <p>A string of length 20 which this downloader uses as its id. Each downloader generates its own id at random at the start of a new download. This value will also almost certainly have to be escaped.</p>
+      </dd>
+      <dt><code>ip</code></dt>
+      <dd>
+        <p>An optional parameter giving the IP (or dns name) which this peer is at. Generally used for the origin if it's on the same machine as the tracker.</p>
+      </dd>
+      <dt><code>port</code></dt>
+      <dd>
+        <p>The port number this peer is listening on. Common behavior is for a downloader to try to listen on port 6881 and if that port is taken try 6882, then 6883, etc. and give up after 6889.</p>
+      </dd>
+      <dt><code>uploaded</code></dt>
+      <dd>
+        <p>The total amount uploaded so far, encoded in base ten ascii.</p>
+      </dd>
+      <dt><code>downloaded</code></dt>
+      <dd>
+        <p>The total amount downloaded so far, encoded in base ten ascii.</p>
+      </dd>
+      <dt><code>left</code></dt>
+      <dd>
+        <p>The number of bytes this peer still has to download, encoded in base ten ascii. Note that this can't be computed from downloaded and the file length since it might be a resume, and there's a chance that some of the downloaded data failed an integrity check and had to be re-downloaded.</p>
+      </dd>
+      <dt><code>event</code></dt>
+      <dd>
+        <p>This is an optional key which maps to <code>started</code>, <code>completed</code>, or <code>stopped</code> (or empty, which is the same as not being present). If not present, this is one of the announcements done at regular intervals. An announcement using <code>started</code> is sent when a download first begins, and one using <code>completed</code> is sent when the download is complete. No <code>completed</code> is sent if the file was complete when started. Downloaders send an announcement using 'stopped' when they cease downloading.</p>
+      </dd>
+    </dl>
+    <p>Tracker responses are bencoded dictionaries. If a tracker response has a key <code>failure reason</code>, then that maps to a human readable string which explains why the query failed, and no other keys are required. Otherwise, it must have two keys: <code>interval</code>, which maps to the number of seconds the downloader should wait between regular rerequests, and <code>peers</code>. <code>peers</code> maps to a list of dictionaries corresponding to peers, each of which contains the keys <code>peer id</code>, <code>ip</code>, and <code>port</code>, which map to the peer's self-selected ID, IP address or dns name as a string, and port number, respectively. Note that downloaders may rerequest on nonscheduled times if an event happens or they need more peers.</p>
+    <p>If you want to make any extensions to metainfo files or tracker queries, please coordinate with Bram Cohen to make sure that all extensions are done compatibly.</p>
+    <p>BitTorrent's peer protocol operates over TCP. It performs efficiently without setting any socket options.</p>
+    <p>Peer connections are symmetrical. Messages sent in both directions look the same, and data can flow in either direction.</p>
+    <p>The peer protocol refers to pieces of the file by index as described in the metainfo file, starting at zero. When a peer finishes downloading a piece and checks that the hash matches, it announces that it has that piece to all of its peers.</p>
+    <p>Connections contain two bits of state on either end: choked or not, and interested or not. Choking is a notification that no data will be sent until unchoking happens. The reasoning and common techniques behind choking are explained later in this document.</p>
+    <p>Data transfer takes place whenever one side is interested and the other side is not choking. Interest state must be kept up to date at all times - whenever a downloader doesn't have something they currently would ask a peer for in unchoked, they must express lack of interest, despite being choked. Implementing this properly is tricky, but makes it possible for downloaders to know which peers will start downloading immediately if unchoked.</p>
+    <p>Connections start out choked and not interested.</p>
+    <p>When data is being transferred, downloaders should keep several piece requests queued up at once in order to get good TCP performance (this is called 'pipelining'.) On the other side, requests which can't be written out to the TCP buffer immediately should be queued up in memory rather than kept in an application-level network buffer, so they can all be thrown out when a choke happens.</p>
+    <p>The peer wire protocol consists of a handshake followed by a never-ending stream of length-prefixed messages. The handshake starts with character ninteen (decimal) followed by the string 'BitTorrent protocol'. The leading character is a length prefix, put there in the hope that other new protocols may do the same and thus be trivially distinguishable from each other.</p>
+    <p>All later integers sent in the protocol are encoded as four bytes big-endian.</p>
+    <p>After the fixed headers come eight reserved bytes, which are all zero in all current implementations. If you wish to extend the protocol using these bytes, please coordinate with Bram Cohen to make sure all extensions are done compatibly.</p>
+    <p>Next comes the 20 byte sha1 hash of the bencoded form of the <code>info</code> value from the metainfo file. (This is the same value which is announced as info_hash to the tracker, only here it's raw instead of quoted here). If both sides don't send the same value, they sever the connection. The one possible exception is if a downloader wants to do multiple downloads over a single port, they may wait for incoming connections to give a download hash first, and respond with the same one if it's in their list.</p>
+    <p>After the download hash comes the 20-byte peer id which is reported in tracker requests and contained in peer lists in tracker responses. If the receiving side's peer id doesn't match the one the initiating side expects, it severs the connection.</p>
+    <p>That's it for handshaking, next comes an alternating stream of length prefixes and messages. Messages of length zero are keepalives, and ignored. Keepalives are generally sent once every two minutes, but note that timeouts can be done much more quickly when data is expected.</p>
+    <p>All non-keepalive messages start with a single byte which gives their type. The possible values are:</p>
+    <ul>
+      <li>0 - choke</li>
+      <li>1 - unchoke</li>
+      <li>2 - interested</li>
+      <li>3 - not interested</li>
+      <li>4 - have</li>
+      <li>5 - bitfield</li>
+      <li>6 - request</li>
+      <li>7 - piece</li>
+      <li>8 - cancel</li>
+    </ul>
+    <p>'choke', 'unchoke', 'interested', and 'not interested' have no payload.</p>
+    <p>'bitfield' is only ever sent as the first message. Its payload is a bitfield with each index that downloader has sent set to one and the rest set to zero. Downloaders which don't have anything yet may skip the 'bitfield' message. The first byte of the bitfield corresponds to indices 0 - 7 from high bit to low bit, respectively. The next one 8-15, etc. Spare bits at the end are set to zero.</p>
+    <p>The 'have' message's payload is a single number, the index which that downloader just completed and checked the hash of.</p>
+    <p>'request' messages contain an index, begin, and length. The last two are byte offsets. Length is generally a power of two unless it gets truncated by the end of the file. All current implementations use 2<sup>15</sup>, and close connections which request an amount greater than 2<sup>17</sup>.</p>
+    <p>'cancel' messages have the same payload as request messages. They are generally only sent towards the end of a download, during what's called 'endgame mode'. When a download is almost complete, there's a tendency for the last few pieces to all be downloaded off a single hosed modem line, taking a very long time. To make sure the last few pieces come in quickly, once requests for all pieces a given downloader doesn't have yet are currently pending, it sends requests for everything to everyone it's downloading from. To keep this from becoming horribly inefficient, it sends cancels to everyone else every time a piece arrives.</p>
+    <p>'piece' messages contain an index, begin, and piece. Note that they are correlated with request messages implicitly. It's possible for an unexpected piece to arrive if choke and unchoke messages are sent in quick succession and/or transfer is going very slowly.</p>
+    <p>Downloaders generally download pieces in random order, which does a reasonably good job of keeping them from having a strict subset or superset of the pieces of any of their peers.</p>
+    <p>Choking is done for several reasons. TCP congestion control behaves very poorly when sending over many connections at once. Also, choking lets each peer use a tit-for-tat-ish algorithm to ensure that they get a consistent download rate.</p>
+    <p>The choking algorithm described below is the currently deployed one. It is very important that all new algorithms work well both in a network consisting entirely of themselves and in a network consisting mostly of this one.</p>
+    <p>There are several criteria a good choking algorithm should meet. It should cap the number of simultaneous uploads for good TCP performance. It should avoid choking and unchoking quickly, known as 'fibrillation'. It should reciprocate to peers who let it download. Finally, it should try out unused connections once in a while to find out if they might be better than the currently used ones, known as optimistic unchoking.</p>
+    <p>The currently deployed choking algorithm avoids fibrillation by only changing who's choked once every ten seconds. It does reciprocation and number of uploads capping by unchoking the four peers which it has the best download rates from and are interested. Peers which have a better upload rate but aren't interested get unchoked and if they become interested the worst uploader gets choked. If a downloader has a complete file, it uses its upload rate rather than its download rate to decide who to unchoke.</p>
+    <p>For optimistic unchoking, at any one time there is a single peer which is unchoked regardless of it's upload rate (if interested, it counts as one of the four allowed downloaders.) Which peer is optimistically unchoked rotates every 30 seconds. To give them a decent chance of getting a complete piece to upload, new connections are three times as likely to start as the current optimistic unchoke as anywhere else in the rotation.</p>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/guide.html
+++ bittorrent-3.4.2/www-doc/guide.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: File Server's Guide</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a>
+        <ul class="submenu">
+          <li><a class="current">Guide</a></li>
+          <li><a href="protocol.html">Protocol</a></li>
+          <li><a href="http://bitconjurer.org/BitTorrent/bittorrentecon.pdf">Paper</a></li>
+        </ul>
+      </li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <p>This is a how-to for making files publicly available via BitTorrent, and it's primarily written for people running Windows. But even if you're not running Windows, the steps you need to do are quite similar, and you can find further instructions in <code>README.txt</code> in the source distribution.</p>
+    <ol>
+      <li><p>Get a tracker</p>
+        <p>You need a tracker for downloaders to be able to find each other. Because of this central role, a tracker should be on a very reliable Internet connection. Therefore it's <em>strongly</em> recommended that you use a tracker running on a <em>stable</em> <em>server</em> system (as opposed to your <em>unstable</em> Windows <em>desktop</em> system).</p>
+        <p>Everyone else making files available via BitTorrent is using a tracker, and a single tracker can handle a huge number of files with very little load. So you could ask others for the URL of their trackers. (Tracker URL is contained in .torrent files.) However, you should <em>never</em> use anyone's tracker without the owner's permission. That would be intrusive, for the least.</p>
+        <p>If you want to set up your own tracker, follow the instructions in the <code>README.txt</code> in the source distribution.</p>
+      </li>
+      <li><p>Get a web server</p>
+        <p>Any web server will do, but you must associate the extension <code>.torrent</code> with the mimetype <code>application/x-bittorrent</code>. You should ask your web server's administrator to set it up.</p>
+        <p>If you are the web server administrator, either add the line</p>
+        <blockquote><p><code>AddType application/x-bittorrent .torrent</code></p></blockquote>
+        <p>To <code>httpd.conf</code>, or</p>
+        <blockquote><p><code>application/x-bittorrent torrent</code></p></blockquote>
+        <p>to <code>mime.types</code>.</p>
+      </li>
+      <li><p>Make the .torrent files</p>
+        <p>Download and install CompleteDir from the <a href="download.html">download page</a>. It will install under <code>Start > All Programs > CompleteDir</code>.</p>
+        <p>Next, take all the files you would like to make .torrent's for and put them in a single directory. If there's a whole directory you'd like to make a single .torrent for, make it a subdirectory. If you only want to make a .torrent of one file, put it in a directory by itself.</p>
+        <p>Then run CompleteDir. Click on 'Select' and select the directory which you put all the files in. Enter the URL of the tracker you're using in the 'Announce URL' field. You can leave the piece size at the default value. (Smaller piece sizes cause better performance, but make bigger .torrent files.)</p>
+        <p>Click 'Make' and .torrent files will be created. For a file named <code>spam</code>, a file named <code>spam.torrent</code> will be created.</p>
+        <p>If you want to create more .torrent files, you don't have to remove the old ones, just add the new files to the directory and click 'Make' again. CompleteDir checks for existing .torrent's and doesn't regenerate them.</p>
+      </li>
+      <li><p>Put the .torrent files on your web server</p>
+        <p>Do this however you normally put files on your web server, for .torrent files are just ordinary static files.</p>
+      </li>
+      <li><p>Install BitTorrent on your machine</p>
+        <p>Given that you're reading this you've probably installed BitTorrent already, but if not get it from the <a href="download.html">download page</a>.</p>
+      </li>
+      <li><p>Start a complete downloader</p>
+        <p>For people to be able to download it is necessary that there be at least one downloader which has everything to begin with. Enter the URL you put the .torrent file at into your web browser, and select the complete local file (or directory) as the location to save to. After checking that the integrity of the file(s), the downloader will report that the download has succeeded, and wait for peers to upload to.</p>
+        <p>If there are multiple files you'd like to distribute, and they're not grouped into a single .torrent, you have to start a separate downloader for each .torrent file.</p>
+        <p>It is essential that your complete downloader be able to receive incoming connections. If you're behind a firewall or NAT, you should forward ports 6881 through 6889 to your machine. (The first downloader uses 6881, the next 6882, etc. The range is configurable.)</p>
+      </li>
+      <li><p>Link to the .torrent file</p>
+        <p>You can link to the .torrent file using an ordinary hyperlink. Sending the URL in email also works.</p>
+      </li>
+    </ol>
+    <p>Have fun!</p>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/index.html
+++ bittorrent-3.4.2/www-doc/index.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>The Official BitTorrent Home Page</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a class="current">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a></li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+
+    <p>Welcome to the <strong>official</strong>
+BitTorrent web site!</p>
+    <ul>
+      <li>2004-04-04: 3.4.2, probably the last release before 3.5, is now out, download <a
+href="download.html">here</a>.
+      <li>2004-03-11: 3.4.1, which fixes all the major problems in 3.4 and has yet even more tracker bandwidth
+savings, 
+is now out.
+      <li>2003-09-24: Long awaited release 3.3 is out. Everybody please upgrade</li>
+      <li>2003-09-24: New website launched</li>
+    </ul>
+    <p>If you are new to BitTorrent, be sure to read the <a href="introduction.html">Introduction</a> to understand how BitTorrent works. If you have any questions, please refer to the <a href="FAQ.html">FAQ</a>.</p>
+    <hr />
+    <p class="notes">BitTorrent, its logo and its web site are all copyright &copy; 2001-2003 <a href="http://bitconjurer.org/">Bram Cohen</a>. The logo and the web site are designed by 
+<!-- <a href="http://henrypijames.tripod.com/">Henry 'Pi' James</a>-->
+Henry 'Pi' James. The web site is compliant to XHTML 1.1 and CSS 2.</p>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/donate.html
+++ bittorrent-3.4.2/www-doc/donate.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Donate!</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a href="introduction.html">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a></li>
+      <li><a href="press.html">Press</a></li>
+      <li><a class="current">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <img align="right" src="http://f.scarywater.net/bram/greet10.jpg" alt="Bram Cohen" />
+    <p>Hi! I'm Bram Cohen, the author of BitTorrent.</p>
+    <p>I maintain BitTorrent for a living. This is my only job.</p>
+    <p>If you use BitTorrent and would like to help support it please make a donation.</p>
+    <form id="donate" action="https://www.paypal.com/cgi-bin/webscr" method="post">
+      <p>
+        Donate (via PayPal):
+        <input type="radio" name="amount" value="20.00" checked="checked" /> $20
+        <input type="radio" name="amount" value="10.00" /> $10
+        <input type="radio" name="amount" value="" /> other
+        <input class="button" type="submit" value="Donate!" />
+        <input type="hidden" name="cmd" value="_xclick" />
+        <input type="hidden" name="business" value="donate@bitconjurer.org" />
+        <input type="hidden" name="item_name" value="BitTorrent" />
+        <input type="hidden" name="no_shipping" value="1" />
+      </p>
+    </form>
+    <p>If you can't use Paypal, you can send a check or money order to:</p>
+    <p>Bram Cohen<br>
+       227 Bellevue Way NE #152<br>
+       Bellevue, WA 98004</p><br clear="both">
+    <p><img align="right" src="http://bitconjurer.org/BitTorrent/bittorrent_shirt.jpg"><center><font color="red" size="+3" />New! New!</font><br>
+    Now you can get a cool-looking <a href="http://www.jinx.com/scripts/details.asp?affid=-1&productID=291">BitTorrent shirt</a>! Only $14.95, it
+helps support BitTorrent and you get a shirt too! <a href="http://www.jinx.com/scripts/details.asp?affid=-1&productID=291">Order
+here</a>.</center></p>
+  </div><!-- #main -->
+</body>
+</html>
--- bittorrent-3.4.2.orig/www-doc/introduction.html
+++ bittorrent-3.4.2/www-doc/introduction.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+  <link rel="stylesheet" type="text/css" href="http://bitconjurer.org/BitTorrent/default.css" />
+  <link rel="shortcut icon" href="http://bitconjurer.org/BitTorrent/favicon.ico" />
+  <title>BitTorrent: Introduction</title>
+</head>
+
+<body>
+  <div id="side">
+    <img id="logo" src="bittorrent_logo.png" alt="BitTorrent Logo" />
+    <ul id="menu">
+      <li><a href="index.html">News</a></li>
+      <li><a class="current">Introduction</a></li>
+      <li><a href="download.html">Download</a></li>
+      <li><a href="FAQ.html">FAQ</a></li>
+      <li><a href="documentation.html">Documentation</a></li>
+      <li><a href="press.html">Press</a></li>
+      <li><a href="donate.html">Donate!</a></li>
+    </ul>
+  </div><!-- #side -->
+  <div id="main">
+    <p>You have a <em>great product,</em> many
+customers, and are delivering your product to hordes of happy customers online. Serving large files creates problems of scaling, flash crowds, and reliability. As you grow, they become more central to your business, but your bandwidth costs go up as well. It's a <em>vicious cycle.</em></p>
+    <p>There is a solution. <em>BitTorrent</em> is a simple software product which addresses all of these problems.</p>
+    <p>The key to cheap file distribution is to tap the unutilized upload capacity of your customers. It's <em>free.</em> Their contribution grows at the same rate as their demand, creating <em>limitless scalability</em> for a fixed cost.</p>
+    <div class="center">
+      <p class="notes">Problem: more customers require more bandwidth</p>
+      <img src="http://f.scarywater.net/bram/central.png" alt="Problem" longdesc="more customers require more bandwidth" />
+      <p class="notes">The BitTorrent Solution: customers help distribute content</p>
+      <img src="http://f.scarywater.net/bram/torrent.png" alt="Solution" longdesc="customers help distribute content" />
+    </div><!-- .center -->
+    <p>BitTorrent is not just a concept, but has a <a href="download.html">functioning implementation</a>, already capable of swarming downloads across unreliable networks. This is the result of over two years of intensive development.</p>
+  </div><!-- #main -->
+</body>
+</html>