Commit 757e7195 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vrt_var: Return VRT_DECIMAL_MAX for "never" timeouts

parent cd3c9f8e
......@@ -45,6 +45,8 @@
#include "vrt_obj.h"
#define VRT_TMO(tmo) (isinf(tmo) ? VRT_DECIMAL_MAX : tmo)
static char vrt_hostname[255] = "";
/*--------------------------------------------------------------------
......@@ -403,7 +405,7 @@ VRT_r_bereq_##which(VRT_CTX) \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); \
return (BUSYOBJ_TMO(ctx->bo, prefix, which)); \
return (VRT_TMO(BUSYOBJ_TMO(ctx->bo, prefix, which))); \
} \
\
VCL_VOID \
......@@ -1144,7 +1146,7 @@ VRT_r_sess_##x(VRT_CTX) \
{ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
CHECK_OBJ_NOTNULL(ctx->sp, SESS_MAGIC); \
return (SESS_TMO(ctx->sp, x)); \
return (VRT_TMO(SESS_TMO(ctx->sp, x))); \
} \
\
VCL_VOID \
......
varnishtest "Disabled timeout in VCL"
varnish v1 -cliok "param.set idle_send_timeout never"
varnish v1 -vcl {
backend be none;
sub vcl_recv {
return (synth(200));
}
sub vcl_synth {
set resp.http.idle_send_timeout = sess.idle_send_timeout;
}
} -start
client c1 {
txreq
rxresp
expect resp.http.idle_send_timeout == 999999999999.999
} -run
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