Hello Anton,
1) Excess ancient defines
The code is cleaned up as we goes by.
3) HTTPCliWindowProc
function HTTPCliWindowProc is never used, maybe it should be removed?
If not used anymore, yes.
2) $IF defines
Same as (1)
4) THttpBigInt
THttpBigInt type - is it really needed?
Strictly not needed, but make code easier to update.
5) Header value names
Yes, indeed. Altough it probably wouldn't change anything.
6) Current http doc properties clearing
Yes, indeed.
7) Last-modified and Date header fields
I don't see exactly what you mean.
--
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: "Anton S." <an...@rambler.ru>
To: <twsocket@elists.org>
Sent: Thursday, April 07, 2011 1:29 PM
Subject: [twsocket] OverbyteIcsHttpProt suggestions
I'm now working with HttpCli and after examining OverbyteIcsHttpProt unit
I have several suggestions
1) Excess ancient defines
While only D7+ is supported currently in ICS7, there are some legacy
defines:
{$IFNDEF COMPILER7_UP}
'Sorry, we do not want to support ancient compilers any longer'
{$ENDIF}
{$IFDEF DELPHI6_UP} << useless
{$WARN SYMBOL_PLATFORM OFF}
{$WARN SYMBOL_LIBRARY OFF}
{$WARN SYMBOL_DEPRECATED OFF}
{$ENDIF}
{$IFDEF BCB3_UP} << {$IFDEF BCB} ?
{$ObjExportAll On}
{$ENDIF}
There's even some code for DELPHI1!
2) $IF defines
While COMPILER##_UP defines are used for determining compiler version,
there are some checks with $IF like {$IF CompilerVersion < 21}. Maybe it's
better to change compiler detection to IF-s? IF-s are supported in D7, the
only thing this version requires is defining a const CompilerVersion = 15.
3) HTTPCliWindowProc
function HTTPCliWindowProc is never used, maybe it should be removed?
4) THttpBigInt
THttpBigInt type - is it really needed?
5) Header value names
Such header value names as 'Content-Length: ' are repeated several times
throughout the unit, I think they should be declared as constants.
6) Current http doc properties clearing
There's a block of code which clears http doc properties, it is repeated
three times: once in THttpCli.InternalClear and twice in
THttpCli.LocationSessionClosed.
{ Clear header from previous operation }
FRcvdHeader.Clear;
FHeaderLineCount := 0;
FBodyLineCount := 0;
FContentLength := -1;
FContentType := ''; { 25/09/1999 }
FTransferEncoding := ''; { 28/12/2003 }
{$IFDEF UseContentCoding}
FContentEncoding := '';
{$ENDIF}
I'd extract this into separate method (what would ease addition of new
http doc properties)
7) Last-modified and Date header fields
I slightly modified RFC1123_Date and RFC1123_StrToDate and added
auto-conversion of Last-modified and Date header fields into HttpCli's
TDateTime fields. If you're interested, I can send my modifications to ICS
team.
--
Anton
--
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