[easytag] Fix CDDB requests being truncated



commit e3f197aae814354925b3528260efbdb4115e657e
Author: ChrisiPK <ChrisiPK gmail com>
Date:   Wed Feb 11 11:46:59 2015 +0000

    Fix CDDB requests being truncated
    
    EasyTAG does not handle the chunked encoding and truncates lines that
    fall on chunk boundaries. Make HTTP requests with 1.0 as the protocol
    version, to avoid a chunked transfer encoding.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743812

 src/cddb_dialog.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/cddb_dialog.c b/src/cddb_dialog.c
index 30c3e5c..8b96939 100644
--- a/src/cddb_dialog.c
+++ b/src/cddb_dialog.c
@@ -898,9 +898,11 @@ Cddb_Get_Album_Tracks_List (EtCDDBDialog *self, GtkTreeSelection* selection)
                {
                        // For gnudb
                        // New version of gnudb doesn't use a cddb request, but a http request
+            /* HTTP/1.0 to avoid the server returning chunked results.
+             * https://bugzilla.gnome.org/show_bug.cgi?id=743812 */
                    cddb_in = g_strdup_printf("GET %s%s/gnudb/"
                                              "%s/%s"
-                                             " HTTP/1.1\r\n"
+                                             " HTTP/1.0\r\n"
                                              "Host: %s:%u\r\n"
                                              "User-Agent: %s %s\r\n"
                                              "%s"
@@ -918,10 +920,12 @@ Cddb_Get_Album_Tracks_List (EtCDDBDialog *self, GtkTreeSelection* selection)
                    // CDDB Request (ex: GET 
/~cddb/cddb.cgi?cmd=cddb+read+jazz+0200a401&hello=noname+localhost+EasyTAG+0.31&proto=1 HTTP/1.1\r\nHost: 
freedb.freedb.org:80\r\nConnection: close)
                    // Without proxy : "GET /~cddb/cddb.cgi?…" but doesn't work with a proxy.
                    // With proxy    : "GET http://freedb.freedb.org/~cddb/cddb.cgi?…";
+            /* HTTP/1.0 to avoid the server returning chunked results.
+             * https://bugzilla.gnome.org/show_bug.cgi?id=743812 */
                    cddb_in = g_strdup_printf("GET %s%s%s?cmd=cddb+read+"
                                              "%s+%s"
                                              "&hello=noname+localhost+%s+%s"
-                                             "&proto=6 HTTP/1.1\r\n"
+                                             "&proto=6 HTTP/1.0\r\n"
                                              "Host: %s:%u\r\n"
                                              "%s"
                                              "Connection: close\r\n\r\n",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]