[BitTorrent] Re: been gone - what's up with this tracker?

postmaxin egroups at crackerjack.net
Sat Jun 5 13:56:47 EDT 2004


--- In BitTorrent at yahoogroups.com, Justin Cormack <justin at s...> wrote:

> > That's gzip content encoding.
> I cant see in the http spec any way to stop a server sending you this (I
> suppose someone has actually gzipped the files on the server. Cant
save much
> space though - about 100 bytes in 170k on a quick test... shasums dont
> compress).

 An HTTP server is not supposed to send content gzipped unless the client
has sent an "Accept-Encoding: gzip" header in it's request. If you (or
your 
WWW library) is not sending "Accept-Encoding: gzip" and you are still
getting a gzipped reply, the HTTP server is faulty (although
understandably 
so; gzip encoding has been a part of the HTTP protocol pretty much
since the 
beginning...)

> > The HTTP compact tracker protocol.
> Is there a descriptions of this somewhere? I cant find it in the mail   
> archive or via google (just announcements that it has been implemented).

 Essentially, the peers are sent as a string in the bencode instead of a
hash, and this string has 6 bytes for every peer; the first four bytes
being
the peer's IP address (in intel-endian host byte order, NOT network
order),
and the second two being the peer's port (again, in intel-endian host byte
order).

 Paranoid code to do this:

int bt_peer2compact(apr_pool_t* p, bt_peer* peer, char** result)
{
 char* rv = NULL;
 u_int32_t ip = ntohl(peer->address.sin_addr.s_addr);
 u_int16_t port = ntohs(peer->address.sin_port);   
 rv = apr_palloc(p, sizeof(ip) + sizeof(port) + 1);
 memcpy(rv, &ip, sizeof(ip));
 memcpy(&(rv[sizeof(ip)]), &port, sizeof(port));
 rv[sizeof(ip) + sizeof(port)] = 0;
 *result = rv;
 return sizeof(ip) + sizeof(port);
}

 Cheers,
  Tyler




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dkFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
     BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the BitTorrent mailing list