Do not increment tag after sending command (parser needs current tag).

This commit is contained in:
Vincent Richard 2013-05-13 21:28:43 +02:00
parent ea700d80f5
commit 5fcb20d996
2 changed files with 9 additions and 4 deletions

View File

@ -66,7 +66,7 @@ namespace imap {
IMAPConnection::IMAPConnection(ref <IMAPStore> store, ref <security::authenticator> auth) 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_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_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) void IMAPConnection::send(bool tag, const string& what, bool end)
{ {
if (tag && !m_firstTag)
{
++(*m_tag);
m_firstTag = false;
}
#if VMIME_DEBUG #if VMIME_DEBUG
std::ostringstream oss; std::ostringstream oss;
@ -657,9 +663,6 @@ void IMAPConnection::send(bool tag, const string& what, bool end)
m_socket->send("\r\n"); m_socket->send("\r\n");
} }
#endif #endif
if (tag)
++(*m_tag);
} }

View File

@ -133,6 +133,8 @@ private:
bool m_secured; bool m_secured;
ref <connectionInfos> m_cntInfos; ref <connectionInfos> m_cntInfos;
bool m_firstTag;
void internalDisconnect(); void internalDisconnect();