From 4192f44dc48139d7f3c7f897861a0c522738caad Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 25 Nov 2013 11:57:54 +0100 Subject: [PATCH] Make sure we never give a NULL context to requests. Use a default context instead. This allows apps without a context management to still have cookies and HTTP digest authentication (without persistence to disk). First part of fix to #10239 (it also needs changes in WebKit). --- src/kits/network/libnetapi/UrlProtocolRoster.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kits/network/libnetapi/UrlProtocolRoster.cpp b/src/kits/network/libnetapi/UrlProtocolRoster.cpp index c023c9baad..33889ead08 100644 --- a/src/kits/network/libnetapi/UrlProtocolRoster.cpp +++ b/src/kits/network/libnetapi/UrlProtocolRoster.cpp @@ -17,10 +17,16 @@ #include +static BUrlContext gDefaultContext; + + /* static */ BUrlRequest* BUrlProtocolRoster::MakeRequest(const BUrl& url, BUrlProtocolListener* listener, BUrlContext* context) { + if(context == NULL) + context = &gDefaultContext; + // TODO: instanciate the correct BUrlProtocol using add-on interface if (url.Protocol() == "http") { return new(std::nothrow) BHttpRequest(url, false, "HTTP", listener,