fixed line endings. made flush work on win32. made packet base size
authorbeware <beware@bircd.org>
Sat, 22 Nov 2008 17:11:59 +0000 (17:11 +0000)
committerbeware <beware@bircd.org>
Sat, 22 Nov 2008 17:11:59 +0000 (17:11 +0000)
constant.

git-svn-id: file:///svnroot/lcore/trunk@18 b1de8a11-f9be-4011-bde0-cc7ace90066a

lcore.pas
lsocket.pas

index f6b0342410219fba55072aa7bf95c5a850661fff..da0fd66b89365b4272b74707dd40de189c7f2f58 100755 (executable)
--- a/lcore.pas
+++ b/lcore.pas
@@ -35,7 +35,8 @@ interface
 \r
 \r
   const\r
-    receivebufsize=1460*8;\r
+    packetbasesize = 1460;\r
+    receivebufsize=packetbasesize*8;\r
 \r
   var\r
     absoloutemaxs:integer=0;\r
@@ -121,7 +122,7 @@ interface
 \r
       //procedure messageloop;\r
       function Receive(Buf:Pointer;BufSize:integer):integer; virtual;\r
-      procedure flush;virtual;{$ifdef win32} abstract;{$endif}\r
+      procedure flush;virtual;\r
       procedure dodatasent(wparam,lparam:longint);\r
       procedure doreceiveloop(wparam,lparam:longint);\r
       procedure sinkdata(sender:tobject;error:word);\r
@@ -490,7 +491,7 @@ var
 begin\r
   if state <> wsconnected then exit;\r
 \r
-  lensent := sendq.get(data,2920);\r
+  lensent := sendq.get(data,packetbasesize*2);\r
   if assigned(data) then result := myfdwrite(fdhandleout,data^,lensent) else result := 0;\r
 \r
   if result = -1 then lensent := 0 else lensent := result;\r
@@ -617,19 +618,20 @@ begin
   end;\r
 end;\r
 \r
-{$ifndef win32}\r
-  procedure tlasio.flush;\r
-  var\r
-    fds : fdset;\r
-  begin\r
-    fd_zero(fds);\r
-    fd_set(fdhandleout,fds);\r
-    while sendq.size>0 do begin\r
-      select(fdhandleout+1,nil,@fds,nil,nil);\r
-      if sendflush <= 0 then exit;\r
-    end;\r
-  end;\r
+procedure tlasio.flush;\r
+{$ifdef win32}\r
+type fdset = tfdset;\r
 {$endif}\r
+var\r
+  fds : fdset;\r
+begin\r
+  fd_zero(fds);\r
+  fd_set(fdhandleout,fds);\r
+  while sendq.size>0 do begin\r
+    select(fdhandleout+1,nil,@fds,nil,nil);\r
+    if sendflush <= 0 then exit;\r
+  end;\r
+end;\r
 \r
 procedure tlasio.dodatasent(wparam,lparam:longint);\r
 begin\r
index 7438c26a00901e070a63d6925e63c2b5664d8a41..898e983b66483974597b07b7fa47c9aa25a4f7f0 100755 (executable)
@@ -704,6 +704,6 @@ end;
     result := winsock.recv(fd,buf,size,0);\r
   end;\r
 {$endif}\r
-
+\r
 end.\r
 \r