From 302f0e8d8df98a04f3c01f1b13abbbfe6b1022ab Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 4 Jun 2009 13:18:23 +0000 Subject: [PATCH] - MGR: Fix bug in browser cookie detection code where firefox v3 cookie detection was returning true even for cookies that don't exist. clientgui/ browser.cpp, .h svn path=/trunk/boinc/; revision=18292 --- checkin_notes | 8 ++++++++ clientgui/browser.cpp | 13 +++---------- clientgui/browser.h | 8 ++++++++ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index 4b59c7d422..1795cdc39f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5060,3 +5060,11 @@ Rom 3 June 2009 AccountInfoPage.cpp AccountManagerInfoPage.cpp ProjectInfoPage.cpp + +Rom 4 June 2009 + - MGR: Fix bug in browser cookie detection code where firefox v3 + cookie detection was returning true even for cookies that don't + exist. + + clientgui/ + browser.cpp, .h diff --git a/clientgui/browser.cpp b/clientgui/browser.cpp index 98bf61f36e..beff918f4c 100644 --- a/clientgui/browser.cpp +++ b/clientgui/browser.cpp @@ -484,18 +484,10 @@ bool detect_cookie_mozilla_v2( } -#if defined(__APPLE__) - // sqlite3 is not av ailable on Mac OS 10.3.9 - extern int sqlite3_open(const char *filename, sqlite3 **ppDb) __attribute__((weak_import)); - extern int sqlite3_close(sqlite3 *) __attribute__((weak_import)); - extern int sqlite3_exec(sqlite3*, const char *sql, sqlite3_callback, void *, char **errmsg) __attribute__((weak_import)); - extern void sqlite3_free(char *z) __attribute__((weak_import)); -#endif - - bool detect_cookie_mozilla_v3( std::string profile_root, std::string& project_url, std::string& name, std::string& value ) { + bool retval = false; std::string tmp; std::string hostname; char query[1024]; @@ -540,9 +532,10 @@ bool detect_cookie_mozilla_v3( if ( !cookie.value.empty() ) { value = cookie.value; + retval = true; } - return true; + return retval; } diff --git a/clientgui/browser.h b/clientgui/browser.h index 85e37b9e8f..8257c605bd 100644 --- a/clientgui/browser.h +++ b/clientgui/browser.h @@ -42,4 +42,12 @@ bool detect_cookie_safari(std::string& project_url, std::string& name, std::stri bool detect_cookie_firefox_2(std::string& project_url, std::string& name, std::string& value); bool detect_cookie_firefox_3(std::string& project_url, std::string& name, std::string& value); +#if defined(__APPLE__) + // sqlite3 is not av ailable on Mac OS 10.3.9 + extern int sqlite3_open(const char *filename, sqlite3 **ppDb) __attribute__((weak_import)); + extern int sqlite3_close(sqlite3 *) __attribute__((weak_import)); + extern int sqlite3_exec(sqlite3*, const char *sql, sqlite3_callback, void *, char **errmsg) __attribute__((weak_import)); + extern void sqlite3_free(char *z) __attribute__((weak_import)); +#endif + #endif