add debugging info with -DPRINT_LOTS_OF_DEBUG

SVN revision: 52547
This commit is contained in:
Mike Blumenkrantz 2010-09-21 18:41:56 +00:00
parent bc9de86ed4
commit a2293fc949
2 changed files with 34 additions and 1 deletions

View File

@ -2,6 +2,14 @@
#include "e_mod_main.h"
#include "imap.h"
#ifdef PRINT_LOTS_OF_DEBUG
static void
tls_log_func(int level, const char *str)
{
fprintf(stderr, "|<%d>| %s", level, str);
}
#endif
static ImapServer *_mail_imap_server_find (Ecore_Con_Server *server);
static ImapServer *_mail_imap_server_get (Config_Box *cb);
static ImapClient *_mail_imap_client_get (Config_Box *cb);
@ -45,7 +53,17 @@ _mail_imap_check_mail (void *data)
type = ECORE_CON_REMOTE_SYSTEM;
if (ecore_con_ssl_available_get () && (is->ssl))
type |= ECORE_CON_USE_SSL;
{
type |= ECORE_CON_USE_SSL;
#ifdef PRINT_LOTS_OF_DEBUG
if (ecore_con_ssl_available_get() == 1)
{
gnutls_global_set_log_level(9);
gnutls_global_set_log_function(tls_log_func);
}
}
#endif
}
is->state = IMAP_STATE_DISCONNECTED;
is->server =
ecore_con_server_connect (type, is->host,

View File

@ -8,6 +8,14 @@
#define D(args...)
#endif
#ifdef PRINT_LOTS_OF_DEBUG
static void
tls_log_func(int level, const char *str)
{
fprintf(stderr, "|<%d>| %s", level, str);
}
#endif
/*
* TODO:
* * Let the user select between Unseen, Recent and New mail
@ -55,6 +63,13 @@ _mail_imap_check_mail (void *data)
if (ecore_con_ssl_available_get () && (ic->config->ssl))
{
#ifdef PRINT_LOTS_OF_DEBUG
if (ecore_con_ssl_available_get() == 1)
{
gnutls_global_set_log_level(9);
gnutls_global_set_log_function(tls_log_func);
}
#endif
D ("Use SSL for %s:%s\n", ic->config->host, ic->config->new_path);
switch (ic->config->ssl)
{