force connect manually so basics work.
authorNot Zed <NotZed@Ximian.com>
Mon, 11 Aug 2003 20:41:33 +0000 (20:41 +0000)
committerMichael Zucci <zucchi@src.gnome.org>
Mon, 11 Aug 2003 20:41:33 +0000 (20:41 +0000)
2003-08-11  Not Zed  <NotZed@Ximian.com>

        * providers/imapp/camel-imapp-store.c (imap_get_folder_info):
        force connect manually so basics work.

        ** See bug #45505.

        * camel-service.c (camel_gethostbyname): duh, pthread_create
        returns the error code directly, not via errno.
        (camel_gethostbyaddr): Same, also properly handle the failure
        case.

2003-08-01  Not Zed  <NotZed@Ximian.com>

        ** See bug #47208.

        * camel-filter-search.c (match_all): match-all with no arguments
        should always return TRUE.

        * camel-folder-search.c (camel_folder_search_execute_expression):
        print a warning when we get an invalid result type & fixed a leak
        for that case.

camel/ChangeLog
camel/camel-filter-search.c
camel/camel-folder-search.c
camel/camel-service.c
camel/providers/imapp/camel-imapp-store.c

index 84f649f..ef38f28 100644 (file)
@@ -1,3 +1,26 @@
+2003-08-11  Not Zed  <NotZed@Ximian.com>
+
+       * providers/imapp/camel-imapp-store.c (imap_get_folder_info):
+       force connect manually so basics work.
+
+       ** See bug #45505.
+
+       * camel-service.c (camel_gethostbyname): duh, pthread_create
+       returns the error code directly, not via errno.
+       (camel_gethostbyaddr): Same, also properly handle the failure
+       case.
+
+2003-08-01  Not Zed  <NotZed@Ximian.com>
+
+       ** See bug #47208.
+
+       * camel-filter-search.c (match_all): match-all with no arguments        
+       should always return TRUE.
+
+       * camel-folder-search.c (camel_folder_search_execute_expression):
+       print a warning when we get an invalid result type & fixed a leak
+       for that case.
+
 2003-08-08  Jeffrey Stedfast  <fejj@ximian.com>
 
        * tests/message/test4.c: New test suite for the mime parser (which
@@ -38,7 +61,7 @@
        class's default mime_type.
        (camel_mime_part_finalize): Don't need to unref the content_type
        anymore.
-       (process_header): Updated to use CamelDataWrapper's mime_type
+M      (process_header): Updated to use CamelDataWrapper's mime_type
        field.
        (camel_mime_part_set_filename): Same.
        (camel_mime_part_get_filename): Same.
index 627b7ad..5f9e5eb 100644 (file)
@@ -313,7 +313,7 @@ match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSe
                return e_sexp_term_eval (f, argv[0]);
        
        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
-       r->value.bool = FALSE;
+       r->value.bool = TRUE;
        
        return r;
 }
index f19ec19..89fb8f1 100644 (file)
@@ -361,8 +361,7 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
        matches = g_ptr_array_new();
 
        /* now create a folder summary to return?? */
-       if (r
-           && r->type == ESEXP_RES_ARRAY_PTR) {
+       if (r->type == ESEXP_RES_ARRAY_PTR) {
                d(printf("got result ...\n"));
                /* we use a mempool to store the strings, packed in tight as possible, and freed together */
                /* because the strings are often short (like <8 bytes long), we would be wasting appx 50%
@@ -390,15 +389,16 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
                                g_ptr_array_add(matches, e_mempool_strdup(pool, g_ptr_array_index(r->value.ptrarray, i)));
                        }
                }
-               e_sexp_result_free(search->sexp, r);
                /* instead of putting the mempool_hash in the structure, we keep the api clean by
                   putting a reference to it in a hashtable.  Lets us do some debugging and catch
                   unfree'd results as well. */
                g_hash_table_insert(p->mempool_hash, matches, pool);
        } else {
-               d(printf("no result!\n"));
+               g_warning("Search returned an invalid result type");
        }
 
+       e_sexp_result_free(search->sexp, r);
+
        search->folder = NULL;
        search->summary = NULL;
        search->current = NULL;
index ae3a36d..bc4f4d8 100644 (file)
@@ -750,10 +750,11 @@ camel_gethostbyname (const char *name, CamelException *exout)
                EMsgPort *reply_port;
                pthread_t id;
                fd_set rdset;
+               int err;
 
                reply_port = msg->msg.reply_port = e_msgport_new();
                fd = e_msgport_fd(msg->msg.reply_port);
-               if (pthread_create(&id, NULL, get_hostbyname, msg) == 0) {
+               if ((err = pthread_create(&id, NULL, get_hostbyname, msg)) == 0) {
                        d(printf("waiting for name return/cancellation in main process\n"));
                        do {
                                FD_ZERO(&rdset);
@@ -786,7 +787,7 @@ camel_gethostbyname (const char *name, CamelException *exout)
                                d(printf("child done\n"));
                        }
                } 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(err));
                }
                e_msgport_destroy(reply_port);
        }
@@ -873,10 +874,11 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *exout)
                EMsgPort *reply_port;
                pthread_t id;
                fd_set rdset;
-               
+               int err;
+
                reply_port = msg->msg.reply_port = e_msgport_new ();
                fd = e_msgport_fd (msg->msg.reply_port);
-               if (pthread_create (&id, NULL, get_hostbyaddr, msg) == 0) {
+               if ((err = pthread_create (&id, NULL, get_hostbyaddr, msg)) == 0) {
                        d(printf("waiting for name return/cancellation in main process\n"));
                        do {
                                FD_ZERO(&rdset);
@@ -908,7 +910,10 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *exout)
                                pthread_join(id, NULL);
                                d(printf("child done\n"));
                        }
+               } else {
+                       camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(err));
                }
+
                
                e_msgport_destroy (reply_port);
        }
index 36dde91..b3c8e57 100644 (file)
@@ -861,10 +861,10 @@ imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
        CamelFolderInfo * fi= NULL;
        char *name;
 
-       if (istore->driver == NULL) {
-               camel_exception_setv(ex, 1, "Not connected");
+       /* FIXME: temporary, since this is not a disco store */
+       if (istore->driver == NULL
+           && !camel_service_connect((CamelService *)store, ex))
                return NULL;
-       }
 
        name = (char *)top;
        if (name == NULL || name[0] == 0) {