aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-10-07 02:04:52 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-10-07 02:04:52 +0800
commit55a94e210c77963dd47da64d9ed46b6c63825f6e (patch)
tree21125eaaecc6d625a1ea00979433e11c8e823435
parent15605e194bff0e9abaffa9e8f96c513794c3e0d7 (diff)
downloadgsoc2013-evolution-55a94e210c77963dd47da64d9ed46b6c63825f6e.tar.gz
gsoc2013-evolution-55a94e210c77963dd47da64d9ed46b6c63825f6e.tar.zst
gsoc2013-evolution-55a94e210c77963dd47da64d9ed46b6c63825f6e.zip
Check msg->result for error and set an exception if appropriate.
2004-10-05 Jeffrey Stedfast <fejj@novell.com> * camel-service.c (camel_getaddrinfo): Check msg->result for error and set an exception if appropriate. (camel_getnameinfo): Same. 2004-10-04 Jeffrey Stedfast <fejj@novell.com> * camel-service.c (camel_getaddrinfo): Add a non-const cast for hints when changing the ai_family member in the IPv6-disabled case. Fixes bug #67028. svn path=/trunk/; revision=27482
-rw-r--r--camel/ChangeLog18
-rw-r--r--camel/camel-service.c30
2 files changed, 37 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 2bd874c943..5d38ad5f82 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,15 @@
+2004-10-05 Jeffrey Stedfast <fejj@novell.com>
+
+ * camel-service.c (camel_getaddrinfo): Check msg->result for error
+ and set an exception if appropriate.
+ (camel_getnameinfo): Same.
+
+2004-10-04 Jeffrey Stedfast <fejj@novell.com>
+
+ * camel-service.c (camel_getaddrinfo): Add a non-const cast for
+ hints when changing the ai_family member in the IPv6-disabled
+ case. Fixes bug #67028.
+
2004-10-05 Not Zed <NotZed@Ximian.com>
** See bug #67527.
@@ -12,6 +24,12 @@
2004-10-01 Jeffrey Stedfast <fejj@novell.com>
+ * providers/imap4/camel-imap4-folder.c (imap4_sync): If we aren't
+ online, we're done. nothing to do.
+ (imap4_refresh_info): Same.
+ (imap4_append_message): Same but set an exception.
+ (imap4_transfer_messages_to): Same.
+
* camel-service.c (camel_getaddrinfo): Avoid assigning a value to
the member of a const struct (which newer gcc's apparently break
over) by casting to non-const.
diff --git a/camel/camel-service.c b/camel/camel-service.c
index ac427cab89..b916d5c05a 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
+#include <netdb.h>
#include <errno.h>
#include <sys/poll.h>
@@ -739,7 +740,7 @@ cs_waitinfo(void *(worker)(void *), struct _addrinfo_msg *msg, const char *error
d(printf("child done\n"));
}
} else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, "%s: %s: %s", _("cannot create thread"), g_strerror(err));
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, "%s: %s: %s", error, _("cannot create thread"), g_strerror(err));
}
e_msgport_destroy(reply_port);
@@ -877,7 +878,7 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *
struct _addrinfo_msg *msg;
struct addrinfo *res = NULL;
#ifndef ENABLE_IPv6
- struct addrinfo *myhints;
+ struct addrinfo myhints;
#endif
g_return_val_if_fail(name != NULL, NULL);
@@ -890,12 +891,13 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *
/* force ipv4 addresses only */
#ifndef ENABLE_IPv6
- if (hints == NULL) {
+ if (hints == NULL)
memset(&myhints, 0, sizeof(myhints));
- hints = &myhints;
- }
-
- ((struct addrinfo *) hints)->ai_family = AF_INET;
+ else
+ memcpy (&myhints, hints, sizeof (myhints));
+
+ myhints.ai_family = AF_INET;
+ hints = &myhints;
#endif
msg = g_malloc0(sizeof(*msg));
@@ -907,11 +909,15 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *
msg->hostbuflen = 1024;
msg->hostbufmem = g_malloc(msg->hostbuflen);
#endif
- if (cs_waitinfo(cs_getaddrinfo, msg, _("Host lookup failed"), ex) == 0)
+ if (cs_waitinfo(cs_getaddrinfo, msg, _("Host lookup failed"), ex) == 0) {
+ if (msg->result != 0)
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: %s: %s"),
+ name, gai_strerror (msg->result));
+
cs_freeinfo(msg);
- else
+ } else
res = NULL;
-
+
camel_operation_end(NULL);
return res;
@@ -1034,7 +1040,9 @@ camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, char **host, char
#endif
cs_waitinfo(cs_getnameinfo, msg, _("Name lookup failed"), ex);
- result = msg->result;
+ if ((result = msg->result) != 0)
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Name lookup failed: %s"),
+ gai_strerror (result));
if (host)
*host = g_strdup(msg->host);