[PATCH] Set error if callback returned < 0

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Sep 14 09:21:05 CEST 2015

In message <CAJV_h0awgGdr2qiSkuTdOkC7COC6B7BzAj_8DEMRCbcLY58v4w at mail.gmail.com>, Federico Schwindt writes:

> Error message will be reported as e.g. "Connection refused" instead of simply "
> (null)".
> OK?

I don't think that is helpful.

First, we have no idea if the errno at that point corresponds to whatever
the iterator function failed on, and second there may not even be an
associated errno.

The correct solution would be to pass the 'err' variable to the iterator
so it can set an appropriate text.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-dev mailing list