mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
default speed limit 50MBps
This commit is contained in:
parent
e233f6d29a
commit
29f6bac31c
@ -1599,7 +1599,7 @@ end; // initInputStream
|
|||||||
|
|
||||||
function ThttpConn.sendNextChunk(max:integer=MAXINT):integer;
|
function ThttpConn.sendNextChunk(max:integer=MAXINT):integer;
|
||||||
var
|
var
|
||||||
n: int64;
|
n, toSend: int64;
|
||||||
buf: ansistring;
|
buf: ansistring;
|
||||||
begin
|
begin
|
||||||
result:=0;
|
result:=0;
|
||||||
@ -1611,7 +1611,8 @@ if (n = 0) or (bytesSentLastItem = 0) then n:=max;
|
|||||||
if n > MAXIMUM_CHUNK_SIZE then n:=MAXIMUM_CHUNK_SIZE;
|
if n > MAXIMUM_CHUNK_SIZE then n:=MAXIMUM_CHUNK_SIZE;
|
||||||
if n < MINIMUM_CHUNK_SIZE then n:=MINIMUM_CHUNK_SIZE;
|
if n < MINIMUM_CHUNK_SIZE then n:=MINIMUM_CHUNK_SIZE;
|
||||||
if n > max then n:=max;
|
if n > max then n:=max;
|
||||||
if n > bytesToSend then n:=bytesToSend;
|
toSend:=bytesToSend;
|
||||||
|
if n > toSend then n:=toSend;
|
||||||
if n = 0 then exit;
|
if n = 0 then exit;
|
||||||
setLength(buf, n);
|
setLength(buf, n);
|
||||||
n:=stream.read(buf[1], n);
|
n:=stream.read(buf[1], n);
|
||||||
|
|||||||
8
main.pas
8
main.pas
@ -5025,8 +5025,6 @@ var
|
|||||||
nofolders, selection, itsAsearch: boolean;
|
nofolders, selection, itsAsearch: boolean;
|
||||||
|
|
||||||
procedure addToTar(src,dst:string);
|
procedure addToTar(src,dst:string);
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
if not selection or not tar.contains(src) then
|
if not selection or not tar.contains(src) then
|
||||||
tar.addFile(src, dst);
|
tar.addFile(src, dst);
|
||||||
@ -8120,10 +8118,10 @@ var
|
|||||||
|
|
||||||
if userSocketBuffer > 0 then
|
if userSocketBuffer > 0 then
|
||||||
data.conn.sndBuf:=userSocketBuffer
|
data.conn.sndBuf:=userSocketBuffer
|
||||||
else
|
else if highSpeedChk.checked then
|
||||||
begin
|
begin
|
||||||
size:=minmax(8192, MEGA, round(data.averageSpeed));
|
size:=minmax(8192, MEGA, round(data.averageSpeed));
|
||||||
if highSpeedChk.checked and (safeDiv(0.0+size, data.conn.sndbuf, 2) > 2) then
|
if safeDiv(0.0+size, data.conn.sndbuf, 2) > 2 then
|
||||||
data.conn.sndBuf:=size;
|
data.conn.sndBuf:=size;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -12126,7 +12124,7 @@ tray:=TmyTrayicon.create(self);
|
|||||||
DragAcceptFiles(handle, true);
|
DragAcceptFiles(handle, true);
|
||||||
caption:=format('HFS ~ HTTP File Server %s', [VERSION]);
|
caption:=format('HFS ~ HTTP File Server %s', [VERSION]);
|
||||||
application.Title:=format('HFS %s', [VERSION]);
|
application.Title:=format('HFS %s', [VERSION]);
|
||||||
setSpeedLimit(-1);
|
setSpeedLimit(50000);
|
||||||
setSpeedLimitIP(-1);
|
setSpeedLimitIP(-1);
|
||||||
setGraphRate(10);
|
setGraphRate(10);
|
||||||
setMaxConnections(0);
|
setMaxConnections(0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user