Hi all.

I have been chasing down a little bug that was keeping me
from using freeamp to pull mp3 files off a web server.
The odd part was that it worked just fine with winamp
but when I connected with freeamp the webserver puked
saying the GET line was invalid.

At any rate, I was able to get the GET method sent
out by freeamp to work with the sever by adding a
\r before the \n in the GET line. I think the RFC
says that you need both \r and \n, but there are
at least some web servers that are really picky
about this. This patch was enough to get things
working. It would really be better to add a \r
to all the header bits that just use \n now, but
I will leave that up to you developers.

Mo DeJong  
Red Hat Inc


Index: base/src/downloadmanager.cpp
===================================================================
RCS file: /src/repository/freeamp/base/src/downloadmanager.cpp,v
retrieving revision 1.37
diff -u -r1.37 downloadmanager.cpp
--- base/src/downloadmanager.cpp        2000/08/23 17:15:35     1.37
+++ base/src/downloadmanager.cpp        2000/08/26 01:14:45
@@ -775,7 +775,7 @@
 
             if(IsntError(result))
             {
-                const char* kHTTPQuery = "GET %s HTTP/1.1\n"
+                const char* kHTTPQuery = "GET %s HTTP/1.1\r\n"
                                          "Host: %s\n"
                                          "Accept: */*\n" 
                                          "User-Agent: FreeAmp/%s\n";
Index: base/src/updatemanager.cpp
===================================================================
RCS file: /src/repository/freeamp/base/src/updatemanager.cpp,v
retrieving revision 1.15
diff -u -r1.15 updatemanager.cpp
--- base/src/updatemanager.cpp  2000/06/22 15:13:35     1.15
+++ base/src/updatemanager.cpp  2000/08/26 01:14:46
@@ -80,7 +80,7 @@
 const char* kUpdateServer = BRANDING_UPDATE_SERVER;
 const char* kUpdatePath = BRANDING_UPDATE_PATH;
 const char* kUpdateFile = BRANDING_UPDATE_PATH"/version_info.xml";
-const char* kUpdateRequest = "GET %s HTTP/1.0\n"
+const char* kUpdateRequest = "GET %s HTTP/1.0\r\n"
                              "Host: %s\n"
                              "User-Agent: FreeAmp/%s\n" // we do not 
want to change this for branding
                              "\n";
@@ -998,7 +998,7 @@
             {
                 gethostname(localname, kMaxHostNameLen);    
 
-                const char* kHTTPQuery = "GET %s HTTP/1.0\n"
+                const char* kHTTPQuery = "GET %s HTTP/1.0\r\n"
                                          "Host: %s\n"
                                          "Accept: */*\n" 
                                          "User-Agent: FreeAmp/%s\n"
Index: io/http/httpinput.cpp
===================================================================
RCS file: /src/repository/freeamp/io/http/httpinput.cpp,v
retrieving revision 1.55
diff -u -r1.55 httpinput.cpp
--- io/http/httpinput.cpp       2000/08/25 07:42:14     1.55
+++ io/http/httpinput.cpp       2000/08/26 01:14:47
@@ -581,7 +581,7 @@
     szQuery = new char[iMaxUrlLen];
 
     if (szFile)
-        sprintf(szQuery, "GET %s HTTP/1.0\n"
+        sprintf(szQuery, "GET %s HTTP/1.0\r\n"
                          "Host: %s\n"
                          "Accept: */*\n" 
                          "icy-metadata:1\n" 
Index: lib/http/src/Http.cpp
===================================================================
RCS file: /src/repository/freeamp/lib/http/src/Http.cpp,v
retrieving revision 1.10
diff -u -r1.10 Http.cpp
--- lib/http/src/Http.cpp       2000/08/23 17:15:35     1.10
+++ lib/http/src/Http.cpp       2000/08/26 01:14:47
@@ -277,7 +277,7 @@
         {
             gethostname(localname, kMaxHostNameLen);    
 
-            const char* kHTTPQuery = "GET %s HTTP/1.1\n"
+            const char* kHTTPQuery = "GET %s HTTP/1.1\r\n"
                                      "Host: %s\n"
                                      "Accept: */*\n" 
                                      "User-Agent: FreeAmp/%s\n";
Index: lib/musicbrainz/lib/mb_http.cpp
===================================================================
RCS file: /src/repository/freeamp/lib/musicbrainz/lib/mb_http.cpp,v
retrieving revision 1.6
diff -u -r1.6 mb_http.cpp
--- lib/musicbrainz/lib/mb_http.cpp     2000/08/23 17:15:35     1.6
+++ lib/musicbrainz/lib/mb_http.cpp     2000/08/26 01:14:47
@@ -275,12 +275,12 @@
             const char* kHTTPQuery;
 
             if (xml.length() == 0)
-                kHTTPQuery = "GET %s HTTP/1.1\n"
+                kHTTPQuery = "GET %s HTTP/1.1\r\n"
                              "Host: %s\n"
                              "Accept: */*\n" 
                              "User-Agent: %s\n";
             else
-                kHTTPQuery = "POST %s HTTP/1.1\n"
+                kHTTPQuery = "POST %s HTTP/1.1\r\n"
                              "Host: %s\n"
                              "Accept: */*\n" 
                              "User-Agent: %s\n"
_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev

Reply via email to