diff options
author | Peter Williams <peterw@ximian.com> | 2001-07-18 05:22:20 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2001-07-18 05:22:20 +0800 |
commit | e8aa23866a44d1d93750f42a9c168bcd007eb7bb (patch) | |
tree | 7b112db0933f469ce7c8d3fa5089f9fc363729a1 /camel/providers | |
parent | bbfb9268af8e5d8c5a0ac346ba13efc00783d46c (diff) | |
download | gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.gz gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.bz2 gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.lz gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.xz gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.zst gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.zip |
Clean up some exception misusage.
2001-07-17 Peter Williams <peterw@ximian.com>
Clean up some exception misusage.
* providers/imap/camel-imap-command.c (camel_imap_command): Use
our own internal exception for sending the string and transfer it
to @ex if anything goes wrong.
(imap_read_response): Use our own internal exception for reading
the untagged responses and blah blah blah.
* camel-session.c (get_service): Use our own internal exception
when constructing the service and transfer it to @ex if anything
goes wrong.
* camel-remote-store.c (remote_recv_line): Instead of having
gboolean exception, use our own internal exception and copy
it to @ex if anything goes wrong.
* camel-store.c (store_sync): Create an internal exception
because sync_folder() checks it for validity. Transfer it to
@ex when done.
* camel-exception.c (camel_exception_get_description): If @ex is
NULL, complain - passing NULL exceptions to Camel is okay, but
there should be no circumstances under which they're then
examined.
(camel_exception_get_id): Same here,
(camel_exception_xfer): NULL-protect and warn if transferring from
a NULL exception.
svn path=/trunk/; revision=11177
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-command.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c index 6bca74538d..db113e0fd7 100644 --- a/camel/providers/imap/camel-imap-command.c +++ b/camel/providers/imap/camel-imap-command.c @@ -86,6 +86,7 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder, { gchar *cmdbuf; va_list ap; + CamelException internal_ex; CAMEL_IMAP_STORE_LOCK (store, command_lock); @@ -127,11 +128,13 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder, cmdbuf = imap_command_strdup_vprintf (store, fmt, ap); va_end (ap); - camel_remote_store_send_string (CAMEL_REMOTE_STORE (store), ex, + camel_exception_init (&internal_ex); + camel_remote_store_send_string (CAMEL_REMOTE_STORE (store), &internal_ex, "%c%.5d %s\r\n", store->tag_prefix, store->command++, cmdbuf); g_free (cmdbuf); - if (camel_exception_is_set (ex)) { + if (camel_exception_is_set (&internal_ex)) { + camel_exception_xfer (ex, &internal_ex); CAMEL_IMAP_STORE_UNLOCK (store, command_lock); return NULL; } @@ -172,6 +175,7 @@ static CamelImapResponse * imap_read_response (CamelImapStore *store, CamelException *ex) { CamelImapResponse *response; + CamelException internal_ex; char *respbuf, *retcode; /* Read first line */ @@ -189,11 +193,13 @@ imap_read_response (CamelImapStore *store, CamelException *ex) } response->untagged = g_ptr_array_new (); + camel_exception_init (&internal_ex); + /* Check for untagged data */ while (!strncmp (respbuf, "* ", 2)) { /* Read the rest of the response if it is multi-line. */ - respbuf = imap_read_untagged (store, respbuf, ex); - if (camel_exception_is_set (ex)) + respbuf = imap_read_untagged (store, respbuf, &internal_ex); + if (camel_exception_is_set (&internal_ex)) break; if (!g_strncasecmp (respbuf, "* BYE", 5)) { @@ -210,7 +216,8 @@ imap_read_response (CamelImapStore *store, CamelException *ex) break; } - if (!respbuf || camel_exception_is_set (ex)) { + if (!respbuf || camel_exception_is_set (&internal_ex)) { + camel_exception_xfer (ex, &internal_ex); camel_imap_response_free_without_processing (store, response); return NULL; } |