[Kde-imaging] [Bug 142259] Export to Gallery 2.2-RC-1 fails

Colin Guthrie kde at colin.guthr.ie
Wed Apr 18 02:50:15 CEST 2007


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=142259         
kde colin guthr ie changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From kde colin guthr ie  2007-04-18 02:50 -------
SVN commit 655231 by cguthrie:

Fix login to Gallery 2.2.

This was a very annoying bug to track down but it essentially relates
to a bug in the generation of Cookies in Gallery 2.2.

Gallery actually generates 3 Set-Cookie headers in it's response which
seems excessive. The first one is a GALLERYSID=<blank> and the other
two set it to the correct value. The routine that parses cookies is
somewhat dumb and just passes any cookies it receives back to the
server on the next request. By passing the blank GALLERYSID, Gallery
ensured that it did not connect to your logged in session.

The cookie parsing code should be make more intellegent, but in the
mean time I've put in a very simple fix.

Testing and feedback appreciated.

This also applies the patch by Martin Kaufmann - thanks.
BUG: 142259

 M  +1 -1      gallerympform.cpp  
 M  +10 -6     gallerytalker.cpp  


--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerympform.cpp #655230:655231
 @ -70,7 +70,7  @
 
     QTextStream ts(m_buffer, IO_Append|IO_WriteOnly);
     ts.setEncoding(QTextStream::UnicodeUTF8);
-    ts << str;
+    ts << str << '\0';
 }
 
 bool GalleryMPForm::addPair(const QString& name, const QString& value)
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerytalker.cpp #655230:655231
 @ -72,7 +72,7  @
     GalleryMPForm form;
 
     form.addPair("cmd",              "login");
-    form.addPair("protocol_version", "2.3");
+    form.addPair("protocol_version", "2.11");
     form.addPair("uname",            name);
     form.addPair("password",         passwd);
     form.finish();
 @ -100,7 +100,7  @
       task = "fetch-albums-prune";
 
     form.addPair("cmd",              task);
-    form.addPair("protocol_version", "2.3");
+    form.addPair("protocol_version", "2.11");
     form.finish();
 
     KIO::TransferJob* job = KIO::http_post(m_url, form.formData(), false);
 @ -129,7 +129,7  @
     GalleryMPForm form;
 
     form.addPair("cmd",              "fetch-album-images");
-    form.addPair("protocol_version", "2.3");
+    form.addPair("protocol_version", "2.11");
     form.addPair("set_albumName",    albumName);
     form.finish();
 
 @ -162,7 +162,7  @
     GalleryMPForm form;
 
     form.addPair("cmd", "new-album");
-    form.addPair("protocol_version", "2.3");
+    form.addPair("protocol_version", "2.11");
     form.addPair("set_albumName", parentAlbumName);
     if (!albumName.isEmpty())
         form.addPair("newAlbumName", albumName);
 @ -204,7 +204,7  @
     GalleryMPForm form;
 
     form.addPair("cmd", "add-item");
-    form.addPair("protocol_version", "2.3");
+    form.addPair("protocol_version", "2.11");
     form.addPair("set_albumName", albumName);
 
     if (!caption.isEmpty())
 @ -318,7 +318,7  @
         m_cookie = "Cookie:";
         for (QStringList::Iterator it = cookielist.begin(); it != cookielist.end(); ++it)
         {
-            QRegExp rx("^Set-Cookie: ([^;]+)");
+            QRegExp rx("^Set-Cookie: ([^;]+=[^;]+)");
             if (rx.search(*it) > -1)
                 m_cookie += " " + rx.cap(1) + ";";
         }
 @ -453,6 +453,10  @
                     if (iter != albumList.end())
                         (*iter).create_sub = (value == "true");
                 }
+                else if (key == "auth_token")
+                {
+                  s_authToken = value;
+                }
             }
         }
     }


More information about the Kde-imaging mailing list