From 8dbf997db86622966c80c12998c2b39577de949f Mon Sep 17 00:00:00 2001
From: plugwash <plugwash@p10link.net>
Date: Sun, 30 Mar 2008 00:52:52 +0000
Subject: [PATCH 1/1] * attempt to fix too many onsessionavailible events issue
 * clean up some licensing issues

git-svn-id: file:///svnroot/lcore/trunk@6 b1de8a11-f9be-4011-bde0-cc7ace90066a
---
 lcoreconfig.inc         |  6 ++++++
 lcorewsaasyncselect.pas |  4 +++-
 zlib_license.txt        | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100755 zlib_license.txt

diff --git a/lcoreconfig.inc b/lcoreconfig.inc
index 89d299e..48933e0 100644
--- a/lcoreconfig.inc
+++ b/lcoreconfig.inc
@@ -1,3 +1,9 @@
+
+{ Copyright (C) 2005 Bas Steendijk and Peter Green
+  For conditions of distribution and use, see copyright notice in zlib_license.txt
+  which is included in the package
+  ----------------------------------------------------------------------------- }
+
 {this enables the entire ipv6 functionality - resolving, connecting, etc
 this is enabled by default to make all apps using lcore automatically ipv6 aware.
 to disable, undefine it here, or define "noipv6" in the app}
diff --git a/lcorewsaasyncselect.pas b/lcorewsaasyncselect.pas
index 3f55f1a..de9d36f 100755
--- a/lcorewsaasyncselect.pas
+++ b/lcorewsaasyncselect.pas
@@ -141,7 +141,9 @@ begin
 
         if readtrigger or writetrigger then lasio.handlefdtrigger(readtrigger,writetrigger);
       end;
-      dowsaasyncselect(socket,0,0); //reset watches
+      // don't reset the event manually for listen sockets to avoid unwanted
+      // extra onsessionavailible events
+      if (taddrint(findtree(@fdwatches,inttostr(fd))) and FD_ACCEPT) = 0  dowsaasyncselect(socket,0,0); // if not a listen socket reset watches
     end;
   end else if (ahwnd=hwndlcore) and (aumsg=wm_dotasks) then begin
       //writeln('processing tasks');
diff --git a/zlib_license.txt b/zlib_license.txt
new file mode 100755
index 0000000..a8a88f5
--- /dev/null
+++ b/zlib_license.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2005 Bas Steendijk and Peter Green
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the
+use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including
+commercial applications, and to alter it and redistribute it freely, subject to
+the following restrictions:
+
+    1. The origin of this software must not be misrepresented; you must not
+       claim that you wrote the original software. If you use this software in a
+       product, an acknowledgment in the product documentation would be
+       appreciated but is not required.
+
+    2. Altered source versions must be plainly marked as such, and must not be
+       misrepresented as being the original software.
+
+    3. This notice may not be removed or altered from any source distribution.
-- 
2.30.2