Added prototype for camel_folder_summary_remove_range().

2003-06-25  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.h: Added prototype for
	camel_folder_summary_remove_range().

2003-06-25  Not Zed  <NotZed@Ximian.com>

	** See bug #45386

	* camel-service.c (camel_gethostbyname, camel_gethostbyaddr): Make
	sure we have an exception that we test against.

svn path=/trunk/; revision=21534
This commit is contained in:
Jeffrey Stedfast
2003-06-25 15:43:46 +00:00
committed by Jeffrey Stedfast
parent cc6acbe24f
commit 1806b16a14
3 changed files with 38 additions and 17 deletions

View File

@ -1,3 +1,15 @@
2003-06-25 Jeffrey Stedfast <fejj@ximian.com>
* camel-folder-summary.h: Added prototype for
camel_folder_summary_remove_range().
2003-06-25 Not Zed <NotZed@Ximian.com>
** See bug #45386
* camel-service.c (camel_gethostbyname, camel_gethostbyaddr): Make
sure we have an exception that we test against.
2003-06-20 Not Zed <NotZed@Ximian.com> 2003-06-20 Not Zed <NotZed@Ximian.com>
** See bug #43887 ** See bug #43887

View File

@ -255,6 +255,7 @@ void camel_folder_summary_content_info_free(CamelFolderSummary *s, CamelMessageC
void camel_folder_summary_remove(CamelFolderSummary *s, CamelMessageInfo *info); void camel_folder_summary_remove(CamelFolderSummary *s, CamelMessageInfo *info);
void camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid); void camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid);
void camel_folder_summary_remove_index(CamelFolderSummary *s, int); void camel_folder_summary_remove_index(CamelFolderSummary *s, int);
void camel_folder_summary_remove_range(CamelFolderSummary *s, int start, int end);
/* remove all items */ /* remove all items */
void camel_folder_summary_clear(CamelFolderSummary *s); void camel_folder_summary_clear(CamelFolderSummary *s);

View File

@ -731,20 +731,22 @@ get_hostbyname(void *data)
} }
struct hostent * struct hostent *
camel_gethostbyname (const char *name, CamelException *ex) camel_gethostbyname (const char *name, CamelException *exout)
{ {
#ifdef ENABLE_THREADS #ifdef ENABLE_THREADS
int fdmax, status, fd, cancel_fd; int fdmax, status, fd, cancel_fd;
#endif #endif
struct _lookup_msg *msg; struct _lookup_msg *msg;
CamelException ex;
g_return_val_if_fail(name != NULL, NULL); g_return_val_if_fail(name != NULL, NULL);
if (camel_operation_cancel_check(NULL)) { if (camel_operation_cancel_check(NULL)) {
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled")); camel_exception_set (exout, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
return NULL; return NULL;
} }
camel_exception_init(&ex);
camel_operation_start_transient(NULL, _("Resolving: %s"), name); camel_operation_start_transient(NULL, _("Resolving: %s"), name);
msg = g_malloc0(sizeof(*msg)); msg = g_malloc0(sizeof(*msg));
@ -778,9 +780,9 @@ camel_gethostbyname (const char *name, CamelException *ex)
if (status == -1 || FD_ISSET(cancel_fd, &rdset)) { if (status == -1 || FD_ISSET(cancel_fd, &rdset)) {
if (status == -1) if (status == -1)
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failure in name lookup: %s"), g_strerror(errno)); camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Failure in name lookup: %s"), g_strerror(errno));
else else
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled")); camel_exception_setv(&ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
/* We cancel so if the thread impl is decent it causes immediate exit. /* We cancel so if the thread impl is decent it causes immediate exit.
We detach so we dont need to wait for it to exit if it isn't. We detach so we dont need to wait for it to exit if it isn't.
@ -799,7 +801,7 @@ camel_gethostbyname (const char *name, CamelException *ex)
d(printf("child done\n")); d(printf("child done\n"));
} }
} else { } else {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(errno)); camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(errno));
} }
e_msgport_destroy(reply_port); e_msgport_destroy(reply_port);
} }
@ -807,15 +809,15 @@ camel_gethostbyname (const char *name, CamelException *ex)
camel_operation_end(NULL); camel_operation_end(NULL);
if (!camel_exception_is_set(ex)) { if (!camel_exception_is_set(&ex)) {
if (msg->result == 0) if (msg->result == 0)
return &msg->hostbuf; return &msg->hostbuf;
if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA) if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA)
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
_("Host lookup failed: %s: host not found"), name); _("Host lookup failed: %s: host not found"), name);
else else
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
_("Host lookup failed: %s: unknown reason"), name); _("Host lookup failed: %s: unknown reason"), name);
} }
@ -824,6 +826,8 @@ camel_gethostbyname (const char *name, CamelException *ex)
g_free(msg); g_free(msg);
} }
camel_exception_xfer(exout, &ex);
return NULL; return NULL;
} }
@ -857,20 +861,22 @@ get_hostbyaddr (void *data)
struct hostent * struct hostent *
camel_gethostbyaddr (const char *addr, int len, int type, CamelException *ex) camel_gethostbyaddr (const char *addr, int len, int type, CamelException *exout)
{ {
#ifdef ENABLE_THREADS #ifdef ENABLE_THREADS
int fdmax, status, fd, cancel_fd; int fdmax, status, fd, cancel_fd;
#endif #endif
struct _lookup_msg *msg; struct _lookup_msg *msg;
CamelException ex;
g_return_val_if_fail (addr != NULL, NULL); g_return_val_if_fail (addr != NULL, NULL);
if (camel_operation_cancel_check (NULL)) { if (camel_operation_cancel_check (NULL)) {
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled")); camel_exception_set (exout, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
return NULL; return NULL;
} }
camel_exception_init(&ex);
camel_operation_start_transient (NULL, _("Resolving address")); camel_operation_start_transient (NULL, _("Resolving address"));
msg = g_malloc0 (sizeof (struct _lookup_msg)); msg = g_malloc0 (sizeof (struct _lookup_msg));
@ -906,9 +912,9 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *ex)
if (status == -1 || FD_ISSET(cancel_fd, &rdset)) { if (status == -1 || FD_ISSET(cancel_fd, &rdset)) {
if (status == -1) if (status == -1)
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failure in name lookup: %s"), g_strerror(errno)); camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Failure in name lookup: %s"), g_strerror(errno));
else else
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled")); camel_exception_setv(&ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
/* We cancel so if the thread impl is decent it causes immediate exit. /* We cancel so if the thread impl is decent it causes immediate exit.
We detach so we dont need to wait for it to exit if it isn't. We detach so we dont need to wait for it to exit if it isn't.
@ -934,15 +940,15 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *ex)
camel_operation_end (NULL); camel_operation_end (NULL);
if (!camel_exception_is_set(ex)) { if (!camel_exception_is_set(&ex)) {
if (msg->result == 0) if (msg->result == 0)
return &msg->hostbuf; return &msg->hostbuf;
if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA) if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA)
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
_("Host lookup failed: host not found")); _("Host lookup failed: host not found"));
else else
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
_("Host lookup failed: unknown reason")); _("Host lookup failed: unknown reason"));
} }
@ -951,6 +957,8 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *ex)
g_free(msg); g_free(msg);
} }
camel_exception_xfer(exout, &ex);
return NULL; return NULL;
} }