aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
author9 <NotZed@Ximian.com>2001-09-19 16:28:36 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-09-19 16:28:36 +0800
commitbef39dc4e0bbdb334fef71f973bcb7781dce65df (patch)
treefbb2c1a5fc3d24232d34dbce01edd587e8b84002 /camel
parentd9775521cad4588963b2edb297551c85fae1459f (diff)
downloadgsoc2013-evolution-bef39dc4e0bbdb334fef71f973bcb7781dce65df.tar.gz
gsoc2013-evolution-bef39dc4e0bbdb334fef71f973bcb7781dce65df.tar.zst
gsoc2013-evolution-bef39dc4e0bbdb334fef71f973bcb7781dce65df.zip
General cleanup of camel debug printfs.
2001-09-19 <NotZed@Ximian.com> * General cleanup of camel debug printfs. * camel-lock.c (camel_lock_fcntl): Changed to return 'success' if the error indicates file locking isn't supported on this filesystem. Still return a warning just incase (if its the first time). Might fix a lot of reported bugs. * providers/local/camel-spool-store.c (get_folder_info): Dont include the empty // host part in the uri. This 'breaks' the service lookup. svn path=/trunk/; revision=12973
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog20
-rw-r--r--camel/camel-folder-search.c2
-rw-r--r--camel/camel-folder-thread.c2
-rw-r--r--camel/camel-folder.c4
-rw-r--r--camel/camel-lock.c16
-rw-r--r--camel/camel-mime-utils.c2
-rw-r--r--camel/camel-movemail.c4
-rw-r--r--camel/camel-session.c12
-rw-r--r--camel/camel-store.c6
-rw-r--r--camel/camel-store.h8
-rw-r--r--camel/camel-url.c2
-rw-r--r--camel/camel-vee-folder.c10
-rw-r--r--camel/camel-vee-store.c6
-rw-r--r--camel/providers/local/camel-local-store.c2
-rw-r--r--camel/providers/local/camel-maildir-store.c8
-rw-r--r--camel/providers/local/camel-mbox-summary.c2
-rw-r--r--camel/providers/local/camel-spool-store.c8
-rw-r--r--camel/providers/local/camel-spool-summary.c2
18 files changed, 76 insertions, 40 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d18956ab75..d198d0a10b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,9 +1,29 @@
+2001-09-19 <NotZed@Ximian.com>
+
+ * General cleanup of camel debug printfs.
+
+ * camel-lock.c (camel_lock_fcntl): Changed to return 'success' if
+ the error indicates file locking isn't supported on this
+ filesystem. Still return a warning just incase (if its the first
+ time). Might fix a lot of reported bugs.
+
+ * providers/local/camel-spool-store.c (get_folder_info): Dont
+ include the empty // host part in the uri. This 'breaks' the
+ service lookup.
+
2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-utils.c: Match mailing-list header List-Owner.
2001-09-18 <NotZed@Ximian.com>
+ * camel-vee-store.c (vee_get_folder): Fix the uri genereated for
+ the folderinfo for the folder_created event.
+
+ * camel-store.h: Added 'total' to CamelFolderInfo.
+
+2000-09-18 <NotZed@Ximian.com>
+
* providers/local/camel-maildir-folder.c
(camel_maildir_folder_new): If filter inbox is set on the store,
and we're opening inbox '', then enable filtering on new messages.
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 4d644a256a..a72a5743ad 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -382,7 +382,7 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
unfree'd results as well. */
g_hash_table_insert(p->mempool_hash, matches, pool);
} else {
- printf("no result!\n");
+ d(printf("no result!\n"));
}
search->folder = NULL;
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index 40f0d3d77f..2d61938f08 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -40,7 +40,7 @@
#define d(x)
-#define TIMEIT
+/*#define TIMEIT*/
#ifdef TIMEIT
#include <sys/time.h>
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index dd76c36673..9798de5c7d 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -1404,8 +1404,8 @@ folder_changed (CamelObject *obj, gpointer event_data)
GPtrArray *recents = g_ptr_array_new();
int i;
struct _folder_filter_msg *msg;
-
- (printf("** Have '%d' recent messages, launching thread to process them\n", changed->uid_recent->len));
+
+ d(printf("** Have '%d' recent messages, launching thread to process them\n", changed->uid_recent->len));
folder->priv->frozen++;
msg = camel_session_thread_msg_new(session, &filter_ops, sizeof(*msg));
diff --git a/camel/camel-lock.c b/camel/camel-lock.c
index 1bb2ebc35b..d8064d5eff 100644
--- a/camel/camel-lock.c
+++ b/camel/camel-lock.c
@@ -198,8 +198,20 @@ camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex)
memset(&lock, 0, sizeof(lock));
lock.l_type = type==CAMEL_LOCK_READ?F_RDLCK:F_WRLCK;
if (fcntl(fd, F_SETLK, &lock) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to get lock using fcntl(2): %s"), strerror(errno));
- return -1;
+ /* If we get a 'locking not vailable' type error,
+ we assume the filesystem doesn't support fcntl() locking */
+ /* this is somewhat system-dependent */
+ if (errno != EINVAL && errno != ENOLCK) {
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to get lock using fcntl(2): %s"),
+ strerror(errno));
+ return -1;
+ } else {
+ static int failed = 0;
+
+ if (failed == 0)
+ fprintf(stderr, "fcntl(2) locking appears not to work on this filesystem");
+ failed++;
+ }
}
#endif
return 0;
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 0f9dd9d37a..6bbf21cd5f 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -2922,7 +2922,7 @@ header_param_list_format_append (GString *out, struct _header_param *p)
else
quote_word (out, TRUE, inptr, ptr - inptr);
- printf ("wrote: %s\n", out->str + here);
+ d(printf ("wrote: %s\n", out->str + here));
used += (out->len - here);
diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c
index fec8e5fc10..35918105aa 100644
--- a/camel/camel-movemail.c
+++ b/camel/camel-movemail.c
@@ -367,7 +367,7 @@ camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, Came
if (towrite == -1)
return -1;
- printf("read %d unfiltered bytes\n", towrite);
+ d(printf("read %d unfiltered bytes\n", towrite));
/* check for 'end of file' */
if (towrite == 0) {
@@ -383,7 +383,7 @@ camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, Came
towrite = filterlen;
}
- printf("writing %d filtered bytes\n", towrite);
+ d(printf("writing %d filtered bytes\n", towrite));
do {
toread = write(tofd, filterbuffer, towrite);
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 06b7bb8799..7f7fbe7a59 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -45,6 +45,8 @@
#include "camel-private.h"
+#define d(x)
+
#define CS_CLASS(so) CAMEL_SESSION_CLASS (CAMEL_OBJECT_GET_CLASS (so))
static void register_provider (CamelSession *session, CamelProvider *provider);
@@ -733,14 +735,14 @@ static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg
{
g_assert(msg->ops != NULL);
- printf("free message %p session %p\n", msg, session);
+ d(printf("free message %p session %p\n", msg, session));
CAMEL_SESSION_LOCK(session, thread_lock);
g_hash_table_remove(session->priv->thread_active, (void *)msg->id);
CAMEL_SESSION_UNLOCK(session, thread_lock);
- printf("free msg, ops->free = %p\n", msg->ops->free);
-
+ d(printf("free msg, ops->free = %p\n", msg->ops->free));
+
if (msg->ops->free)
msg->ops->free(session, msg);
g_free(msg);
@@ -748,13 +750,13 @@ static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg
static void session_thread_destroy(EThread *thread, CamelSessionThreadMsg *msg, CamelSession *session)
{
- printf("destroy message %p session %p\n", msg, session);
+ d(printf("destroy message %p session %p\n", msg, session));
session_thread_msg_free(session, msg);
}
static void session_thread_received(EThread *thread, CamelSessionThreadMsg *msg, CamelSession *session)
{
- printf("receive message %p session %p\n", msg, session);
+ d(printf("receive message %p session %p\n", msg, session));
if (msg->ops->receive)
msg->ops->receive(session, msg);
}
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 489d269991..7f8dab06b3 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -249,15 +249,11 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag
if (store->folders) {
CAMEL_STORE_LOCK(store, cache_lock);
- printf("adding folder '%s' to folders hashtable\n", folder_name);
g_hash_table_insert (store->folders, g_strdup (folder_name), folder);
-
- printf("store folders size = %d\n", g_hash_table_size(store->folders));
camel_object_hook_event (CAMEL_OBJECT (folder), "finalize", folder_finalize, store);
CAMEL_STORE_UNLOCK(store, cache_lock);
- } else
- printf("not adding folder '%s' to folders hashtable\n", folder_name);
+ }
}
}
diff --git a/camel/camel-store.h b/camel/camel-store.h
index e86c884a1a..40d34db3cf 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -41,8 +41,12 @@ extern "C" {
typedef struct _CamelFolderInfo {
- struct _CamelFolderInfo *parent, *sibling, *child;
- char *url, *full_name, *name;
+ struct _CamelFolderInfo *parent,
+ *sibling,
+ *child;
+ char *url;
+ char *full_name;
+ char *name;
int unread_message_count;
} CamelFolderInfo;
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 7c3bd0eab4..a5ee62b92e 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -543,7 +543,7 @@ int
camel_url_equal(const void *v, const void *v2)
{
const CamelURL *u1 = v, *u2 = v2;
-
+
return check_equal(u1->protocol, u2->protocol)
&& check_equal(u1->user, u2->user)
&& check_equal(u1->authmech, u2->authmech)
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index b001536bd8..31c50a52ae 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -215,7 +215,7 @@ camel_vee_folder_construct(CamelVeeFolder *vf, CamelStore *parent_store, const c
if (folder_unmatched == NULL) {
unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
- printf("created foldeer unmatched %p\n", folder_unmatched);
+ d(printf("created foldeer unmatched %p\n", folder_unmatched));
vee_folder_construct (folder_unmatched, parent_store, "UNMATCHED", CAMEL_STORE_FOLDER_PRIVATE);
}
@@ -246,7 +246,7 @@ camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags)
if (folder_unmatched == NULL) {
unmatched_uids = g_hash_table_new(g_str_hash, g_str_equal);
folder_unmatched = vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
- printf("created foldeer unmatched %p\n", folder_unmatched);
+ d(printf("created foldeer unmatched %p\n", folder_unmatched));
vee_folder_construct (vf, parent_store, "UNMATCHED", CAMEL_STORE_FOLDER_PRIVATE);
}
@@ -254,14 +254,14 @@ camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags)
if (strcmp(name, "UNMATCHED") == 0) {
camel_object_ref((CamelObject *)folder_unmatched);
- printf("returning unmatched %p, count = %d\n", folder_unmatched, camel_folder_get_message_count((CamelFolder *)folder_unmatched));
+ d(printf("returning unmatched %p, count = %d\n", folder_unmatched, camel_folder_get_message_count((CamelFolder *)folder_unmatched)));
return (CamelFolder *)folder_unmatched;
}
vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
vee_folder_construct(vf, parent_store, name, flags);
- printf("returning folder %s %p, count = %d\n", name, vf, camel_folder_get_message_count((CamelFolder *)vf));
+ d(printf("returning folder %s %p, count = %d\n", name, vf, camel_folder_get_message_count((CamelFolder *)vf)));
return (CamelFolder *)vf;
}
@@ -608,7 +608,7 @@ vee_folder_add_info(CamelVeeFolder *vf, CamelFolder *f, CamelMessageInfo *info,
uid = g_strdup_printf("%.8s%s", hash, camel_message_info_uid(info));
dinfo = camel_folder_summary_uid(folder->summary, uid);
if (dinfo) {
- (printf("w:clash, we already have '%s' in summary\n", uid));
+ d(printf("w:clash, we already have '%s' in summary\n", uid));
g_free(uid);
camel_folder_summary_info_free(folder->summary, dinfo);
return NULL;
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index f5de80fd56..30e4a43f79 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -132,9 +132,9 @@ vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Camel
if (name == NULL)
name = vf->vname;
fi->name = g_strdup(name);
- fi->url = g_strdup_printf("vfolder:%s", vf->vname);
- fi->unread_message_count = -1;
-
+ fi->url = g_strdup_printf("vfolder:%s#%s", ((CamelService *)store)->url->path,
+ ((CamelFolder *)vf)->full_name);
+ fi->unread_message_count = camel_folder_get_message_count((CamelFolder *)vf);
camel_object_trigger_event(CAMEL_OBJECT(store), "folder_created", fi);
camel_folder_info_free(fi);
}
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 43437b551a..20f90ce315 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -191,7 +191,7 @@ get_folder_info (CamelStore *store, const char *top,
* there before.
*/
- printf("-- LOCAL STRE -- get folder info: %s\n", top);
+ d(printf("-- LOCAL STRE -- get folder info: %s\n", top));
return NULL;
}
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 927c194089..09188ad863 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -36,6 +36,8 @@
#include "camel-exception.h"
#include "camel-url.h"
+#define d(x)
+
static CamelLocalStoreClass *parent_class = NULL;
/* Returns the class for a CamelMaildirStore */
@@ -245,7 +247,7 @@ static int scan_dir(GHashTable *visited, char *root, const char *path, guint32 f
/* look for folders matching the right structure, recursively */
name = g_strdup_printf("%s/%s", root, path);
- printf("checking dir '%s' part '%s' for maildir content\n", root, path);
+ d(printf("checking dir '%s' part '%s' for maildir content\n", root, path));
tmp = g_strdup_printf("%s/tmp", name);
cur = g_strdup_printf("%s/cur", name);
@@ -265,8 +267,8 @@ static int scan_dir(GHashTable *visited, char *root, const char *path, guint32 f
base = path;
fi = camel_folder_info_new(uri, path, base, -1);
- printf("found! uri = %s\n", fi->url);
- printf(" full_name = %s\n name = '%s'\n", fi->full_name, fi->name);
+ d(printf("found! uri = %s\n", fi->url));
+ d(printf(" full_name = %s\n name = '%s'\n", fi->full_name, fi->name));
fi->parent = parent;
fi->sibling = *fip;
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index d1c9c311e5..3d6dfc5378 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -250,7 +250,7 @@ summary_rebuild(CamelMboxSummary *mbs, off_t offset, CamelException *ex)
fd = open(cls->folder_path, O_RDONLY);
if (fd == -1) {
- printf("%s failed to open: %s\n", cls->folder_path, strerror(errno));
+ d(printf("%s failed to open: %s\n", cls->folder_path, strerror(errno)));
camel_exception_setv(ex, 1, _("Could not open folder: %s: %s"),
cls->folder_path, strerror(errno));
camel_operation_end(NULL);
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index 600ee8b2bc..998c97597c 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -99,8 +99,8 @@ construct (CamelService *service, CamelSession *session, CamelProvider *provider
char *path, *name;
struct stat st;
- printf("constructing store of type %s '%s:%s'\n",
- camel_type_to_name(((CamelObject *)service)->s.type), url->protocol, url->path);
+ d(printf("constructing store of type %s '%s:%s'\n",
+ camel_type_to_name(((CamelObject *)service)->s.type), url->protocol, url->path));
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
if (camel_exception_is_set (ex))
@@ -150,7 +150,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
char *path = ((CamelService *)store)->url->path;
CamelFolder *folder;
- printf("opening folder %s on path %s\n", folder_name, path);
+ d(printf("opening folder %s on path %s\n", folder_name, path));
/* we only support an 'INBOX' */
if (strcmp(folder_name, "INBOX") != 0) {
@@ -192,7 +192,7 @@ get_folder_info (CamelStore *store, const char *top,
fi = g_malloc0(sizeof(*fi));
fi->full_name = "/INBOX";
fi->name = "INBOX";
- fi->url = g_strdup_printf("spool://%s#%s", service->url->path, fi->name);
+ fi->url = g_strdup_printf("spool:%s#%s", service->url->path, fi->name);
fi->unread_message_count = -1;
}
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index 651ce7b0e9..db05f602ef 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -380,7 +380,7 @@ summary_rebuild(CamelSpoolSummary *cls, off_t offset, CamelException *ex)
fd = open(cls->folder_path, O_RDONLY);
if (fd == -1) {
- printf("%s failed to open: %s\n", cls->folder_path, strerror(errno));
+ d(printf("%s failed to open: %s\n", cls->folder_path, strerror(errno)));
camel_exception_setv(ex, 1, _("Could not open folder: %s: summarising from position %ld: %s"),
cls->folder_path, offset, strerror(errno));
camel_operation_end(NULL);