commit 506d4313901ffece8169eba51617eb87aee4c2a7
Author: Saverio Proto <zioproto@gmail.com>
Date:   Mon May 6 12:41:55 2013 +0200

    [packages] polipo: Don't spuriously ignore CNAMEs after a DNS timeout. Polipo might quit with SIGPIPE without this patch

diff --git a/net/polipo/Makefile b/net/polipo/Makefile
index 8099e65..40d857d 100644
--- a/net/polipo/Makefile
+++ b/net/polipo/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=polipo
 PKG_VERSION:=1.0.4.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://freehaven.net/~chrisd/polipo/
diff --git a/net/polipo/patches/30_Don-t-spuriously-ignore-CNAMEs-after-a-DNS-timeout.dpatch b/net/polipo/patches/30_Don-t-spuriously-ignore-CNAMEs-after-a-DNS-timeout.dpatch
new file mode 100644
index 0000000..343c74c
--- /dev/null
+++ b/net/polipo/patches/30_Don-t-spuriously-ignore-CNAMEs-after-a-DNS-timeout.dpatch
@@ -0,0 +1,45 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30_Don-t-spuriously-ignore-CNAMEs-after-a-DNS-timeout.dpatch by Alan Jenkins
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Don't spuriously ignore CNAMEs after a DNS timeout
+## DP: cherry-picked from 1144bc9a25fe685bf5a8d18a22d4fa79b9ade75b
+
+@DPATCH@
+
+From 1144bc9a25fe685bf5a8d18a22d4fa79b9ade75b Mon Sep 17 00:00:00 2001
+From: Juliusz Chroboczek <jch@pps.jussieu.fr>
+Date: Tue, 10 Nov 2009 16:48:04 -0800
+Subject: [PATCH] Don't spuriously ignore CNAMEs after a DNS timeout.
+
+Ignore-this: 60fbb7453699ecbff6961bf1622dfb3
+From Alan Jenkins.
+
+darcs-hash:20091111004804-4cc09-0d24709fbdebd5a7bdc5ce01a6a76aab5bc1241c.gz
+---
+ dns.c |    9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/dns.c b/dns.c
+index 8d4ac75..1a5b39b 100644
+--- a/dns.c
++++ b/dns.c
+@@ -1181,6 +1181,15 @@ dnsReplyHandler(int abort, FdEventHandlerPtr event)
+         } else
+             releaseAtom(value);
+     } else if(af == 0) {
++        /* Ignore errors in this case. */
++        if(query->inet4 && query->inet4->length == 0) {
++            releaseAtom(query->inet4);
++            query->inet4 = NULL;
++        }
++        if(query->inet6 && query->inet6->length == 0) {
++            releaseAtom(query->inet6);
++            query->inet6 = NULL;
++        }
+         if(query->inet4 || query->inet6) {
+             do_log(L_WARN, "Host %s has both %s and CNAME -- "
+                    "ignoring CNAME.\n", scrub(query->name->string),
+-- 
+1.7.1
+
