Revision b5894e65

View differences:

ml.c
1283 1283

  
1284 1284
	/* re-schedule */
1285 1285
	struct timeval t = { 0,0 };
1286
	t.tv_sec = time(NULL) + connectbuf[con_id]->defaultSendParams.keepalive;
1287

  
1288
	event_base_once(base, -1, EV_TIMEOUT, keepalive_fn, peer, &t);
1286
	t.tv_sec = connectbuf[con_id]->defaultSendParams.keepalive;
1287
	if (connectbuf[con_id]->defaultSendParams.keepalive) 
1288
		event_base_once(base, -1, EV_TIMEOUT, keepalive_fn, peer, &t);
1289 1289
}
1290 1290

  
1291 1291
void setupKeepalive(int conn_id) {
......
1294 1294
	memcpy(peer, &connectbuf[conn_id]->external_socketID, sizeof(socket_ID));
1295 1295

  
1296 1296
	struct timeval t = { 0,0 };
1297
	t.tv_sec = time(NULL) + connectbuf[conn_id]->defaultSendParams.keepalive;
1297
	t.tv_sec = connectbuf[conn_id]->defaultSendParams.keepalive;
1298 1298

  
1299
	event_base_once(base, -1, EV_TIMEOUT, keepalive_fn, peer, &t);
1299
	if (connectbuf[conn_id]->defaultSendParams.keepalive) 
1300
		event_base_once(base, -1, EV_TIMEOUT, keepalive_fn, peer, &t);
1300 1301
}
1301 1302

  
1302 1303
/* connection functions */

Also available in: Unified diff