[balsa] Give the user the option to ignore PIPELINING



commit 98a0d8807d5ab158ae3e6b74f425828937b870cc
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Feb 20 18:51:03 2017 -0500

    Give the user the option to ignore PIPELINING
    
    Give the user the option to ignore PIPELINING capability in a POP3 server
    
        * libbalsa/imap/pop3.c (pop_connect): respect
          PopHandle::enable_pipe.
        * libbalsa/mailbox_pop3.c (libbalsa_mailbox_pop3_check): set
          the option in PopHandle;
          (libbalsa_mailbox_pop3_save_config): save it;
          (libbalsa_mailbox_pop3_load_config): load it;
        * libbalsa/mailbox_pop3.h: new member
          LibBalsaMailboxPop3::enable_pipe;
        * src/mailbox-conf.c (mailbox_conf_set_values),
          (update_pop_mailbox), (create_pop_mailbox_dialog):
          new check-box in the UI.

 ChangeLog               |   17 +++++++++++++++++
 libbalsa/imap/pop3.c    |    2 +-
 libbalsa/mailbox_pop3.c |    3 +++
 libbalsa/mailbox_pop3.h |    1 +
 src/mailbox-conf.c      |    9 +++++++++
 5 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d700acc..d088ef6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2017-02-20  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Give the user the option to ignore PIPELINING capability in a
+       POP3 server
+
+       * libbalsa/imap/pop3.c (pop_connect): respect
+         PopHandle::enable_pipe.
+       * libbalsa/mailbox_pop3.c (libbalsa_mailbox_pop3_check): set
+         the option in PopHandle;
+         (libbalsa_mailbox_pop3_save_config): save it;
+         (libbalsa_mailbox_pop3_load_config): load it;
+       * libbalsa/mailbox_pop3.h: new member
+         LibBalsaMailboxPop3::enable_pipe;
+       * src/mailbox-conf.c (mailbox_conf_set_values),
+         (update_pop_mailbox), (create_pop_mailbox_dialog):
+         new check-box in the UI.
+
 2017-02-19  Peter Bloomfield  <pbloomfield bellsouth net>
 
        SMTP extensions: TLS client cert; rework config dialog
diff --git a/libbalsa/imap/pop3.c b/libbalsa/imap/pop3.c
index de52327..561e4b4 100644
--- a/libbalsa/imap/pop3.c
+++ b/libbalsa/imap/pop3.c
@@ -600,7 +600,7 @@ pop_connect(PopHandle *pop, const char *host, GError **err)
     return FALSE;
 
   pop->max_req_queue_len = 
-    pop_can_do(pop, POP_CAP_PIPELINING) /* && pop->enable_pipe */
+    pop_can_do(pop, POP_CAP_PIPELINING) && pop->enable_pipe
     ? POP_QUEUE_LEN/2 : 1;
   return TRUE;
 }
diff --git a/libbalsa/mailbox_pop3.c b/libbalsa/mailbox_pop3.c
index 50470ac..ede80c7 100644
--- a/libbalsa/mailbox_pop3.c
+++ b/libbalsa/mailbox_pop3.c
@@ -489,6 +489,7 @@ libbalsa_mailbox_pop3_check(LibBalsaMailbox * mailbox)
     pop_set_option(pop, IMAP_POP_OPT_FILTER_CR, TRUE);
     pop_set_option(pop, IMAP_POP_OPT_OVER_SSL, server->use_ssl);
     pop_set_option(pop, IMAP_POP_OPT_DISABLE_APOP, m->disable_apop);
+    pop_set_option(pop, IMAP_POP_OPT_PIPELINE, m->enable_pipe);
     pop_set_tls_mode(pop, tls_mode);
     pop_set_timeout(pop, 60000); /* wait 1.5 minute for packets */
     pop_set_usercb(pop, libbalsa_server_user_cb, server);
@@ -633,6 +634,7 @@ libbalsa_mailbox_pop3_save_config(LibBalsaMailbox * mailbox,
     libbalsa_conf_set_bool("Check", pop->check);
     libbalsa_conf_set_bool("Delete", pop->delete_from_server);
     libbalsa_conf_set_bool("DisableApop", pop->disable_apop);
+    libbalsa_conf_set_bool("EnablePipe", pop->enable_pipe);
     libbalsa_conf_set_bool("Filter", pop->filter);
     if(pop->filter_cmd)
         libbalsa_conf_set_string("FilterCmd", pop->filter_cmd);
@@ -657,6 +659,7 @@ libbalsa_mailbox_pop3_load_config(LibBalsaMailbox * mailbox,
     pop->check = libbalsa_conf_get_bool("Check=false");
     pop->delete_from_server = libbalsa_conf_get_bool("Delete=false");
     pop->disable_apop = libbalsa_conf_get_bool("DisableApop=false");
+    pop->enable_pipe = libbalsa_conf_get_bool("EnablePipe=false");
     pop->filter = libbalsa_conf_get_bool("Filter=false");
     pop->filter_cmd = libbalsa_conf_get_string("FilterCmd");
     if(pop->filter_cmd && *pop->filter_cmd == '\0') {
diff --git a/libbalsa/mailbox_pop3.h b/libbalsa/mailbox_pop3.h
index c8b6a18..e6e0cf1 100644
--- a/libbalsa/mailbox_pop3.h
+++ b/libbalsa/mailbox_pop3.h
@@ -50,6 +50,7 @@ struct _LibBalsaMailboxPop3 {
     unsigned filter:1; /* filter through procmail/filter_cmd? */
     unsigned disable_apop:1; /* Some servers claim to support it but
                               * they do not. */
+    unsigned enable_pipe:1;  /* ditto */
 };
 
 LibBalsaMailboxPop3 *libbalsa_mailbox_pop3_new(void);
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 152b110..b80ee4c 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -104,6 +104,7 @@ struct _MailboxConfWindow {
            GtkWidget *delete_from_server;
             BalsaServerConf bsc;
             GtkWidget *disable_apop;
+            GtkWidget *enable_pipe;
            GtkWidget *filter;
            GtkWidget *filter_cmd;
        } pop3;
@@ -658,6 +659,8 @@ mailbox_conf_set_values(MailboxConfWindow *mcw)
         balsa_server_conf_set_values(&mcw->mb_data.pop3.bsc, server);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mcw->mb_data.pop3.disable_apop),
                                     pop3->disable_apop);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mcw->mb_data.pop3.enable_pipe),
+                                    pop3->enable_pipe);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mcw->mb_data.pop3.check),
                                     pop3->check);
 
@@ -814,6 +817,8 @@ update_pop_mailbox(MailboxConfWindow *mcw)
        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mcw->mb_data.pop3.check));
     mailbox->disable_apop =
        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mcw->mb_data.pop3.disable_apop));
+    mailbox->enable_pipe =
+       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mcw->mb_data.pop3.enable_pipe));
     mailbox->delete_from_server =
        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
                                     (mcw->mb_data.pop3.delete_from_server));
@@ -1233,6 +1238,10 @@ create_pop_mailbox_dialog(MailboxConfWindow *mcw)
     mcw->mb_data.pop3.disable_apop = 
         balsa_server_conf_add_checkbox(&mcw->mb_data.pop3.bsc,
                                        _("Disable _APOP"));
+    /* toggle for enabling pipeling */
+    mcw->mb_data.pop3.enable_pipe =
+        balsa_server_conf_add_checkbox(&mcw->mb_data.pop3.bsc,
+                                       _("Overlap commands"));
 
     gtk_widget_show_all(notebook);
     gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]