From: Pierre Habouzit Date: Sat, 12 May 2007 13:10:01 +0000 (+0200) Subject: missing bits. X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=5b019f814d9278d1567381877b96a1731d0f7e2b missing bits. Signed-off-by: Pierre Habouzit --- diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index c7d4712..31c11bf 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -27,6 +27,7 @@ #include "recvattach.h" #include "buffy.h" #include "thread.h" +#include "mutt_sasl.h" #include @@ -34,10 +35,6 @@ #include #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); diff --git a/mutt_sasl.c b/mutt_sasl.c index dd97bfa..13262b8 100644 --- a/mutt_sasl.c +++ b/mutt_sasl.c @@ -28,7 +28,23 @@ * 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; } diff --git a/mutt_sasl.h b/mutt_sasl.h index 8e1cd18..4b038a9 100644 --- a/mutt_sasl.h +++ b/mutt_sasl.h @@ -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_ */