void *lconn_sasl_sockctx; /* for security layer */
#endif
int lconn_refcnt;
+ time_t lconn_created; /* time */
time_t lconn_lastused; /* time */
int lconn_rebind_inprogress; /* set if rebind in progress */
char ***lconn_rebind_queue; /* used if rebind in progress */
break;
}
+ conn->lconn_created = time( NULL );
+
#ifdef LDAP_DEBUG
ber_sockbuf_add_io( conn->lconn_sb, &ber_sockbuf_io_debug,
INT_MAX, (void *)"ldap_" );
lc->lconn_status = LDAP_CONNST_CONNECTED;
break;
- case -2:
- /* caller will have to call again */
- ld->ld_errno = LDAP_X_CONNECTING;
- /* fallthru */
+ case -2: {
+ /* async only occurs if a network timeout is set */
+ struct timeval *tvp = ld->ld_options.ldo_tm_net;
+ assert( tvp != NULL );
+
+ /* honor network timeout */
+ if ( time( NULL ) - lc->lconn_created <= tvp->tv_sec )
+ {
+ /* caller will have to call again */
+ ld->ld_errno = LDAP_X_CONNECTING;
+ }
+ } /* fallthru */
default:
/* error */