aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-06-05 02:04:07 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-06-05 02:04:07 +0800
commitfdb1224ed8e93ce9b91b5eccef09de695d030dbc (patch)
tree8f1e813741d07fe3b8387c7b7256faac42e308f2 /camel
parent73d6de644d69d940ca45a462ec1f1c0d13a6b06a (diff)
downloadgsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.tar
gsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.tar.gz
gsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.tar.bz2
gsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.tar.lz
gsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.tar.xz
gsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.tar.zst
gsoc2013-evolution-fdb1224ed8e93ce9b91b5eccef09de695d030dbc.zip
Always just return 0, don't try to PR_Sync() - fsync on a socket causes an
2004-06-04 Jeffrey Stedfast <fejj@novell.com> * camel-tcp-stream-ssl.c (stream_flush): Always just return 0, don't try to PR_Sync() - fsync on a socket causes an error. * providers/imap4/camel-imap4-command.c (camel_imap4_command_step): Set exceptions when write/flush fail. * providers/imap4/camel-imap4-engine.c (camel_imap4_engine_take_stream): Set an exception in the case where we get an unexpected greeting from the server. * providers/imap4/camel-imap4-store.c (imap4_create_folder): store->dir_sep no longer exists, so query the engine for the directory separator for the parent_folder. (imap4_build_folder_info): CamelFolderInfo no longer has a path component. svn path=/trunk/; revision=26217
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog18
-rw-r--r--camel/camel-tcp-stream-ssl.c3
-rw-r--r--camel/providers/imap4/camel-imap4-command.c16
-rw-r--r--camel/providers/imap4/camel-imap4-engine.c6
-rw-r--r--camel/providers/imap4/camel-imap4-store.c8
5 files changed, 42 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d4419611b9..fe763f9fe3 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,21 @@
+2004-06-04 Jeffrey Stedfast <fejj@novell.com>
+
+ * camel-tcp-stream-ssl.c (stream_flush): Always just return 0,
+ don't try to PR_Sync() - fsync on a socket causes an error.
+
+ * providers/imap4/camel-imap4-command.c
+ (camel_imap4_command_step): Set exceptions when write/flush fail.
+
+ * providers/imap4/camel-imap4-engine.c
+ (camel_imap4_engine_take_stream): Set an exception in the case
+ where we get an unexpected greeting from the server.
+
+ * providers/imap4/camel-imap4-store.c (imap4_create_folder):
+ store->dir_sep no longer exists, so query the engine for the
+ directory separator for the parent_folder.
+ (imap4_build_folder_info): CamelFolderInfo no longer has a path
+ component.
+
2004-06-03 Not Zed <NotZed@Ximian.com>
* providers/nntp/camel-nntp-store.c (camel_nntp_command):
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index fd6f4ff550..820912ffa5 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -477,7 +477,8 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
static int
stream_flush (CamelStream *stream)
{
- return PR_Sync (((CamelTcpStreamSSL *)stream)->priv->sockfd);
+ /*return PR_Sync (((CamelTcpStreamSSL *)stream)->priv->sockfd);*/
+ return 0;
}
static int
diff --git a/camel/providers/imap4/camel-imap4-command.c b/camel/providers/imap4/camel-imap4-command.c
index c1ff3a289b..dc3d43c5d4 100644
--- a/camel/providers/imap4/camel-imap4-command.c
+++ b/camel/providers/imap4/camel-imap4-command.c
@@ -494,7 +494,7 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
if (ic->part == ic->parts) {
ic->tag = g_strdup_printf ("%c%.5u", engine->tagprefix, engine->tag++);
camel_stream_printf (engine->ostream, "%s ", ic->tag);
- d(fprintf (stderr, "sending : %s ", ic->tag));
+ d(fprintf (stderr, "sending: %s ", ic->tag));
}
#if d(!)0
@@ -514,7 +514,7 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
eoln++;
if (sending)
- fwrite ("sending : ", 1, 10, stderr);
+ fwrite ("sending: ", 1, 10, stderr);
fwrite (linebuf, 1, eoln - linebuf, stderr);
linebuf = eoln + 1;
@@ -526,11 +526,19 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
linebuf = ic->part->buffer;
len = ic->part->buflen;
- if ((nwritten = camel_stream_write (engine->ostream, linebuf, len)) == -1)
+ if ((nwritten = camel_stream_write (engine->ostream, linebuf, len)) == -1) {
+ camel_exception_setv (&ic->ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Failed sending command to IMAP server %s: %s"),
+ engine->url->host, g_strerror (errno));
goto exception;
+ }
- if (camel_stream_flush (engine->ostream) == -1)
+ if (camel_stream_flush (engine->ostream) == -1) {
+ camel_exception_setv (&ic->ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Failed sending command to IMAP server %s: %s"),
+ engine->url->host, g_strerror (errno));
goto exception;
+ }
/* now we need to read the response(s) from the IMAP4 server */
diff --git a/camel/providers/imap4/camel-imap4-engine.c b/camel/providers/imap4/camel-imap4-engine.c
index a84ac1dfba..be4a7e8c02 100644
--- a/camel/providers/imap4/camel-imap4-engine.c
+++ b/camel/providers/imap4/camel-imap4-engine.c
@@ -229,7 +229,8 @@ camel_imap4_engine_take_stream (CamelIMAP4Engine *engine, CamelStream *stream, C
if ((code = camel_imap4_engine_handle_untagged_1 (engine, &token, ex)) == -1) {
goto exception;
} else if (code != CAMEL_IMAP4_UNTAGGED_OK && code != CAMEL_IMAP4_UNTAGGED_PREAUTH) {
- /* FIXME: set an error? */
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unexpected greeting from IMAP server %s."),
+ engine->url->host);
goto exception;
}
@@ -268,7 +269,10 @@ camel_imap4_engine_capability (CamelIMAP4Engine *engine, CamelException *ex)
while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
;
+ fprintf (stderr, "id = %d; status = %d\n", id, ic->status);
+
if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
+ fprintf (stderr, "exception: %s\n", ic->ex.desc);
camel_exception_xfer (ex, &ic->ex);
retval = -1;
}
diff --git a/camel/providers/imap4/camel-imap4-store.c b/camel/providers/imap4/camel-imap4-store.c
index 85ae32407a..8e228be71a 100644
--- a/camel/providers/imap4/camel-imap4-store.c
+++ b/camel/providers/imap4/camel-imap4-store.c
@@ -773,11 +773,14 @@ imap4_create_folder (CamelStore *store, const char *parent_name, const char *fol
char *utf7_name;
const char *c;
char *name;
+ char sep;
int id;
+ sep = imap4_get_path_delim (engine, parent_name);
+
c = folder_name;
while (*c != '\0') {
- if (*c == store->dir_sep || strchr ("#%*", *c)) {
+ if (*c == sep || strchr ("/#%*", *c)) {
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
_("The folder name \"%s\" is invalid because "
"it contains the character \"%c\""),
@@ -959,12 +962,11 @@ imap4_build_folder_info (CamelIMAP4Engine *engine, guint32 flags, GPtrArray *arr
p++;
}
+ p = strrchr (name, '/');
camel_url_set_fragment (url, name);
fi->full_name = name;
- p = strrchr (name, '/');
fi->name = g_strdup (p ? p + 1: name);
- fi->path = g_strdup_printf ("/%s", name);
fi->uri = camel_url_to_string (url, 0);
fi->flags = list->flags;