X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/0a9944546bc1cf591dfce10112a4385049909f02..3d939725e66414faa7684bbcd5f4ffe95ee2108d:/lcore.pas diff --git a/lcore.pas b/lcore.pas index 30e9c09..f6b0342 100755 --- a/lcore.pas +++ b/lcore.pas @@ -35,7 +35,7 @@ interface const - receivebufsize=1460; + receivebufsize=1460*8; var absoloutemaxs:integer=0; @@ -99,6 +99,7 @@ interface onfdwrite : procedure (Sender: TObject; Error: word) of object; //added for bewarehttpd lasterror:integer; destroying:boolean; + recvbufsize:integer; function receivestr:string; virtual; procedure close; procedure abort; @@ -552,6 +553,7 @@ procedure tlasio.handlefdtrigger(readtrigger,writetrigger:boolean); var sendflushresult : integer; tempbuf:array[0..receivebufsize-1] of byte; + a:integer; begin if (state=wsconnected) and writetrigger then begin //writeln('write trigger'); @@ -578,7 +580,9 @@ begin writtenthiscycle := false; if (state =wsconnected) and readtrigger then begin if recvq.size=0 then begin - numread := myfdread(fdhandlein,tempbuf,sizeof(tempbuf)); + a := recvbufsize; + if (a <= 0) or (a > sizeof(tempbuf)) then a := sizeof(tempbuf); + numread := myfdread(fdhandlein,tempbuf,a); if (numread=0) and (not mustrefreshfds) then begin {if i remember correctly numread=0 is caused by eof if this isn't dealt with then you get a cpu eating infinite loop