[master] ce47e75d8 Don't defer an std.ip() failure to WS_Alloc'ate

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue May 21 07:46:09 UTC 2019


commit ce47e75d80ce17b6fc21b994db057474093c75a9
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu May 9 15:21:11 2019 +0200

    Don't defer an std.ip() failure to WS_Alloc'ate
    
    At this point the workspace already overflowed so there's no point
    making further progress to fail on the next workspace operation.
    
    Incidentally, we are failing for an IP conversion, not an integer.

diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index 64aa12691..0856f7a23 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -202,8 +202,7 @@ vmod_ip(VRT_CTX, struct VARGS(ip) *a)
 
 	p = WS_Alloc(ctx->ws, vsa_suckaddr_len);
 	if (p == NULL) {
-		VSLb(ctx->vsl, SLT_VCL_Error,
-		    "vmod std.ip(): insufficient workspace");
+		VRT_fail(ctx, "std.ip: insufficient workspace");
 		return (NULL);
 	}
 
@@ -217,7 +216,7 @@ vmod_ip(VRT_CTX, struct VARGS(ip) *a)
 	if (a->valid_fallback)
 		return (a->fallback);
 
-	VRT_fail(ctx, "std.integer: conversion failed");
+	VRT_fail(ctx, "std.ip: conversion failed");
 	return (NULL);
 }
 


More information about the varnish-commit mailing list