projects
/
yazpp-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
proxy.sh start/stop script
[yazpp-moved-to-github.git]
/
src
/
yaz-socket-manager.cpp
diff --git
a/src/yaz-socket-manager.cpp
b/src/yaz-socket-manager.cpp
index
5f0f7df
..
163cb33
100644
(file)
--- a/
src/yaz-socket-manager.cpp
+++ b/
src/yaz-socket-manager.cpp
@@
-2,7
+2,7
@@
* Copyright (c) 1998-2001, Index Data.
* See the file LICENSE for details.
*
* Copyright (c) 1998-2001, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-socket-manager.cpp,v 1.17 2001-11-04 22:36:21 adam Exp $
+ * $Id: yaz-socket-manager.cpp,v 1.20 2003-07-25 19:27:36 adam Exp $
*/
#include <assert.h>
#ifdef WIN32
*/
#include <assert.h>
#ifdef WIN32
@@
-16,7
+16,7
@@
#include <string.h>
#include <yaz/log.h>
#include <string.h>
#include <yaz/log.h>
-#include <yaz++/yaz-socket-manager.h>
+#include <yaz++/socket-manager.h>
Yaz_SocketManager::YazSocketEntry **Yaz_SocketManager::lookupObserver(
IYazSocketObserver *observer)
Yaz_SocketManager::YazSocketEntry **Yaz_SocketManager::lookupObserver(
IYazSocketObserver *observer)
@@
-76,6
+76,11
@@
void Yaz_SocketManager::maskObserver(IYazSocketObserver *observer, int mask)
{
YazSocketEntry *se;
{
YazSocketEntry *se;
+ yaz_log(m_log, "obs=%p read=%d write=%d except=%d", observer,
+ mask & YAZ_SOCKET_OBSERVE_READ,
+ mask & YAZ_SOCKET_OBSERVE_WRITE,
+ mask & YAZ_SOCKET_OBSERVE_EXCEPT);
+
se = *lookupObserver(observer);
if (se)
se->mask = mask;
se = *lookupObserver(observer);
if (se)
se->mask = mask;
@@
-144,7
+149,7
@@
int Yaz_SocketManager::processEvent()
timeout_this -= now - p->last_activity;
else
p->last_activity = now;
timeout_this -= now - p->last_activity;
else
p->last_activity = now;
- if (timeout_this < 1)
+ if (timeout_this < 1 || timeout_this > 2147483646)
timeout_this = 1;
if (!timeout || timeout_this < timeout)
timeout = timeout_this;
timeout_this = 1;
if (!timeout || timeout_this < timeout)
timeout = timeout_this;
@@
-169,7
+174,10
@@
int Yaz_SocketManager::processEvent()
no, timeout);
while ((res = select(max + 1, &in, &out, &except, timeout ? &to : 0)) < 0)
if (errno != EINTR)
no, timeout);
while ((res = select(max + 1, &in, &out, &except, timeout ? &to : 0)) < 0)
if (errno != EINTR)
+ {
+ yaz_log (LOG_LOG|LOG_WARN, "select");
return -1;
return -1;
+ }
now = time(0);
for (p = m_observers; p; p = p->next)
{
now = time(0);
for (p = m_observers; p; p = p->next)
{