Fix RING_FINDBYHOST to actually find things. jmb found the bug, I verified his patch and committed it

svn path=/trunk/netsurf/; revision=3186
This commit is contained in:
Daniel Silverstone 2007-02-22 11:48:39 +00:00
parent d3718bd4a7
commit 657e384a84
1 changed files with 5 additions and 2 deletions

View File

@ -168,13 +168,16 @@ static int fetch_cert_verify_callback(X509_STORE_CTX *x509_ctx, void *parm);
#define RING_FINDBYHOST(ring, element, hostname) \
LOG(("RING_FINDBYHOST(%s, %s)", #ring, hostname)); \
if (ring) { \
bool found = false; \
element = ring; \
do { \
if (strcasecmp(element->host, hostname) == 0) \
if (strcasecmp(element->host, hostname) == 0) { \
found = true; \
break; \
} \
element = element->r_next; \
} while (element != ring); \
element = 0; \
if (!found) element = 0; \
} else element = 0
/** Measure the size of a ring and put it in the supplied variable */