> Oct 21, 2011 V7.41 Angus added OnHttpMimeContentType to allow
> custom ContentTypes to be supported for unusual file extensions.
Very nice.
Is there a reason you placed the calls in this sequences? I think
procedure THttpConnection.SendDocument[..]
begin
ErrorSend := FALSE;
ProtoNumber := 200;
TriggerMimeContentType(FDocument, FAnswerContentType); { V7.41 allow
content type to be changed }
if FAnswerContentType='' then // no callback or not handled? Let the
default function do it's magic.
FAnswerContentType := DocumentToContentType(FDocument);
[..]
is a little bit better (at least if you have a callback and a matching
MimeContentType). In the worst case you have one additional comparism
(FAnswerContentType='') in the best case the complete if..then..else
construct of the default function will be skipped. It also would enable the
user to replace the default function with a optimized search.
BTW: what is the local variable "ErrorSend" good for? I think it simply can
be kicked...
Another minor thing: Is there a special reason why the String parameters
(Filename) of the callbacks and the Trigger[..] procedures are not declared
as const? This also applies to the DocumentToContentType function.
Greetings
Lars
--
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