Author: siwuzzz
Date: Wed Aug  1 12:44:33 2007
New Revision: 215

Modified:
   trunk/clients/cs/src/core/gauthrequest.cs
   trunk/clients/cs/src/core/request.cs

Log:
src/core/request.cs:
- Removed GFE specific code for GZip support
- UserAgent property is now virtual

src/core/gauthrequest.cs:
- Added GFE specific code for GZip support

Modified: trunk/clients/cs/src/core/gauthrequest.cs
==============================================================================
--- trunk/clients/cs/src/core/gauthrequest.cs   (original)
+++ trunk/clients/cs/src/core/gauthrequest.cs   Wed Aug  1 12:44:33 2007
@@ -154,6 +154,20 @@
         }
         
/////////////////////////////////////////////////////////////////////////////
 
+
+        
////////////////////////////////////////////////////////////////////////////////
+        /// <summary>accessor method public string UserAgent, with GFE 
support</summary> 
+        /// <remarks>GFE will enable gzip support ONLY for browser that have 
the string
+        /// "gzip" in their user agent (IE or Mozilla), since lot of browsers 
have a
+        /// broken gzip support.</remarks>
+        
////////////////////////////////////////////////////////////////////////////////
+        public override string UserAgent
+        {
+            get { return (base.UserAgent + (this.UseGZip == true ? " (gzip)" : 
"")); }
+            set { base.UserAgent = value; }
+        }
+
+
         //////////////////////////////////////////////////////////////////////
         /// <summary>Get/Set accessor for the application name</summary> 
         //////////////////////////////////////////////////////////////////////
@@ -394,6 +408,10 @@
                         req.Close(); 
                     }
                 }
+
+                // Hack to get around the GFE bug
+                if (this.UseGZip == true)
+                    http.Accept = "text/xml";
             }
         }
         
/////////////////////////////////////////////////////////////////////////////

Modified: trunk/clients/cs/src/core/request.cs
==============================================================================
--- trunk/clients/cs/src/core/request.cs        (original)
+++ trunk/clients/cs/src/core/request.cs        Wed Aug  1 12:44:33 2007
@@ -45,7 +45,7 @@
         private String shardingCookie;              // holds the sharding 
cookie if returned
         private WebProxy webProxy;                  // holds a webproxy to use
         private bool keepAlive;                     // indicates wether or not 
to keep the connection alive
-           private bool useGZip;
+        private bool useGZip;
         private string contentType = "application/atom+xml; charset=UTF-8";
         /// <summary>Cookie setting header, returned from server</summary>
         public const string SetCookieHeader = "Set-Cookie"; 
@@ -116,14 +116,9 @@
         /// <summary>accessor method public string UserAgent</summary> 
         /// <returns> </returns>
         //////////////////////////////////////////////////////////////////////
-        public string UserAgent
+        public virtual string UserAgent
         {
-            get
-            {
-                if (this.useGZip == true)
-                    return this.userAgent + " (gzip)";
-                return this.userAgent;
-            }
+            get { return this.userAgent; }
             set {this.userAgent = value;}
         }
         
/////////////////////////////////////////////////////////////////////////////
@@ -388,12 +383,7 @@
     
                     }
                     if (this.useGZip == true)
-                    {
-                        // Hack to get around the GFE bug
-                        web.Accept = "text/xml";
-                        /////////////////////////////////
                         web.Headers.Add("Accept-Encoding", "gzip");
-                    }
                     web.ContentType = this.ContentType;
                     web.UserAgent = this.factory.UserAgent;
                     web.KeepAlive = this.factory.KeepAlive; 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to