![]() |
|
|||||||
| Register | FAQ | The Twelve Commandments | Members List | Find the Best VPN | Today's Posts | Search |
| General Gnutella Development Discussion For general discussion about Gnutella development. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am trying to inflate a negotiated deflated Gnutella TCP connection. The way I am going about this is the following: e.g. direction = client to server: 1. Append packet to buffered stream. 2. pass stream to inflate() 3. if returns 0 (Z_OK) (successfully begun inflating but not finished), wait for next packet 4. else if returns Z_STREAM_END, pass inflated stream to function to parse Gnutella message(s). clean out buffer. I have gone through numerous deflated TCP connections with this method, but inflate() only ever returns 0 (Z_OK). Therefore I never reach the end of stream, even though this TCP connection is finished with a handshake. So I am never able to parse the Gnutella content. ![]() Am I going about this the correct way? If not, where am I going wrong? If I am, why do I never reach end of stream? Any help would be appreciated. Thanks ,Cathal |
|
#2
|
||||
|
||||
|
I assume that#s because there isn't an end of the stream: Gnutella servents keep using the same stream for more data.
Do you get valid messages when you pass parts of the inflated stream to the parser?
__________________
-> put this banner into your own signature! <- -- Erst im Spiel lebt der Mensch. Nur ludantaj homoj vivas. GnuFU.net - Gnutella For Users Draketo.de - Shortstories, Poems, Music and strange Ideas. |
|
#3
|
|||
|
|||
|
Thanks for your reply.
Yes; if I wait until the TCP connection is terminated, then pass the incomplete inflated stream to a handler function: it does produce valid messages. My next question is: how can I continuously process these messages without having to wait until the end of the connection? i.e. Currently, if I pass the stream to a handler function after x packets (for example), the next time I call inflate() with the stream beginning at packet(x+1), it returns Z_STREAM_ERROR. I assume this return value will result in an invalid inflated stream. I hope I have explained this clearly enough. Thanks for your help. |
|
#4
|
||||
|
||||
|
Quote:
Best wishes, Arne
__________________
-> put this banner into your own signature! <- -- Erst im Spiel lebt der Mensch. Nur ludantaj homoj vivas. GnuFU.net - Gnutella For Users Draketo.de - Shortstories, Poems, Music and strange Ideas. |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No returns on my searches | Celestian1 | General Windows Support | 1 | June 2nd, 2008 11:50 PM |
| Message stream going out of sync | nodgie | General Gnutella Development Discussion | 1 | November 29th, 2006 01:32 PM |
| file stream error-----> What is this? | viking witch | XoloX Feature Request | 2 | November 25th, 2001 08:40 PM |
| File stream error 1??? | Unregistered | User Experience | 1 | October 5th, 2001 02:39 AM |
| write stream error | Unregistered | Support: General | 0 | September 20th, 2001 11:16 PM |