the user-agent string is constructed on a first-time-used basis from http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHandler.cpp#514 It depends on a bunch of member variables being setup correctly, including mProductSub.. That one is set on line 287 of ::Init(). unfortunately, on http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHandler.cpp#276, there is an invocation of UserAgent() in a NSPR LOG(()) statement. If that is executed (only when logging is enabled), the string is constructed and cached for future use without mProductSub being initialized. The result is different UA with and without logging. bad news. logging: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/ Firefox/16.0a1 no-logging: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/16.0 Firefox/16.0a1 The plus.google.com URL /u/0/_/notifications/frame for some reason is quite sensitive to this - and returns 0 byte responses with large set-cookies for the logging version, and normal gzip'd responses for the no-logging version. The with-log version resulted in random save-as dialogs :( To fix it, just move the log statement to after the initialization.
Created attachment 634469 [details] [diff] [review] patch 0
Thanks jason - this is a small thing but knowing where those random save-as dialogs were coming from is a big deal to me! https://hg.mozilla.org/integration/mozilla-inbound/rev/e1e34d0f5a31