aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-07-03 23:14:18 -0400
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-07-03 23:14:18 -0400
commit6f2d15d22afaf947690d895047a7ea6a9d8bad8c (patch)
tree6215c7841a5e3620ded8ce752bced5c8cd2eeaf1
parent9fe6ce12c4880a6c2f2a4180752987dd30d65c89 (diff)
Fixed logger
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/MasterViewController.m11
-rwxr-xr-xscripts/prepare-libetpan-ios.sh2
-rwxr-xr-xscripts/prepare-libetpan-macos.sh2
-rw-r--r--src/async/imap/MCIMAPAsyncConnection.cc2
-rw-r--r--src/async/pop/MCPOPAsyncSession.cc2
-rw-r--r--src/async/smtp/MCSMTPAsyncSession.cc2
-rw-r--r--src/core/basetypes/MCConnectionLogger.h1
-rw-r--r--src/objc/imap/MCOIMAPSession.mm2
-rw-r--r--src/objc/pop/MCOPOPSession.mm2
-rw-r--r--src/objc/smtp/MCOSMTPSession.mm2
10 files changed, 17 insertions, 11 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m
index c9866ff8..3e5e4422 100644
--- a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m
+++ b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m
@@ -45,9 +45,16 @@
self.imapSession.username = username;
self.imapSession.password = password;
self.imapSession.connectionType = MCOConnectionTypeTLS;
-
+ MasterViewController * __weak weakSelf = self;
+ self.imapSession.connectionLogger = ^(void * connectionID, MCOConnectionLogType type, NSData * data) {
+ @synchronized(weakSelf) {
+ if (type != MCOConnectionLogTypeSentPrivate) {
+ NSLog(@"event logged:%p %i withData: %@", connectionID, type, [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
+ }
+ }
+ };
+
NSLog(@"checking account");
- __weak MasterViewController *weakSelf = self;
self.imapCheckOp = [self.imapSession checkAccountOperation];
[self.imapCheckOp start:^(NSError *error) {
MasterViewController *strongSelf = weakSelf;
diff --git a/scripts/prepare-libetpan-ios.sh b/scripts/prepare-libetpan-ios.sh
index 7a5a054b..ea109b5d 100755
--- a/scripts/prepare-libetpan-ios.sh
+++ b/scripts/prepare-libetpan-ios.sh
@@ -2,7 +2,7 @@
sdkversion=6.1
url="https://github.com/dinhviethoa/libetpan.git"
-rev=78427a0506be00e1e72ac8f88aa4b71bebd4137f
+rev=517a7fb7c47d925f67cc48ddf9636170c74ecd9e
pushd `dirname $0` > /dev/null
scriptpath=`pwd`
diff --git a/scripts/prepare-libetpan-macos.sh b/scripts/prepare-libetpan-macos.sh
index 81013fa6..c8eaf26b 100755
--- a/scripts/prepare-libetpan-macos.sh
+++ b/scripts/prepare-libetpan-macos.sh
@@ -1,7 +1,7 @@
#!/bin/sh
url="https://github.com/dinhviethoa/libetpan.git"
-rev=78427a0506be00e1e72ac8f88aa4b71bebd4137f
+rev=517a7fb7c47d925f67cc48ddf9636170c74ecd9e
pushd `dirname $0` > /dev/null
scriptpath=`pwd`
diff --git a/src/async/imap/MCIMAPAsyncConnection.cc b/src/async/imap/MCIMAPAsyncConnection.cc
index fc1935b7..1d07f79a 100644
--- a/src/async/imap/MCIMAPAsyncConnection.cc
+++ b/src/async/imap/MCIMAPAsyncConnection.cc
@@ -69,7 +69,7 @@ namespace mailcore {
virtual ~IMAPConnectionLogger() {
}
- virtual void log(void * context, void * sender, ConnectionLogType logType, Data * buffer)
+ virtual void log(void * sender, ConnectionLogType logType, Data * buffer)
{
mConnection->logConnection(logType, buffer);
}
diff --git a/src/async/pop/MCPOPAsyncSession.cc b/src/async/pop/MCPOPAsyncSession.cc
index 342b0f5e..bfabc847 100644
--- a/src/async/pop/MCPOPAsyncSession.cc
+++ b/src/async/pop/MCPOPAsyncSession.cc
@@ -50,7 +50,7 @@ namespace mailcore {
virtual ~POPConnectionLogger() {
}
- virtual void log(void * context, void * sender, ConnectionLogType logType, Data * buffer)
+ virtual void log(void * sender, ConnectionLogType logType, Data * buffer)
{
mSession->logConnection(logType, buffer);
}
diff --git a/src/async/smtp/MCSMTPAsyncSession.cc b/src/async/smtp/MCSMTPAsyncSession.cc
index fafc2e82..38d57756 100644
--- a/src/async/smtp/MCSMTPAsyncSession.cc
+++ b/src/async/smtp/MCSMTPAsyncSession.cc
@@ -41,7 +41,7 @@ namespace mailcore {
virtual ~SMTPConnectionLogger() {
}
- virtual void log(void * context, void * sender, ConnectionLogType logType, Data * buffer)
+ virtual void log(void * sender, ConnectionLogType logType, Data * buffer)
{
mSession->logConnection(logType, buffer);
}
diff --git a/src/core/basetypes/MCConnectionLogger.h b/src/core/basetypes/MCConnectionLogger.h
index dd596857..bdb588bc 100644
--- a/src/core/basetypes/MCConnectionLogger.h
+++ b/src/core/basetypes/MCConnectionLogger.h
@@ -16,7 +16,6 @@
namespace mailcore {
class Data;
- class String;
enum ConnectionLogType {
// Received data
diff --git a/src/objc/imap/MCOIMAPSession.mm b/src/objc/imap/MCOIMAPSession.mm
index 43f366e6..0c23f1e2 100644
--- a/src/objc/imap/MCOIMAPSession.mm
+++ b/src/objc/imap/MCOIMAPSession.mm
@@ -35,7 +35,7 @@ public:
mSession = session;
}
- virtual void log(void * context, void * sender, ConnectionLogType logType, Data * data)
+ virtual void log(void * sender, ConnectionLogType logType, Data * data)
{
[mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)];
}
diff --git a/src/objc/pop/MCOPOPSession.mm b/src/objc/pop/MCOPOPSession.mm
index 42c76646..fb48cb1e 100644
--- a/src/objc/pop/MCOPOPSession.mm
+++ b/src/objc/pop/MCOPOPSession.mm
@@ -31,7 +31,7 @@ public:
mSession = session;
}
- virtual void log(void * context, void * sender, ConnectionLogType logType, Data * data)
+ virtual void log(void * sender, ConnectionLogType logType, Data * data)
{
[mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)];
}
diff --git a/src/objc/smtp/MCOSMTPSession.mm b/src/objc/smtp/MCOSMTPSession.mm
index 1538d53a..1cadf4ad 100644
--- a/src/objc/smtp/MCOSMTPSession.mm
+++ b/src/objc/smtp/MCOSMTPSession.mm
@@ -32,7 +32,7 @@ public:
mSession = session;
}
- virtual void log(void * context, void * sender, ConnectionLogType logType, Data * data)
+ virtual void log(void * sender, ConnectionLogType logType, Data * data)
{
[mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)];
}