From: Adam Dickmeiss Date: Fri, 18 Sep 2009 09:06:20 +0000 (+0200) Subject: Log session timeout. Reenable ASSOC_UP. X-Git-Tag: v3.0.49~11^2~1 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=643f3c67b24a03ea12d0d3420d78a734aedf5b1d;p=yaz-moved-to-github.git Log session timeout. Reenable ASSOC_UP. The association_state ASSOC_UP was last used in YAZ 2.0.30. It was probably removed by mistake. We enable it - but for Z39.50 sessions only, so that when a timeout occurs we can send a Z39.50 close PDU again. The session timeout is now also logged at "session" log level. --- diff --git a/src/seshigh.c b/src/seshigh.c index 19c771d..7e08220 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -377,7 +377,7 @@ void ir_session(IOCHAN h, int event) { if (assoc->state != ASSOC_UP) { - yaz_log(YLOG_DEBUG, "Final timeout - closing connection."); + yaz_log(log_session, "Timeout. Closing connection"); /* do we need to lod this at all */ cs_close(conn); destroy_association(assoc); @@ -385,8 +385,7 @@ void ir_session(IOCHAN h, int event) } else { - yaz_log(log_sessiondetail, - "Session idle too long. Sending close."); + yaz_log(log_sessiondetail, "Timeout. Sending Z39.50 Close"); do_close(assoc, Z_Close_lackOfActivity, 0); } return; @@ -2364,6 +2363,9 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) binitres->errstring); *resp->result = 0; } + else + assoc->state = ASSOC_UP; + if (log_request) { if (!req->idAuthentication) diff --git a/src/session.h b/src/session.h index f7c81ce..e5343ff 100644 --- a/src/session.h +++ b/src/session.h @@ -98,8 +98,8 @@ typedef struct request_q */ typedef enum { - ASSOC_NEW, /* not initialized yet */ - ASSOC_UP, /* normal operation */ + ASSOC_NEW, /* not initialized yet or HTTP session */ + ASSOC_UP, /* Z39.50 session is UP */ ASSOC_DEAD /* dead. Close if input arrives */ } association_state;