protocol/client: timeout tweaks

* option frame-timeout 0 now means no frame timeout
* option ping-timeout 0 now means no ping timeout
* extended frame-timeout range from 0 to 1 day
* extended ping-timeout range from 1

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 450 (frame-timeout range should be higher)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=450

BUG: 423 (Disable protocol timeout)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=423
This commit is contained in:
Anand Avati 2010-01-23 17:37:38 +00:00 committed by Anand V. Avati
parent 83d1db8ee0
commit e5f49cc81a

View File

@ -339,7 +339,7 @@ save_frame (transport_t *trans, call_frame_t *frame,
saved_frames_put (conn->saved_frames, frame, op, type, callid);
if (conn->timer == NULL) {
if (conn->timer == NULL && conn->frame_timeout) {
timeout.tv_sec = 10;
timeout.tv_usec = 0;
conn->timer = gf_timer_call_after (trans->xl->ctx, timeout,
@ -440,6 +440,9 @@ client_start_ping (void *data)
conf = this->private;
conn = trans->xl_private;
if (!conn->ping_timeout)
return;
pthread_mutex_lock (&conn->lock);
{
if ((conn->saved_frames->count == 0) ||
@ -7128,12 +7131,12 @@ struct volume_options options[] = {
},
{ .key = {"frame-timeout"},
.type = GF_OPTION_TYPE_TIME,
.min = 5,
.max = 1013,
.min = 0,
.max = 86400,
},
{ .key = {"ping-timeout"},
.type = GF_OPTION_TYPE_TIME,
.min = 5,
.min = 1,
.max = 1013,
},
{ .key = {NULL} },