Gnutella protocol trouble

Revex

New member
I'm having some trouble trying to get my client to connect to the network. I am able to get as far as sending "GNUTELLA CONNECT/0.4\n\n" but after that I get a messed up query and get disconnected. I can't send anything after the connect line or I get dropped even faster! Am I missing something?
 
Well the procedure is -

GNUTELLA CONNECT/0.4\n\n

you should get back

GNUTELLA OK

At this point you are connected. Usually I send a ping right after I receive the "GNUTELLA OK" message. After that you will be reading (and usually writing) data from the socket/connection. Initially, I just read all data in and printed it (however you want - hex, decimal, ascii). Later on, I wrote functions that would read and parse this data. After you send the ping you may receive pongs, queries, and sometimes misdirected or bad packers (misdirected queryhits and pushes, which you shouldn't get since you hadn't sent or forwarded anything aside from a ping, or possibly bad packets).
 
ugh this is frustrating.

I send:
GNUTELLA CONNECT/0.6\r\n
User-Agent: Angel\r\n\r\n

I receive:
GNUTELLA/0.6 200 OK\r\n
User-Agent: BearShare 2.4.4\r\n
Pong-Caching: 0.1\r\n
Hops-Flow: 1.0\r\n
Remote-IP: 64.103.153.29\r\n\r\n

I send:
GNUTELLA/0.6 200 OK\r\n\r\n

-----------------
I receive a query: TTL - 1; Hops - 0
Payload: ??
 
Back
Top