[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
WWW library) is not sending "Accept-Encoding: gzip" and you are still
getting a gzipped reply, the HTTP server is faulty (although
so; gzip encoding has been a part of the HTTP protocol pretty much
since the 

> > 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
the peer's IP address (in intel-endian host byte order, NOT network
and the second two being the peer's port (again, in intel-endian host byte

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


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!

Yahoo! Groups Links

<*> To visit your group on the web, go to:

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

<*> Your use of Yahoo! Groups is subject to:

More information about the BitTorrent mailing list