2012-09-19 [colin] 3.8.1cvs61
authorColin Leroy <colin@colino.net>
Wed, 19 Sep 2012 09:45:32 +0000 (09:45 +0000)
committerColin Leroy <colin@colino.net>
Wed, 19 Sep 2012 09:45:32 +0000 (09:45 +0000)
* src/imap.c
* src/inc.c
* src/news.c
* src/send_message.c
* src/common/socket.c
More precise error logging

ChangeLog
PATCHSETS
configure.ac
src/common/socket.c
src/imap.c
src/inc.c
src/news.c
src/send_message.c

index d7a2085..7ebd67b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-19 [colin]     3.8.1cvs61
+
+       * src/imap.c
+       * src/inc.c
+       * src/news.c
+       * src/send_message.c
+       * src/common/socket.c
+               More precise error logging
+
 2012-09-16 [mones]     3.8.1cvs60
 
         * src/action.c                                                          
index 067b32f..864e9e9 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.2.2.47 -r 1.2.2.48 src/gtk/inputdialog.c;  ) > 3.8.1cvs58.patchset
 ( cvs diff -u -r 1.6.2.24 -r 1.6.2.25 src/common/log.c;  ) > 3.8.1cvs59.patchset
 ( cvs diff -u -r 1.12.2.73 -r 1.12.2.74 src/action.c;  cvs diff -u -r 1.27.2.64 -r 1.27.2.65 src/addr_compl.c;  cvs diff -u -r 1.6.10.28 -r 1.6.10.29 src/addrharvest.c;  cvs diff -u -r 1.382.2.612 -r 1.382.2.613 src/compose.c;  cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/edittags.c;  cvs diff -u -r 1.207.2.228 -r 1.207.2.229 src/folderview.c;  cvs diff -u -r 1.1.2.72 -r 1.1.2.73 src/imap_gtk.c;  cvs diff -u -r 1.75.2.74 -r 1.75.2.75 src/matcher.c;  cvs diff -u -r 1.2.2.44 -r 1.2.2.45 src/mh_gtk.c;  cvs diff -u -r 1.101.2.70 -r 1.101.2.71 src/news.c;  cvs diff -u -r 1.105.2.175 -r 1.105.2.176 src/prefs_account.c;  cvs diff -u -r 1.60.2.82 -r 1.60.2.83 src/prefs_actions.c;  cvs diff -u -r 1.16.2.44 -r 1.16.2.45 src/prefs_customheader.c;  cvs diff -u -r 1.59.2.92 -r 1.59.2.93 src/prefs_filtering.c;  cvs diff -u -r 1.12.2.82 -r 1.12.2.83 src/prefs_template.c;  cvs diff -u -r 1.30.2.74 -r 1.30.2.75 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/printing.c;  cvs diff -u -r 1.150.2.128 -r 1.150.2.129 src/procmsg.c;  cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/etpan/etpan-thread-manager.c;  cvs diff -u -r 1.1.4.120 -r 1.1.4.121 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/etpan/nntp-thread.c;  cvs diff -u -r 1.9.2.81 -r 1.9.2.82 src/gtk/gtkaspell.c;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.4.22 -r 1.1.4.23 src/gtk/gtkshruler.c;  ) > 3.8.1cvs60.patchset
+( cvs diff -u -r 1.179.2.261 -r 1.179.2.262 src/imap.c;  cvs diff -u -r 1.149.2.110 -r 1.149.2.111 src/inc.c;  cvs diff -u -r 1.101.2.71 -r 1.101.2.72 src/news.c;  cvs diff -u -r 1.17.2.64 -r 1.17.2.65 src/send_message.c;  cvs diff -u -r 1.13.2.49 -r 1.13.2.50 src/common/socket.c;  ) > 3.8.1cvs61.patchset
index 766ddf7..9754b26 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=60
+EXTRA_VERSION=61
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b9ecb92..0e1c3d1 100644 (file)
@@ -570,6 +570,7 @@ static gint fd_check_io(gint fd, GIOCondition cond)
                return 0;
        } else {
                g_warning("Socket IO timeout\n");
+               log_error(LOG_PROTOCOL, _("Socket IO timeout.\n"));
                return -1;
        }
 }
@@ -598,6 +599,7 @@ static gint sock_connect_with_timeout(gint sock,
                alarm(0);
                signal(SIGALRM, prev_handler);
                errno = ETIMEDOUT;
+               log_error(LOG_PROTOCOL, _("Connection timed out.\n"));
                return -1;
        }
        alarm(timeout_secs);
@@ -625,6 +627,7 @@ struct hostent *my_gethostbyname(const gchar *hostname)
                alarm(0);
                signal(SIGALRM, prev_handler);
                g_printerr("%s: host lookup timed out.\n", hostname);
+               log_error(LOG_PROTOCOL, _("%s: host lookup timed out.\n"), hostname);
                errno = 0;
                return NULL;
        }
@@ -637,6 +640,7 @@ struct hostent *my_gethostbyname(const gchar *hostname)
                signal(SIGALRM, prev_handler);
 #endif
                g_printerr("%s: unknown host.\n", hostname);
+               log_error(LOG_PROTOCOL, _("%s: unknown host.\n"), hostname);
                errno = 0;
                return NULL;
        }
