Thanks a lot.
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be
----- Original Message -----
From: "Henri Gourvest" <hgourv...@gmail.com>
To: <twsocket@elists.org>
Sent: Tuesday, April 27, 2010 12:57 PM
Subject: [twsocket] http deflate patch
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
--
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