Backout bfc937247f3c (bug 588909), UA change breaks Google and Zimbra.
authorJustin Dolske <dolske@mozilla.com>
Mon, 20 Feb 2012 16:29:38 -0800
changeset 90083 f7ccbfd0b7c633a10a25623b6d58efbb8b011185
parent 90082 d07998fb3530589aef39e6202d92874ed107bd9a
child 90084 7df4ef4a3a58e3bbd4b22825acb010bd86b66c54
push idunknown
push userunknown
push dateunknown
bugs588909
milestone13.0a1
backs outbfc937247f3c7b70ce8dfcbee41d8726b10e1980
Backout bfc937247f3c (bug 588909), UA change breaks Google and Zimbra.
browser/branding/official/configure.sh
config/autoconf.mk.in
configure.in
netwerk/protocol/http/nsHttpHandler.cpp
--- a/browser/branding/official/configure.sh
+++ b/browser/branding/official/configure.sh
@@ -1,1 +1,2 @@
 MOZ_APP_DISPLAYNAME=Firefox
+MOZ_UA_BUILDID=20100101
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -52,16 +52,17 @@ MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNA
 MOZ_APP_BASENAME = @MOZ_APP_BASENAME@
 MOZ_APP_VENDOR = @MOZ_APP_VENDOR@
 MOZ_APP_PROFILE = @MOZ_APP_PROFILE@
 MOZ_APP_ID = @MOZ_APP_ID@
 MOZ_PROFILE_MIGRATOR = @MOZ_PROFILE_MIGRATOR@
 MOZ_EXTENSION_MANAGER = @MOZ_EXTENSION_MANAGER@
 MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@
 MOZ_APP_VERSION = @MOZ_APP_VERSION@
+MOZ_UA_BUILDID = @MOZ_UA_BUILDID@
 MOZ_MACBUNDLE_NAME = @MOZ_MACBUNDLE_NAME@
 MOZ_APP_STATIC_INI = @MOZ_APP_STATIC_INI@
 
 MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
 
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
--- a/configure.in
+++ b/configure.in
@@ -8632,16 +8632,18 @@ AC_SUBST(MOZ_PROFILE_MIGRATOR)
 AC_SUBST(MOZ_EXTENSION_MANAGER)
 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
 AC_SUBST(MOZ_APP_UA_NAME)
 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
 AC_SUBST(MOZ_APP_VERSION)
 AC_DEFINE_UNQUOTED(MOZ_UA_FIREFOX_VERSION, "$FIREFOX_VERSION")
 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
 AC_SUBST(FIREFOX_VERSION)
+AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
+AC_SUBST(MOZ_UA_BUILDID)
 
 # We can't use the static application.ini data when building against
 # a libxul SDK.
 if test -n "$LIBXUL_SDK"; then
     MOZ_APP_STATIC_INI=
 fi
 AC_SUBST(MOZ_APP_STATIC_INI)
 
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -302,17 +302,25 @@ nsHttpHandler::Init()
     mSessionStartTime = NowInSeconds();
 
     rv = mAuthCache.Init();
     if (NS_FAILED(rv)) return rv;
 
     rv = InitConnectionMgr();
     if (NS_FAILED(rv)) return rv;
 
-    mProductSub.AssignLiteral(MOZILLA_VERSION);
+#ifdef ANDROID
+    mProductSub.AssignLiteral(MOZ_APP_UA_VERSION);
+#else
+    mProductSub.AssignLiteral(MOZ_UA_BUILDID);
+#endif
+    if (mProductSub.IsEmpty() && appInfo)
+        appInfo->GetPlatformBuildID(mProductSub);
+    if (mProductSub.Length() > 8)
+        mProductSub.SetLength(8);
 
     // Startup the http category
     // Bring alive the objects in the http-protocol-startup category
     NS_CreateServicesFromCategory(NS_HTTP_STARTUP_CATEGORY,
                                   static_cast<nsISupports*>(static_cast<void*>(this)),
                                   NS_HTTP_STARTUP_TOPIC);    
     
     mObserverService = mozilla::services::GetObserverService();