summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/socket_transport.cpp2
-rw-r--r--src/sockets.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/socket_transport.cpp b/src/socket_transport.cpp
index 6293ea385..1476d0662 100644
--- a/src/socket_transport.cpp
+++ b/src/socket_transport.cpp
@@ -167,6 +167,8 @@ bool BinarySocket::ProcessWrite()
void BinarySocket::Write(const char *buffer, size_t l)
{
+ if (l == 0)
+ return;
this->write_buffer.push_back(new DataBlock(buffer, l));
SocketEngine::Change(this, true, SF_WRITABLE);
}
diff --git a/src/sockets.cpp b/src/sockets.cpp
index 948f3e238..f50092744 100644
--- a/src/sockets.cpp
+++ b/src/sockets.cpp
@@ -517,7 +517,7 @@ ListenSocket::ListenSocket(const Anope::string &bindip, int port, bool i)
{
this->SetBlocking(false);
- const char op = 1;
+ int op = 1;
setsockopt(this->GetFD(), SOL_SOCKET, SO_REUSEADDR, &op, sizeof(op));
this->bindaddr.pton(i ? AF_INET6 : AF_INET, bindip, port);