[master] 994f073 Polish

Federico G. Schwindt fgsch at lodoss.net
Fri Mar 3 15:47:05 CET 2017


commit 994f073602ff0e2a52dd92a2bdd2ece6269237cd
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Fri Mar 3 14:32:11 2017 +0000

    Polish

diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index d116b9c..b2f1dc4 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -875,16 +875,15 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
 			if (fmt == INT) {
 				e1 = vcc_mk_expr(fmt, "-%.*s", PF(tl->t));
 				vcc_NextToken(tl);
-			} else if (fmt == REAL) {
-				e1 = vcc_mk_expr(fmt, "-%f", vcc_DoubleVal(tl));
 			} else if (fmt == DURATION) {
-				vcc_NumVal(tl, &d, &i);
+				vcc_Duration(tl, &d);
 				ERRCHK(tl);
-				e1 = vcc_mk_expr(fmt, "-%g",
-				    d * vcc_TimeUnit(tl));
-			} else {
+				e1 = vcc_mk_expr(fmt, "-%g", d);
+			} else if (fmt == REAL)
+				e1 = vcc_mk_expr(fmt, "-%f",
+				    vcc_DoubleVal(tl));
+			else
 				INCOMPL();
-			}
 			ERRCHK(tl);
 			e1->constant = EXPR_CONST;
 			*e = e1;
diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index 81e49f7..557e88d 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -260,8 +260,6 @@ vmod_getenv(VRT_CTX, VCL_STRING name)
 VCL_VOID __match_proto__(td_std_late_100_continue)
 vmod_late_100_continue(VRT_CTX, VCL_BOOL late)
 {
-	struct req *req;
-
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	if (ctx->method != VCL_MET_RECV) {
 		VSLb(ctx->vsl, SLT_VCL_Error,
@@ -269,11 +267,7 @@ vmod_late_100_continue(VRT_CTX, VCL_BOOL late)
 		return;
 	}
 
-	req = ctx->req;
-	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
-
-	if (! req->want100cont)
-		return;
-
-	req->late100cont = !!late;
+	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
+	if (ctx->req->want100cont)
+		ctx->req->late100cont = late;
 }



More information about the varnish-commit mailing list