comparison dbutil.c @ 490:bd2634b03b12

- Improve DNS failure message to include lookup host
author Matt Johnston <matt@ucc.asn.au>
date Thu, 18 Sep 2008 16:34:18 +0000
parents d59f628e7baa
children b956d6151600
comparison
equal deleted inserted replaced
489:79c657a673ec 490:bd2634b03b12
319 319
320 err = getaddrinfo(remotehost, remoteport, &hints, &res0); 320 err = getaddrinfo(remotehost, remoteport, &hints, &res0);
321 if (err) { 321 if (err) {
322 if (errstring != NULL && *errstring == NULL) { 322 if (errstring != NULL && *errstring == NULL) {
323 int len; 323 int len;
324 len = 20 + strlen(gai_strerror(err)); 324 len = 100 + strlen(gai_strerror(err));
325 *errstring = (char*)m_malloc(len); 325 *errstring = (char*)m_malloc(len);
326 snprintf(*errstring, len, "Error resolving: %s", gai_strerror(err)); 326 snprintf(*errstring, len, "Error resolving '%s' port '%s'. %s",
327 remotehost, remoteport, gai_strerror(err));
327 } 328 }
328 TRACE(("Error resolving: %s", gai_strerror(err))) 329 TRACE(("Error resolving: %s", gai_strerror(err)))
329 return -1; 330 return -1;
330 } 331 }
331 332