[haiku-commits] haiku: hrev46006 - src/kits/network/libnetapi

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 1 Sep 2013 19:52:09 +0200 (CEST)

hrev46006 adds 1 changeset to branch 'master'
old head: 41e940ca3bad8656a4f69d194fcd1638e52111ed
new head: a8dd17c9b929dbe8e677238e6de088692a2cac27
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=a8dd17c+%5E41e940c

----------------------------------------------------------------------------

a8dd17c: UrlProtocolHttp: parse received cookies
  
   * We didn't do anything with cookies received from the server, they are
  now automatically added to the cookie jar.
   * Also make sure the UrlContext (which holds the cookie jar) is
  forwarded from UrlRequest to UrlProtocol when it gets set.
  
  this gets cookies working in Service Kit-based WebKit.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46006
Commit:      a8dd17c9b929dbe8e677238e6de088692a2cac27
URL:         http://cgit.haiku-os.org/haiku/commit/?id=a8dd17c
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Sep  1 17:40:57 2013 UTC

----------------------------------------------------------------------------

2 files changed, 7 insertions(+)
src/kits/network/libnetapi/UrlProtocolHttp.cpp | 4 ++++
src/kits/network/libnetapi/UrlRequest.cpp      | 3 +++

----------------------------------------------------------------------------

diff --git a/src/kits/network/libnetapi/UrlProtocolHttp.cpp 
b/src/kits/network/libnetapi/UrlProtocolHttp.cpp
index 1aa6aa2..4eb2b5c 100644
--- a/src/kits/network/libnetapi/UrlProtocolHttp.cpp
+++ b/src/kits/network/libnetapi/UrlProtocolHttp.cpp
@@ -508,6 +508,10 @@ BUrlProtocolHttp::_MakeRequest()
                                if ((fContext != NULL) && 
fHeaders.HasHeader("Set-Cookie")) {
                                        for (int32 i = 0;  i < 
fHeaders.CountHeaders(); i++) {
                                                if 
(fHeaders.HeaderAt(i).NameIs("Set-Cookie")) {
+                                                       BNetworkCookie* cookie 
= new BNetworkCookie();
+                                                       
cookie->ParseCookieStringFromUrl(
+                                                               
fHeaders.HeaderAt(i).Value(), fUrl);
+                                                       
fContext->GetCookieJar().AddCookie(cookie);
                                                }
                                        }
                                }
diff --git a/src/kits/network/libnetapi/UrlRequest.cpp 
b/src/kits/network/libnetapi/UrlRequest.cpp
index 4b30359..bf139ce 100644
--- a/src/kits/network/libnetapi/UrlRequest.cpp
+++ b/src/kits/network/libnetapi/UrlRequest.cpp
@@ -69,6 +69,9 @@ void
 BUrlRequest::SetContext(BUrlContext* context)
 {
        fContext = context;
+
+       if (fUrlProtocol != NULL)
+               fUrlProtocol->SetContext(context);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev46006 - src/kits/network/libnetapi - pulkomandy