Permalink
Browse files

Reapply Gabor's IMAP error tracking code which doesn't seem to be in …

  • Loading branch information...
1 parent b86cc35 commit ac07568a5c017ab4fafc9289956f2e6e6a87de67 @codev committed May 21, 2011
Showing with 32 additions and 0 deletions.
  1. +32 −0 libetpan/src/low-level/imap/mailimap.c
@@ -1461,6 +1461,19 @@ int mailimap_list(mailimap * session, const char * mb,
}
}
+static char* gabor_imap_login_response_1;
+static char* gabor_imap_login_response_2;
+
+LIBETPAN_EXPORT
+char* gabor_imap_login_response_1_ret() {
+return gabor_imap_login_response_1;
+}
+
+LIBETPAN_EXPORT
+char* gabor_imap_login_response_2_ret() {
+return gabor_imap_login_response_2;
+}
+
LIBETPAN_EXPORT
int mailimap_login(mailimap * session,
const char * userid, const char * password)
@@ -1522,7 +1535,26 @@ int mailimap_login(mailimap * session,
if (mailimap_read_line(session) == NULL)
return MAILIMAP_ERROR_STREAM;
+ if(gabor_imap_login_response_1 != NULL) {
+ free(gabor_imap_login_response_1);
+ gabor_imap_login_response_1 = NULL;
+ }
+ if(gabor_imap_login_response_2 != NULL) {
+ free(gabor_imap_login_response_2);
+ gabor_imap_login_response_2 = NULL;
+ }
+
+ if(session->imap_response != NULL) {
+ gabor_imap_login_response_1 = malloc(strlen(session->imap_response) + 1);
+ strcpy(gabor_imap_login_response_1, session->imap_response);
+ }
+
r = mailimap_parse_response(session, &response);
+ if(session->imap_response != NULL) {
+ gabor_imap_login_response_2 = malloc(strlen(session->imap_response) + 1);
+ strcpy(gabor_imap_login_response_2, session->imap_response);
+ }
+
if (r != MAILIMAP_NO_ERROR)
return r;

0 comments on commit ac07568

Please sign in to comment.