cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] hostares.c: Relay all poll errors to c-ares

From: Joshua Kwan <jkwan_at_vmware.com>
Date: Thu, 10 Sep 2009 09:23:10 -0700

Hey all,

Here's a patch that fixed a weird error I encountered using cURL with a Glib I/O loop. In certain network conditions poll() on a particular socket would result in a POLLERR coming through during a c-ares resolve (proxied through the multi interface of cURL.) However, we don't pass that POLLERR back to c-ares and it doesn't know that it has to clean up the socket and give up.

Because POLLERR spams the loop until you take care of it, it was causing massive CPU usage in our application.

This simple patch makes it so that cURL properly communicates the POLLERR state to c-ares (as well as POLLHUP.)

P.S. Is there in a file in the source code that lists contributors? I've been requested by my company to ask if I can provide a copyright blurb somewhere, to the effect of:

"Portions of [this file] and [that file], Copyright (C) 2009 VMware, Inc."

I don't want to upset the standard source header in hostares.c (seems kind of presumptuous), but I also would like to appease my legal department :)

Thanks!
Josh

Received on 2009-09-10