From fc281a966c29421c896746d784a6f1393fe37f3f Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 17 Apr 2002 01:25:28 +0000 Subject: Get rid of an unused variable. 2002-04-16 Jeffrey Stedfast * camel-filter-driver.c (camel_filter_driver_filter_folder): Get rid of an unused variable. * providers/smtp/camel-smtp-transport.c (smtp_helo): Use camel_gethostbyaddr since gethostbyaddr is not reentrant. * camel-http-stream.c (http_connect): Updated after the rename of camel_get_host_byname. * camel-service.c (camel_gethostbyname): Renamed. (camel_gethostbyaddr): New cancellable/reentrant version of gethostbyaddr. svn path=/trunk/; revision=16484 --- camel/providers/smtp/camel-smtp-transport.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index f71f8b4050..2a5640d7ab 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -831,24 +831,30 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex) { /* say hello to the server */ char *name, *cmdbuf, *respbuf = NULL; - const char *token; struct hostent *host; + CamelException err; + const char *token; camel_operation_start_transient (NULL, _("SMTP Greeting")); /* get the local host name */ - host = gethostbyaddr ((char *)&transport->localaddr->address, - transport->localaddr->length, AF_INET); - if (host && host->h_name) + camel_exception_init (&err); + host = camel_gethostbyaddr ((char *) &transport->localaddr->address, + transport->localaddr->length, AF_INET, &err); + camel_exception_clear (&err); + + if (host && host->h_name) { name = g_strdup (host->h_name); - else { + } else { name = g_strdup_printf ("[%d.%d.%d.%d]", transport->localaddr->address[0], transport->localaddr->address[1], transport->localaddr->address[2], transport->localaddr->address[3]); } - + + camel_free_host (host); + /* hiya server! how are you today? */ if (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) cmdbuf = g_strdup_printf ("EHLO %s\r\n", name); -- cgit