@@ -824,6 +828,9 @@ static gboolean sock_connect_async_cb(GIOChannel *source,
 
        if (val != 0) {
                close(fd);
+               log_error(LOG_PROTOCOL, _("%s:%d: connection failed (%s).\n"),
+                         conn_data->hostname, conn_data->port,
+                         strerror(val));
                sock_connect_address_list_async(conn_data);
                return FALSE;
        }
@@ -948,6 +955,7 @@ static gint sock_connect_address_list_async(SockConnectData *conn_data)
                if ((sock = socket(addr_data->family, addr_data->socktype,
                                   addr_data->protocol)) < 0) {
                        perror("socket");
+
                        continue;
                }
 
@@ -960,14 +968,12 @@ static gint sock_connect_address_list_async(SockConnectData *conn_data)
                                perror("connect");
                                close(sock);
                        }
-               } else
+               } else {
                        break;
+               }
        }
 
        if (conn_data->cur_addr == NULL) {
-               g_warning("sock_connect_address_list_async: "
-                         "connection to %s:%d failed\n",
-                         conn_data->hostname, conn_data->port);
                conn_data->func(NULL, conn_data->data);
                sock_connect_async_cancel(conn_data->id);
                return -1;
@@ -1062,6 +1068,8 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source,
 
                if (ai_member[0] == AF_UNSPEC) {
                        g_warning("DNS lookup failed\n");
+                       log_error(LOG_PROTOCOL, _("%s:%d: unknown host.\n"),
+                               lookup_data->hostname, lookup_data->port);
                        break;
                }
 
@@ -1155,6 +1163,8 @@ static void address_info_async_child(void *opaque)
                gchar len = 0;
                 g_warning("getaddrinfo for %s:%s failed: %s\n",
                           parm->hostname, port_str, gai_strerror(gai_err));
+               log_error(LOG_PROTOCOL, _("%s:%s: host lookup failed (%s).\n"),
+                         parm->hostname, port_str, gai_strerror(gai_err));
                fd_write_all(parm->pipe_fds[1], &len,
                      sizeof(len));
                 fd_write_all(parm->pipe_fds[1], (gchar *)ai_member,
index 10585d9..923b515 100644 (file)
@@ -1068,8 +1068,9 @@ static IMAPSession *imap_session_new(Folder * folder,
 #endif
 
        imap_init(folder);
-       buf = g_strdup_printf(_("Account '%s': Connecting to IMAP4 server: %s..."),
-                               folder->account->account_name, folder->account->recv_server);
+       buf = g_strdup_printf(_("Account '%s': Connecting to IMAP4 server: %s:%d..."),
+                               folder->account->account_name, folder->account->recv_server,
+                               port);
        statuswindow_print_all("%s", buf);
        log_message(LOG_PROTOCOL, "%s\n", buf);
        g_free(buf);
@@ -1193,10 +1194,7 @@ try_again:
        } else if (account->imap_auth_type == IMAP_AUTH_ANON || account->imap_auth_type == IMAP_AUTH_GSSAPI) {
                pass = "";
        }
-       statuswindow_print_all(_("Connecting to IMAP4 server %s...\n"),
-                               account->recv_server);
        if ((ok = imap_auth(session, account->userid, pass, account->imap_auth_type)) != MAILIMAP_NO_ERROR) {
-               statusbar_pop_all();
                
                if (!failed && !is_fatal(ok)) {
                        acc_pass = NULL;
index b7cb86e..d4fdf64 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -829,8 +829,8 @@ static IncState inc_pop3_session_do(IncSession *session)
                pop3_session->ac_prefs->popport : 110;
 #endif
 
-       buf = g_strdup_printf(_("Account '%s': Connecting to POP3 server: %s..."),
-                               account_name, server);
+       buf = g_strdup_printf(_("Account '%s': Connecting to POP3 server: %s:%d..."),
+                               account_name, server, port);
        statuswindow_print_all("%s", buf);
        log_message(LOG_PROTOCOL, "%s\n", buf);
 
@@ -1152,7 +1152,6 @@ static void inc_put_error(IncState istate, Pop3Session *session)
 
        switch (istate) {
        case INC_CONNECT_ERROR:
-               log_msg = _("Connection failed.");
                fatal_error = TRUE;
                if (prefs_common.no_recv_err_panel)
                        break;
index e7755f5..fb4155f 100644 (file)
@@ -293,8 +293,8 @@ static Session *news_session_new(Folder *folder, const gchar *server, gushort po
        int r = 0;
        cm_return_val_if_fail(server != NULL, NULL);
 
-       log_message(LOG_PROTOCOL, _("Account '%s': Connecting to NNTP server: %s...\n"),
-                                   folder->account->account_name, server);
+       log_message(LOG_PROTOCOL, _("Account '%s': Connecting to NNTP server: %s:%d...\n"),
+                                   folder->account->account_name, server, port);
 
        session = g_new0(NewsSession, 1);
        session_init(SESSION(session), folder->account, FALSE);
index ee4c112..3e858d0 100644 (file)
@@ -326,8 +326,8 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                        inc_pop_before_smtp(ac_prefs);
                }
 
-               g_snprintf(buf, sizeof(buf), _("Account '%s': Connecting to SMTP server: %s ..."),
-                               ac_prefs->account_name, ac_prefs->smtp_server);
+               g_snprintf(buf, sizeof(buf), _("Account '%s': Connecting to SMTP server: %s:%d..."),
+                               ac_prefs->account_name, ac_prefs->smtp_server, port);
                progress_dialog_set_label(dialog->dialog, buf);
                log_message(LOG_PROTOCOL, "%s\n", buf);