Skip to content
Permalink
Browse files

small HTTP process optimization

  • Loading branch information
Arnaud Bouchez
Arnaud Bouchez committed Jan 11, 2020
1 parent cd4f994 commit 50173055929933cbdaef80c61dfe6f7d7cf50ddc
Showing with 8 additions and 7 deletions.
  1. +5 −4 SynCrtSock.pas
  2. +2 −2 SynDBDataset.pas
  3. +1 −1 SynopseCommit.inc
@@ -6638,7 +6638,7 @@ procedure THttpSocket.GetHeader;
if s='' then
break; // headers end with a void line
if length(Headers)<=n then
SetLength(Headers,n+n shr 3+10);
SetLength(Headers,n+n shr 3+16);
Headers[n] := s;
inc(n);
P := pointer(s);
@@ -6691,15 +6691,16 @@ procedure THttpSocket.HeaderSetText(const aText, aForcedContentType: SockString)
while P^>#13 do inc(P);
if PDeb<>P then begin // add any not void line
if length(Headers)<=n then
SetLength(Headers,n+n shr 3+8);
SetLength(Headers,n+n shr 3+16);
SetString(Headers[n],PDeb,P-PDeb);
inc(n);
end;
while (P^=#13) or (P^=#10) do inc(P);
until P^=#0;
SetLength(Headers,n);
if (aForcedContentType='') or (HeaderGetValue('CONTENT-TYPE')<>'') then
if (aForcedContentType='') or (HeaderGetValue('CONTENT-TYPE')<>'') then begin
SetLength(Headers,n);
exit;
end;
SetLength(Headers,n+1);
Headers[n] := 'Content-Type: '+aForcedContentType;
end;
@@ -6,7 +6,7 @@
{
This file is part of Synopse framework.
Synopse framework. Copyright (C) 2019 Arnaud Bouchez
Synopse framework. Copyright (C) 2020 Arnaud Bouchez
Synopse Informatique - https://synopse.info
*** BEGIN LICENSE BLOCK *****
@@ -25,7 +25,7 @@
The Initial Developer of the Original Code is Arnaud Bouchez.
Portions created by the Initial Developer are Copyright (C) 2019
Portions created by the Initial Developer are Copyright (C) 2020
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -1 +1 @@
'1.18.5550'
'1.18.5551'

0 comments on commit 5017305

Please sign in to comment.
You can’t perform that action at this time.