Ahem.

Sorry i was too fast, the patch had a bug, and then from the
standard point of view an "untagged" response should treated by
itself.  So i added [1] on all the [master] and [stable] series
and gave you credit again.

  [1] 
https://git.sdaoden.eu/browse?p=s-nail.git;a=commit;h=9352ebfe6e5de589655194fce0d27b1de2f144a8

So, for the interested, the entire patch is now as below, and
i say thanks! and Ciao! from Germany.

diff --git a/THANKS b/THANKS
index 255977b2a0..27a5b27f4e 100644
--- a/THANKS
+++ b/THANKS
@@ -91,6 +91,7 @@ John P. Linderman         jpl dot jpl at gmail dot com
 Johannes Löthberg         johannes at kyriasis dot com
 Daniel Lublin             daniel at lublin dot se
 Martin Lucina             martin at lucina dot net
+Madou Mad                 huguelectro at hotmail dot fr
 Anders Magnusson          ragge at ludd dot ltu dot se
 Wiesław Magusiak          wiemag at poczta dot onet dot pl
 Nicholas Marriott         nicholas dot marriott at gmail dot com
diff --git a/nail.1 b/nail.1
index 602b30d256..2cb30a82ac 100644
--- a/nail.1
+++ b/nail.1
@@ -15497,7 +15497,10 @@ but other accounts are not affected.
 .It Va imap-auth-USER@HOST , imap-auth
 Sets the IMAP authentication method.
 Supported are the default
-.Ql login ,
+.Ql login
+(called
+.Ql plain
+by some servers),
 \*(IN
 .Ql oauthbearer
 (see
diff --git a/src/mx/net-socket.c b/src/mx/net-socket.c
index e9d84c2739..16b3cb3869 100644
--- a/src/mx/net-socket.c
+++ b/src/mx/net-socket.c
@@ -752,7 +752,10 @@ mx_socket_write1(struct mx_socket *sop, char const *data, 
int size,
 jssl_retry:
       x = SSL_write(sop->s_tls, data, size);
       if(x < 0){
-         if(++errcnt < 3 && (err = su_err_no()) != su_ERR_WOULDBLOCK){
+         if((err = su_err_no()) == su_ERR_INTR)
+            goto jssl_retry;
+
+         if(++errcnt < 3 && err != su_ERR_WOULDBLOCK){
             switch(SSL_get_error(sop->s_tls, x)){
             case SSL_ERROR_WANT_READ:
             case SSL_ERROR_WANT_WRITE:
@@ -830,7 +833,10 @@ jssl_retry:
                if (sop->s_rsz < 0) {
                   char o[512];
 
-                  if(++errcnt < 3 && (err = su_err_no()) != su_ERR_WOULDBLOCK){
+                  if((err = su_err_no()) == su_ERR_INTR)
+                     goto jssl_retry;
+
+                  if(++errcnt < 3 && err != su_ERR_WOULDBLOCK){
                      switch(SSL_get_error(sop->s_tls, sop->s_rsz)){
                      case SSL_ERROR_WANT_READ:
                      case SSL_ERROR_WANT_WRITE:
diff --git a/src/mx/obs-imap.c b/src/mx/obs-imap.c
index 230599f4ee..2a159a9ba0 100644
--- a/src/mx/obs-imap.c
+++ b/src/mx/obs-imap.c
@@ -203,6 +203,7 @@ static char const *a_imap_path_normalize(struct mailbox 
*mp, char const *cp,
 static char *imap_path_quote(struct mailbox *mp, char const *cp);
 static void       imap_other_get(char *pp);
 static void       imap_response_get(const char **cp);
+static void a_imap_res__untagged(const char **cp);
 static void       imap_response_parse(void);
 static enum okay  imap_answer(struct mailbox *mp, int errprnt);
 static enum okay  imap_parse_list(void);
@@ -881,6 +882,22 @@ imap_response_get(const char **cp)
    NYD2_OU;
 }
 
+static void
+a_imap_res__untagged(const char **cp){
+   NYD2_IN;
+
+   if(su_cs_cmp_case_n(*cp, "OK ", 3) == 0){
+      *cp += 3;
+      response_status = RESPONSE_OK;
+   }else if (su_cs_cmp_case_n(*cp, "BYE ", 4) == 0){
+      *cp += 4;
+      response_status = RESPONSE_BYE;
+   }else
+      response_status = RESPONSE_OTHER;
+
+   NYD2_OU;
+}
+
 static void
 imap_response_parse(void)
 {
@@ -905,23 +922,20 @@ imap_response_parse(void)
          pp++;
       }
       break;
+
    case '*':
-      ip++;
-      pp++;
-      while (*ip == ' ') {
-         ip++;
-         pp++;
+      for(;;){
+         ++ip, ++pp;
+         if(*ip != ' ')
+            break;
       }
-      imap_response_get(&ip);
+
+      a_imap_res__untagged(&ip);
       pp = &parsebuf[ip - imapbuf];
-      switch (response_status) {
-      case RESPONSE_BYE:
-         response_type = RESPONSE_FATAL;
-         break;
-      default:
-         response_type = RESPONSE_DATA;
-      }
+      response_type = (response_status == RESPONSE_BYE) ? RESPONSE_FATAL
+            : RESPONSE_DATA;
       break;
+
    default:
       responded_tag = parsebuf;
       while (*pp && *pp != ' ')
@@ -3294,7 +3308,7 @@ imap_append0(struct mailbox *mp, const char *name, FILE 
*fp, long offset)
    mx_fs_linepool_aquire(&buf, &bufsize);
    cnt = fsize(fp);
    offs = offset /* BSD will move due to O_APPEND! ftell(fp) */;
-   time(&tim);
+   tim = 0;
    size = 0;
 
    for (flag = MNEW, state = _NLSEP;;) {

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to