missing bits.
authorPierre Habouzit <madcoder@debian.org>
Sat, 12 May 2007 13:10:01 +0000 (15:10 +0200)
committerPierre Habouzit <madcoder@debian.org>
Sat, 12 May 2007 13:10:01 +0000 (15:10 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-ui/curs_main.c
mutt_sasl.c
mutt_sasl.h

index c7d4712..31c11bf 100644 (file)
@@ -27,6 +27,7 @@
 #include "recvattach.h"
 #include "buffy.h"
 #include "thread.h"
+#include "mutt_sasl.h"
 
 #include <imap/imap_private.h>
 
 #include <nntp/nntp.h>
 #endif
 
-#ifdef USE_SASL
-#include "mutt_sasl.h"
-#endif
-
 static const char *No_mailbox_is_open = N_("No mailbox is open.");
 static const char *There_are_no_messages = N_("There are no messages.");
 static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
@@ -2318,9 +2315,7 @@ int mutt_index_menu (void)
   /* Close all open NNTP connections */
     nntp_logout_all ();
 #endif
-#ifdef USE_SASL
     mutt_sasl_done ();
-#endif
   }
 
   mutt_menuDestroy (&menu);
index dd97bfa..13262b8 100644 (file)
  * a protection buffer. */
 #define M_SASL_MAXBUF 65536
 
-#define IP_PORT_BUFLEN 1024
+typedef struct {
+    sasl_conn_t *saslconn;
+    const sasl_ssf_t *ssf;
+    const unsigned int *pbufsize;
+
+    /* read buffer */
+    char *buf;
+    unsigned blen;
+    unsigned int bpos;
+
+    /* underlying socket data */
+    void *sockdata;
+    int (*msasl_open) (CONNECTION * conn);
+    int (*msasl_close) (CONNECTION * conn);
+    int (*msasl_read) (CONNECTION * conn, char *buf, ssize_t len);
+    int (*msasl_write) (CONNECTION * conn, const char *buf, ssize_t count);
+} SASL_DATA;
 
 static sasl_callback_t mutt_sasl_callbacks[5];
 
@@ -115,7 +131,7 @@ int mutt_sasl_client_new (CONNECTION * conn, sasl_conn_t ** saslconn)
 
     struct sockaddr_storage local, remote;
     socklen_t size;
-    char iplocalport[IP_PORT_BUFLEN], ipremoteport[IP_PORT_BUFLEN];
+    char iplocalport[STRING], ipremoteport[STRING];
     const char *service;
     int rc;
 
@@ -137,14 +153,14 @@ int mutt_sasl_client_new (CONNECTION * conn, sasl_conn_t ** saslconn)
 
     size = sizeof(local);
     if (getsockname(conn->fd, (struct sockaddr *) &local, &size)
-    ||  iptostring(&local, iplocalport, IP_PORT_BUFLEN) != SASL_OK)
+    ||  iptostring(&local, iplocalport, STRING) != SASL_OK)
     {
         return -1;
     }
 
     size = sizeof(remote);
     if (getpeername(conn->fd, (struct sockaddr *) &remote, &size)
-    ||  iptostring(&remote, ipremoteport, IP_PORT_BUFLEN) != SASL_OK)
+    ||  iptostring(&remote, ipremoteport, STRING) != SASL_OK)
     {
         return -1;
     }
index 8e1cd18..4b038a9 100644 (file)
@@ -22,22 +22,4 @@ int mutt_sasl_interact (sasl_interact_t *);
 void mutt_sasl_setup_conn (CONNECTION *, sasl_conn_t *);
 void mutt_sasl_done(void);
 
-typedef struct {
-    sasl_conn_t *saslconn;
-    const sasl_ssf_t *ssf;
-    const unsigned int *pbufsize;
-
-    /* read buffer */
-    char *buf;
-    unsigned blen;
-    unsigned int bpos;
-
-    /* underlying socket data */
-    void *sockdata;
-    int (*msasl_open) (CONNECTION * conn);
-    int (*msasl_close) (CONNECTION * conn);
-    int (*msasl_read) (CONNECTION * conn, char *buf, ssize_t len);
-    int (*msasl_write) (CONNECTION * conn, const char *buf, ssize_t count);
-} SASL_DATA;
-
 #endif /* _MUTT_SASL_H_ */