diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-05 14:36:51 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-05 14:36:51 +0000 |
commit | 1e2e45fdc36eb6968f7551f5ace59169bc569511 (patch) | |
tree | 8647a867de8da0373bf23eaad52a76513fe89970 /src/modules/extra/m_ssl_openssl.cpp | |
parent | 3f97fe394b38ffc0d8374965cd301f78383f9dde (diff) |
Revert my fix and apply the flushevent, and a bit of debugging output.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7661 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_ssl_openssl.cpp')
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index e4b56d645..1f5a71b10 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -346,7 +346,7 @@ class ModuleSSLOpenSSL : public Module void Implements(char* List) { List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = List[I_On005Numeric] = 1; - List[I_OnRequest] = List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnPostConnect] = 1; + List[I_OnBufferFlushed] = List[I_OnRequest] = List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnPostConnect] = 1; } virtual char* OnRequest(Request* request) @@ -500,9 +500,13 @@ class ModuleSSLOpenSSL : public Module { int ret = DoRead(session); + ServerInstance->Log(DEBUG, "<***> DoRead count: " + ConvToStr(count)); + ServerInstance->Log(DEBUG, "<***> DoRead ret: " + ConvToStr(ret)); + ServerInstance->Log(DEBUG, "<***> DoRead session->inbufoffset: " + ConvToStr(session->inbufoffset)); + if (ret > 0) { - if (count > session->inbufoffset) + if (count <= session->inbufoffset) { memcpy(buffer, session->inbuf, count); // Move the stuff left in inbuf to the beginning of it @@ -794,6 +798,17 @@ class ModuleSSLOpenSSL : public Module ServerInstance->SE->WantWrite(eh); } +virtual void OnBufferFlushed(userrec* user) +{ + if (user->GetExt("ssl")) + { + ServerInstance->Log(DEBUG,"OnBufferFlushed for ssl user"); + issl_session* session = &sessions[user->GetFd()]; + if (session && session->outbuf.size()) + OnRawSocketWrite(user->GetFd(), NULL, 0); + } + } + void CloseSession(issl_session* session) { if (session->sess) |