diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-27 18:13:46 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-27 18:13:46 +0000 |
commit | 1f90d786db11d3b920719102709b89d4961f488b (patch) | |
tree | 007e5e69f5b796024ea8e1d70b5143095b28d967 /src/modules/m_spanningtree | |
parent | 279e9acfaca41fe03e9d835a559e79844baadf3c (diff) |
Potential desync on "nick collision at same time as fjoin" fix
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6445 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 31564b017..a772c8124 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -981,12 +981,6 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p who = this->Instance->FindNick(usr); if (who) { - /* Did they get any modes? How many times? */ - strlcat(modestring, nm, MAXBUF); - for (int k = 0; k < ntimes; k++) - mode_users[modectr++] = strdup(usr); - /* Free temporary buffer used for mode sequence */ - delete[] nm; /* Check that the user's 'direction' is correct * based on the server sending the FJOIN. We must * check each nickname in turn, because the origin of @@ -997,8 +991,23 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p if ((!route_back_again) || (route_back_again->GetSocket() != this)) { /* Oh dear oh dear. */ + delete[] nm; continue; } + + /* NOTE: Moved this below the fake direction check, so that modes + * arent put into the mode list for users that were collided, and + * may reconnect from the other side or our side before the split + * is completed! + */ + + /* Did they get any modes? How many times? */ + strlcat(modestring, nm, MAXBUF); + for (int k = 0; k < ntimes; k++) + mode_users[modectr++] = strdup(usr); + /* Free temporary buffer used for mode sequence */ + delete[] nm; + /* Finally, we can actually place the user into the channel. * We're sure its right. Final answer, phone a friend. */ @@ -1054,7 +1063,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p * in case somehow we're desynched, so that other users which might be able to see * the nickname get their fair chance to process it. */ - Instance->Log(SPARSE,"Warning! Invalid user in FJOIN to channel %s IGNORED", channel.c_str()); + Instance->Log(SPARSE,"Warning! Invalid user %s in FJOIN to channel %s IGNORED", usr, channel.c_str()); continue; } } |