diff options
author | Vincent Richard <[email protected]> | 2013-05-13 19:28:43 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-05-13 19:28:43 +0000 |
commit | 5fcb20d9968e601eaae0cae0cd1e692cb45a06dd (patch) | |
tree | 13323f73e343005533b5c4d80ff17150d3e4991f /src | |
parent | Cross-platform and (truly) thread-safe OpenSSL initialization. (diff) | |
download | vmime-5fcb20d9968e601eaae0cae0cd1e692cb45a06dd.tar.gz vmime-5fcb20d9968e601eaae0cae0cd1e692cb45a06dd.zip |
Do not increment tag after sending command (parser needs current tag).
Diffstat (limited to 'src')
-rw-r--r-- | src/net/imap/IMAPConnection.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp index 066b5ab5..7ad5a7a7 100644 --- a/src/net/imap/IMAPConnection.cpp +++ b/src/net/imap/IMAPConnection.cpp @@ -66,7 +66,7 @@ namespace imap { IMAPConnection::IMAPConnection(ref <IMAPStore> store, ref <security::authenticator> auth) : m_store(store), m_auth(auth), m_socket(NULL), m_parser(NULL), m_tag(NULL), m_hierarchySeparator('\0'), m_state(STATE_NONE), m_timeoutHandler(NULL), - m_secured(false) + m_secured(false), m_firstTag(true) { } @@ -628,6 +628,12 @@ void IMAPConnection::initHierarchySeparator() void IMAPConnection::send(bool tag, const string& what, bool end) { + if (tag && !m_firstTag) + { + ++(*m_tag); + m_firstTag = false; + } + #if VMIME_DEBUG std::ostringstream oss; @@ -657,9 +663,6 @@ void IMAPConnection::send(bool tag, const string& what, bool end) m_socket->send("\r\n"); } #endif - - if (tag) - ++(*m_tag); } |