From f21f2ba7acdbc3c64bf668c632d974aab39e1da0 Mon Sep 17 00:00:00 2001
From: xzl <771730766@qq.com>
Date: Thu, 25 May 2017 17:59:40 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DAndroid?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.cproject | 16 ++++++++--------
src/Http/HttpsSession.h | 16 ++++++++++++++++
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/.cproject b/.cproject
index 9fad0060..6a9e42db 100644
--- a/.cproject
+++ b/.cproject
@@ -323,10 +323,11 @@
+
-
+
@@ -357,14 +358,13 @@
-
+
+
+
-
-
+
+
+
diff --git a/src/Http/HttpsSession.h b/src/Http/HttpsSession.h
index e240dd09..80a28de4 100644
--- a/src/Http/HttpsSession.h
+++ b/src/Http/HttpsSession.h
@@ -22,10 +22,18 @@ public:
HttpsSession(const std::shared_ptr &pTh, const Socket::Ptr &pSock):
HttpSession(pTh,pSock){
m_sslBox.setOnEncData([&](const char *data, uint32_t len){
+#ifdef ANDROID
+ public_send(data,len);
+#else//ANDROID
HttpSession::send(data,len);
+#endif//ANDROID
});
m_sslBox.setOnDecData([&](const char *data, uint32_t len){
+#ifdef ANDROID
+ public_onRecv(data,len);
+#else//ANDROID
HttpSession::onRecv(data,len);
+#endif//ANDROID
});
}
virtual ~HttpsSession(){
@@ -35,6 +43,14 @@ public:
TimeTicker();
m_sslBox.onRecv(pBuf->data(), pBuf->size());
}
+#ifdef ANDROID
+ int public_send(const char *data, uint32_t len){
+ return HttpSession::send(data,len);
+ }
+ void public_onRecv(const char *data, uint32_t len){
+ HttpSession::onRecv(data,len);
+ }
+#endif//ANDROID
private:
virtual int send(const string &buf) override{
TimeTicker();