From 6517aee7621ab0af49214eb793af6126a9a524d4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 23 Oct 2004 12:44:10 +0000 Subject: [PATCH] Fixed bug #188: unhandled event in processEvent. The error was seen in rare cases when timeout socket events occurred. --- NEWS | 3 +++ src/yaz-socket-manager.cpp | 14 +++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index df71aa3..b0411cd 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,7 @@ +Fixed bug #188: unhandled event in processEvent. The error was seen in +rare cases when timeout socket events occurred. + Renamed configure option for yaz-config. It is now --with-yaz-config. Fix include path order to avoid yaz++ from using old headers. diff --git a/src/yaz-socket-manager.cpp b/src/yaz-socket-manager.cpp index 89dc9bb..53344c1 100644 --- a/src/yaz-socket-manager.cpp +++ b/src/yaz-socket-manager.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-socket-manager.cpp,v 1.27 2004-02-26 23:42:27 adam Exp $ + * $Id: yaz-socket-manager.cpp,v 1.28 2004-10-23 12:44:10 adam Exp $ */ #include #ifdef WIN32 @@ -209,16 +209,12 @@ int Yaz_SocketManager::processEvent() yaz_log (m_log, "putEvent I/O mask=%d", mask); } - else if ( - (p->timeout > 0 || - (p->timeout == 0 && (p->mask & YAZ_SOCKET_OBSERVE_WRITE) == 0)) - && - (now - p->last_activity) >= p->timeout) + else if (res == 0 && p->timeout_this == timeout) { YazSocketEvent *event = new YazSocketEvent; assert (p->last_activity); - yaz_log (m_log, "putEvent timeout, now = %ld last_activity=%ld timeout=%d", - now, p->last_activity, p->timeout); + yaz_log (m_log, "putEvent timeout fd=%d, now = %ld last_activity=%ld timeout=%d", + p->fd, now, p->last_activity, p->timeout); p->last_activity = now; event->observer = p->observer; event->event = YAZ_SOCKET_OBSERVE_TIMEOUT; @@ -231,7 +227,7 @@ int Yaz_SocketManager::processEvent() delete event; return 1; } - yaz_log (LOG_WARN, "unhandled event in processEvent"); + yaz_log(LOG_WARN, "unhandled event in processEvent res=%d", res); return 1; } -- 1.7.10.4