This is a patch to handle deflate HTTP encoding.

Henri.

Index: OverbyteIcsHttpCCodZLib.pas
===================================================================
--- OverbyteIcsHttpCCodZLib.pas (revision 488)
+++ OverbyteIcsHttpCCodZLib.pas (working copy)
@@ -29,6 +29,13 @@
     procedure WriteBuffer(Buffer: Pointer; Count: Integer); override;
   end;

+  THttpCCodDeflate = class(THttpCCodzlib)
+  private
+    class function GetCoding: String; override;
+  public
+    constructor Create(WriteBufferProc: TWriteBufferProcedure); override;
+  end;
+
 implementation

 { THttpCCodzlib }
@@ -120,10 +127,27 @@
   FStream.WriteBuffer(Buffer^, Count);
 end;

+{ THttpCCodDeflate }
+
+constructor THttpCCodDeflate.Create(WriteBufferProc:
TWriteBufferProcedure);
+const
+  gh: Word = $0178;
+begin
+  inherited Create(WriteBufferProc);
+  WriteBuffer(@gh, 2);
+end;
+
+class function THttpCCodDeflate.GetCoding: String;
+begin
+  Result := 'deflate';
+end;
+
 initialization
   THttpContCodHandler.RegisterContentCoding(1, THttpCCodzlib);
+  THttpContCodHandler.RegisterContentCoding(1, THttpCCodDeflate);

 finalization
   THttpContCodHandler.UnregisterAuthenticateClass(THttpCCodzlib);
+  THttpContCodHandler.UnregisterAuthenticateClass(THttpCCodDeflate);

 end.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to