Commit e1e571b0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Unify/Macroize bereq timeout fields



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5378 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 49d9d887
......@@ -450,48 +450,28 @@ VRT_r_beresp_ttl(const struct sess *sp)
return (sp->wrk->ttl - sp->t_req);
}
/*--------------------------------------------------------------------*/
void
VRT_l_bereq_connect_timeout(struct sess *sp, double num)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
sp->wrk->connect_timeout = (num > 0 ? num : 0);
}
double
VRT_r_bereq_connect_timeout(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
return (sp->wrk->connect_timeout);
}
void
VRT_l_bereq_first_byte_timeout(struct sess *sp, double num)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
sp->wrk->first_byte_timeout = (num > 0 ? num : 0);
}
double
VRT_r_bereq_first_byte_timeout(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
return (sp->wrk->first_byte_timeout);
}
void
VRT_l_bereq_between_bytes_timeout(struct sess *sp, double num)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
sp->wrk->between_bytes_timeout = (num > 0 ? num : 0);
#define BEREQ_TIMEOUT(which) \
void \
VRT_l_bereq_##which(struct sess *sp, double num) \
{ \
\
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \
sp->wrk->which = (num > 0.0 ? num : 0.0); \
} \
\
double \
VRT_r_bereq_##which(struct sess *sp) \
{ \
\
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \
return(sp->wrk->which); \
}
double
VRT_r_bereq_between_bytes_timeout(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
return (sp->wrk->between_bytes_timeout);
}
BEREQ_TIMEOUT(connect_timeout)
BEREQ_TIMEOUT(first_byte_timeout)
BEREQ_TIMEOUT(between_bytes_timeout)
/*--------------------------------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment