WebPositive: hangs when cookie jar is corrupt.

Missing error check led to endless loop trying to extract cookies from
an invalid message. Now the cookie jar is left empty instead.
This commit is contained in:
Adrien Destugues
2017-08-13 08:02:16 +02:00
parent d784225237
commit 433447be21
+4 -2
View File
@@ -89,9 +89,11 @@ BrowserApp::BrowserApp()
cookieStorePath << "/Cookies";
fCookies = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
cookieStorePath.String());
BMessage cookieArchive = fCookies->GetValue("cookies", cookieArchive);
fContext = new BUrlContext();
fContext->SetCookieJar(BNetworkCookieJar(&cookieArchive));
if (fCookies->InitCheck() == B_OK) {
BMessage cookieArchive = fCookies->GetValue("cookies", cookieArchive);
fContext->SetCookieJar(BNetworkCookieJar(&cookieArchive));
}
#endif
BString sessionStorePath = kApplicationName;