+2000-10-16 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * providers/imap/camel-imap-store.c (imap_disconnect): Only send
+ the LOGOUT command if the store is connected.
+ (imap_connect): Set the 'connected' state to TRUE when we
+ successfully connect.
+ (get_folder_info): if (!topfi), 'topfi' was allocated but then
+ 'fi' was set. I think Dan meant to set topfi since fi is an
+ uninitialized value at this point.
+
+ * providers/imap/camel-imap-command.c (imap_read_response): Check
+ for the untagged BYE response and set the 'connected' state to
+ FALSE if we receive the BYE response. Return NULL if we get a BYE
+ response.
+
2000-10-16 Dan Winship <danw@helixcode.com>
* providers/imap/camel-imap-store.c (get_folder_info): Deal with
Fix camel_summary_* function rename
(imap_get_message_info_internal): Likewise.
- * camel-mime-parser.c (camel_mime_parser_finalise): Fixed a spelling mistake.
+ * camel-mime-parser.c (camel_mime_parser_finalise): Fixed a
+ spelling mistake.
* camel-folder-summary.c (camel_summary_format_address): Uh, why
do we encode and then decode here ... sigh. This is not the way
2000-10-11 Chris Toshok <toshok@helixcode.com>
- * providers/nntp/camel-nntp-store.c (nntp_store_unsubscribe_folder): remove the leading '/'.
+ * providers/nntp/camel-nntp-store.c
+ (nntp_store_unsubscribe_folder): remove the leading '/'.
(nntp_store_subscribe_folder): same.
(nntp_store_folder_subscribed): same.
g_free (respbuf);
goto next;
}
+ } else {
+ p = imap_next_word (respbuf);
+ if (!g_strncasecmp (p, "BYE", 3)) {
+ /* connection was lost, no more data to fetch */
+ store->connected = FALSE;
+ g_free (respbuf);
+ respbuf = NULL;
+ break;
+ }
}
g_ptr_array_add (response->untagged, respbuf);
if (expunged)
g_array_free (expunged, TRUE);
- if (camel_exception_is_set (ex)) {
+ if (!respbuf || camel_exception_is_set (ex)) {
camel_imap_response_free (response);
return NULL;
}
CAMEL_SERVICE_URL_NEED_HOST |
CAMEL_SERVICE_URL_ALLOW_PATH |
CAMEL_SERVICE_URL_ALLOW_AUTH);
-
+
remote_store->default_port = 143;
imap_store->dir_sep = NULL;
imap_store->current_folder = NULL;
+
+ imap_store->connected = FALSE;
}
CamelType
}
}
+ /* At this point we know we're connected... */
+ store->connected = TRUE;
+
/* Now lets find out the IMAP capabilities */
response = camel_imap_command (store, NULL, ex, "CAPABILITY");
if (!response)
{
CamelImapStore *store = CAMEL_IMAP_STORE (service);
CamelImapResponse *response;
-
- /* send the logout command */
- response = camel_imap_command (store, NULL, ex, "LOGOUT");
- camel_imap_response_free (response);
-
+
+ if (store->connected) {
+ /* send the logout command */
+ response = camel_imap_command (store, NULL, ex, "LOGOUT");
+ camel_imap_response_free (response);
+ }
+
g_free (store->dir_sep);
store->dir_sep = NULL;
get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelFolder *new_folder;
+ CamelFolder *new_folder = NULL;
char *folder_path, *summary_file, *p;
gboolean selectable;
if (!topfi) {
camel_exception_clear (ex);
topfi = g_new0 (CamelFolderInfo, 1);
- fi->full_name = g_strdup (namespace);
- fi->name = g_strdup (namespace);
+ topfi->full_name = g_strdup (namespace);
+ topfi->name = g_strdup (namespace);
}
response = camel_imap_command (imap_store, NULL, ex,