summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.cpp6
-rw-r--r--src/connection.cpp2
-rw-r--r--src/servers.cpp1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 929a84f38..8684cbe06 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -3288,6 +3288,7 @@ void handle_link_packet(char* tcp_msg, char* tcp_host, serverrec *serv,char* tcp
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"E :Server %s already exists!",servername);
serv->SendPacket(buffer,tcp_host);
+ serv->FlushWriteBuffers();
RemoveServer(tcp_host);
return;
}
@@ -3298,6 +3299,7 @@ void handle_link_packet(char* tcp_msg, char* tcp_host, serverrec *serv,char* tcp
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"E :Version number mismatch");
serv->SendPacket(buffer,tcp_host);
+ serv->FlushWriteBuffers();
RemoveServer(tcp_host);
RemoveServer(servername);
return;
@@ -3352,6 +3354,7 @@ void handle_link_packet(char* tcp_msg, char* tcp_host, serverrec *serv,char* tcp
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"E :Access is denied (no matching link block)");
serv->SendPacket(buffer,tcp_host);
+ serv->FlushWriteBuffers();
WriteOpers("CONNECT from %s denied, no matching link block",servername);
RemoveServer(tcp_host);
RemoveServer(servername);
@@ -3425,6 +3428,7 @@ void handle_link_packet(char* tcp_msg, char* tcp_host, serverrec *serv,char* tcp
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"E :Access is denied (no matching link block)");
serv->SendPacket(buffer,tcp_host);
+ serv->FlushWriteBuffers();
WriteOpers("CONNECT from %s denied, no matching link block",servername);
RemoveServer(tcp_host);
RemoveServer(servername);
@@ -3463,6 +3467,7 @@ void handle_link_packet(char* tcp_msg, char* tcp_host, serverrec *serv,char* tcp
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"E :Access is denied (Server exists in the mesh)");
serv->SendPacket(buffer,tcp_host);
+ serv->FlushWriteBuffers();
WriteOpers("CONNECT from %s denied, \"%s\" already exists!",tcp_host,servername);
RemoveServer(tcp_host);
return;
@@ -3523,6 +3528,7 @@ void handle_link_packet(char* tcp_msg, char* tcp_host, serverrec *serv,char* tcp
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"E :Access is denied (no matching link block)");
serv->SendPacket(buffer,tcp_host);
+ serv->FlushWriteBuffers();
WriteOpers("CONNECT from %s denied, no matching link block",servername);
RemoveServer(tcp_host);
RemoveServer(servername);
diff --git a/src/connection.cpp b/src/connection.cpp
index 31080615d..7e54e4297 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -228,6 +228,8 @@ bool ircd_connector::FlushWriteBuf()
int ret = poll(&polls,1,1);
if (ret < 1)
return true;
+ // this falls through and sends any waiting data, which can put it into the
+ // connected state.
}
if (sendq.length())
{
diff --git a/src/servers.cpp b/src/servers.cpp
index 0e47ecfba..d22ad760f 100644
--- a/src/servers.cpp
+++ b/src/servers.cpp
@@ -193,7 +193,6 @@ bool serverrec::MeshCookie(char* targethost, int newport, unsigned long cookie,
snprintf(connect,MAXBUF,"- %lu %s :%s",cookie,getservername().c_str(),getserverdesc().c_str());
connector.SetState(STATE_NOAUTH_OUTBOUND);
connector.SetHostAndPort(targethost, newport);
- connector.SetState(STATE_CONNECTED);
this->connectors.push_back(connector);
return this->SendPacket(connect, servername);
}