X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/9b641f7a6cda5781002a12c901addc01787003e9..69b439a013e03cd1d3eb13da8bbbc20aa5bf5184:/lcore.pas?ds=inline

diff --git a/lcore.pas b/lcore.pas
index da0fd66..7db6b3e 100755
--- a/lcore.pas
+++ b/lcore.pas
@@ -35,7 +35,13 @@ interface
 
 
   const
-    packetbasesize = 1460;
+    {how this number is made up:
+    - ethernet: MTU 1500
+    - be safe for either "ethernet v1" or "PPPoE", both take 8 bytes
+    - IPv6 header: 40 bytes (IPv4 is 20)
+    - TCP/UDP header: 20 bytes
+    }
+    packetbasesize = 1432;
     receivebufsize=packetbasesize*8;
 
   var
@@ -567,7 +573,16 @@ begin
           internalclose(0);
 
         end else begin
-          internalclose({$ifdef win32}getlasterror{$else}linuxerror{$endif});
+          {$ifdef win32}
+          if getlasterror=WSAEWOULDBLOCK then begin
+            //the asynchronous nature of windows messages means we sometimes
+            //get here with the buffer full
+            //so do nothing in that case
+          end else
+          {$endif}
+          begin
+            internalclose({$ifdef win32}getlasterror{$else}linuxerror{$endif});
+          end  
         end;
       end;