Bug 37084

Summary: [Qt] Do not cache network connections per username.
Product: WebKit Reporter: Robert Hogan <robert>
Component: WebKit QtAssignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, kling, markus, ossy, zarvai
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on:    
Bug Blocks: 62929, 79666    
Attachments:
Description Flags
Qt Patch none

Description Robert Hogan 2010-04-05 06:55:56 PDT
Created attachment 52532 [details]
Qt Patch

The fix for this in Qt is tracked at: http://bugreports.qt.nokia.com/browse/QTWEBKIT-152

I've also attached the patch here for comment.

If user information is present in the Url, QNetworkAccessHttpBackend
will cache the connection with a key in the format of user@hostname.
This causes the following tests in QtWebKit to fail:

LayoutTests/http/tests/xmlhttprequest/re-login.html
LayoutTests/http/tests/xmlhttprequest/re-login-async.html

The tests call the same url with user1 credentials, no credentials,
user 2 credentials and no credentials. In the second and fourth calls
Qt should use the most recently stored credentials. For the fourth
call it currently uses user1's credentials instead of user2's. This
is because it retrieves the cached connection from the third call
and uses the user/pass in that connection's authenticator - which is
user1's.

In order to retrieve the connection with the most recently used
credentials userinfo should be removed when caching the connection
in QNetworkAccessCache. This will allow Qt to retrieve the connection
used in the third call, in fact the same cached connection for all
four calls.
Comment 1 Robert Hogan 2010-04-05 08:55:05 PDT
I shouldn't have raised it in Jiras QTWEBKIT. The required changes are in QtNetwork, so have raised a new one:

http://bugreports.qt.nokia.com/browse/QTBUG-9619
Comment 2 Andreas Kling 2010-11-01 04:57:51 PDT
Closing per request from mgoetz.
Comment 3 Markus Goetz 2010-11-01 05:58:12 PDT
I merged the code to Qt, thanks!
Comment 4 Robert Hogan 2011-01-13 13:14:00 PST
Unskip http/tests/xmlhttprequest/re-login-async.html and http/tests/xmlhttprequest/re-login.html when buildbots move to 4.8
Comment 5 Zoltan Arvai 2011-11-09 01:21:29 PST
Results with r99667 (Qt 4.8.0-rc1):
http/tests/xmlhttprequest/re-login-async.html passes
http/tests/xmlhttprequest/re-login.html still failing
Comment 6 Csaba Osztrogonác 2012-05-18 06:53:34 PDT
Fixed and unskipped.