From: Nickolai Zeldovich Date: Mon, 13 Jan 2003 20:24:34 +0000 (+0000) Subject: Generalize the rx idle dead time support to include client connections, X-Git-Tag: openafs-devel-1_3_50~435 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=22360fcf88dbe26614586341dc8394b233968ad2;p=packages%2Fo%2Fopenafs.git Generalize the rx idle dead time support to include client connections, in addition to server connections. This will eventually be used by the AFS client to better time out non-replying servers. --- diff --git a/src/rx/rx.c b/src/rx/rx.c index ab1dc0cd3..ea76368af 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -2275,6 +2275,7 @@ struct rx_connection *rxi_FindConnection(osi_socket socket, conn->nSpecific = 0; conn->specific = NULL; rx_SetConnDeadTime(conn, service->connDeadTime); + rx_SetConnIdleDeadTime(conn, service->idleDeadTime); /* Notify security object of the new connection */ RXS_NewConnection(conn->securityObject, conn); /* XXXX Connection timeout? */ @@ -5108,7 +5109,6 @@ int rxi_CheckCall(register struct rx_call *call) #endif /* RX_ENABLE_LOCKS */ { register struct rx_connection *conn = call->conn; - register struct rx_service *tservice; afs_uint32 now; afs_uint32 deadTime; @@ -5155,10 +5155,8 @@ int rxi_CheckCall(register struct rx_call *call) * attached process can die reasonably gracefully. */ } /* see if we have a non-activity timeout */ - tservice = conn->service; - if ((conn->type == RX_SERVER_CONNECTION) && call->startWait - && tservice->idleDeadTime - && ((call->startWait + tservice->idleDeadTime) < now)) { + if (call->startWait && conn->idleDeadTime + && ((call->startWait + conn->idleDeadTime) < now)) { if (call->state == RX_STATE_ACTIVE) { rxi_CallError(call, RX_CALL_TIMEOUT); return -1; diff --git a/src/rx/rx.h b/src/rx/rx.h index cc27a46cd..4027d94ba 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -162,8 +162,9 @@ int ntoh_syserr_conv(int error); /* Enable or disable asymmetric client checking for a service */ #define rx_SetCheckReach(service, x) ((service)->checkReach = (x)) -/* Set connection hard timeout for a connection */ +/* Set connection hard and idle timeouts for a connection */ #define rx_SetConnHardDeadTime(conn, seconds) ((conn)->hardDeadTime = (seconds)) +#define rx_SetConnIdleDeadTime(conn, seconds) ((conn)->idleDeadTime = (seconds)) /* Set the overload threshold and the overload error */ #define rx_SetBusyThreshold(threshold, code) (rx_BusyThreshold=(threshold),rx_BusyError=(code)) @@ -257,6 +258,7 @@ struct rx_connection { int lastSendTime; /* Last send time for this connection */ u_short secondsUntilDead; /* Maximum silence from peer before RX_CALL_DEAD */ u_short hardDeadTime; /* hard max for call execution */ + u_short idleDeadTime; /* max time a call can be idle (no data) */ u_char ackRate; /* how many packets between ack requests */ u_char makeCallWaiters; /* how many rx_NewCalls are waiting */ int nSpecific; /* number entries in specific data */