Gnutella Forums  

Go Back   Gnutella Forums > Gnutella News and Gnutelliums Forums > General Gnutella Development Discussion
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

General Gnutella Development Discussion For general discussion about Gnutella development.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old September 15th, 2009
thp thp is offline
Apprentice
 
Join Date: September 15th, 2009
Posts: 8
thp is flying high
Default bad request

Hello, I'm still getting Bad Request of my Get querry and I have no idear
what's wrong. My Get querry looks like this:

GET /get/584/Sex%20Pistols%20-%20Pretty%20Vacant.mp3 HTTP/1.1
User-Agent: Gnutella/0.6
Host:12.34.5.67:7474
Connection: Keep-Alive
Range: bytes=0-

Most of the time it works fine, but somtimes I get 400 Bad Request, so there
is mayby somthing wrong.
And how are the exactly rules for URLEncoding i'm still not sure what to make with
space '+' or '%20' ?

Thank You

thp
Reply With Quote
  #2 (permalink)  
Old September 15th, 2009
arne_bab's Avatar
Draketo, small dragon.
 
Join Date: May 31st, 2002
Location: Heidelberg, Germany
Posts: 1,881
arne_bab is a great assister to others; your light through the dark tunnel
Default

Do the failures still occur when you escape spaces with "+"?

Which programming language do you use?
__________________

-> 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.
Reply With Quote
  #3 (permalink)  
Old September 16th, 2009
thp thp is offline
Apprentice
 
Join Date: September 15th, 2009
Posts: 8
thp is flying high
Default

Hello,

The failures still occurs when i escape spaces with "+" or with "%20" it seems
it makes no differences. I use java as programming language. at first i tried
the java URLEncoder(String, String), but i'm not sure if this is the right thing so i made my own but i don't know the exact rules for Gnutella encoding is there a list somwhere? The java encoder escapes spaces with "+".

Thank you very much

thp
Reply With Quote
  #4 (permalink)  
Old September 16th, 2009
arne_bab's Avatar
Draketo, small dragon.
 
Join Date: May 31st, 2002
Location: Heidelberg, Germany
Posts: 1,881
arne_bab is a great assister to others; your light through the dark tunnel
Default

The Gnutella specification is at GDF - LimeWire

Downloading is described at File Transfer - LimeWire

(but it might be outdated, see below)

which points to RFC 2616 (HTTP 1.1) http://www.ietf.org/rfc/rfc2616.txt

But since changing the escaping doesn't change the result, it doesn't look like that's the reason.

Maybe a look into the Phex source can help you:
https://phex.svn.sourceforge.net/svn...eDownload.java

...

damn, I see it: You don't request by sha1 URN.

IIRC, the URI in the get request should be like

Code:
/uri-res/N2R?urn:sha1:GIVPHMUG6LZQPTKJ6ELMQDXBN7BZS354
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.
Reply With Quote
  #5 (permalink)  
Old September 16th, 2009
thp thp is offline
Apprentice
 
Join Date: September 15th, 2009
Posts: 8
thp is flying high
Default

Hello arne_bab,

This seems right, but i don't know how to ad or replace this in my get request can you please show me a complet example. I made a few experiments but did not find the solution.

Thank you very much

thp
Reply With Quote
  #6 (permalink)  
Old September 16th, 2009
arne_bab's Avatar
Draketo, small dragon.
 
Join Date: May 31st, 2002
Location: Heidelberg, Germany
Posts: 1,881
arne_bab is a great assister to others; your light through the dark tunnel
Default

GET /uri-res/N2R?urn:sha1:GIVPHMUG6LZQPTKJ6ELMQDXBN7BZS354 HTTP/1.1
User-Agent: Your Client!
Host:12.34.5.67:7474
Connection: Keep-Alive
Range: bytes=0-

For this you have to have the sha1 hash of the file in Base32, UPPERCASE, but it comes in every query reply, so you should already have received it before you request anything.
__________________

-> 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.
Reply With Quote
  #7 (permalink)  
Old September 16th, 2009
thp thp is offline
Apprentice
 
Join Date: September 15th, 2009
Posts: 8
thp is flying high
Default

Hi,

This works fine now, the `HTTP/1.1 part` was my mistake . And i don't need URLEncoding anymore! Is the old `Get /get/...` line now completly
replaced?

Thank you very much

thp
Reply With Quote
  #8 (permalink)  
Old September 17th, 2009
arne_bab's Avatar
Draketo, small dragon.
 
Join Date: May 31st, 2002
Location: Heidelberg, Germany
Posts: 1,881
arne_bab is a great assister to others; your light through the dark tunnel
Default

I'm glad to hear that!

Since Phex still has code to handle the /get/ style requests (as it seems others have, too), I think it wasn't completely replaced, but it is completely obsolete, as requesting by sha1 is the only way to be sure that you get the right file. Since you likely will want to implement the DownloadMesh and Partial Filesharing, you'll need to use that anyway

What you definitely need is a correct Vendor String. Without that you'll get disconnected quickly.

Good luck with your client!
(btw: can I find it somewhere? and is it free software?)
__________________

-> 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.
Reply With Quote
  #9 (permalink)  
Old September 20th, 2009
Novicius
 
Join Date: September 20th, 2009
Posts: 1
clocksun is flying high
Default

what programming launguage do u use
Reply With Quote
  #10 (permalink)  
Old September 20th, 2009
thp thp is offline
Apprentice
 
Join Date: September 15th, 2009
Posts: 8
thp is flying high
Default

if you mean me,
I use java as a programming language.

thp
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: https://www.gnutellaforums.com/general-gnutella-development-discussion/93586-bad-request.html
Posted By For Type Date
SocialBookmark ~Aoi-Sora~: ??: sharing This thread Refback June 8th, 2011 06:08 PM


All times are GMT -7. The time now is 11:01 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.