From 1df7df14e3462d7f339400b7203c4af8b18760d1 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 5 Feb 2017 12:10:12 +0100 Subject: [PATCH] compatibility for Windows build, removed unnecessary code --- src/ebusd/network.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ebusd/network.cpp b/src/ebusd/network.cpp index 58a25552..d77f3e77 100644 --- a/src/ebusd/network.cpp +++ b/src/ebusd/network.cpp @@ -31,6 +31,10 @@ namespace ebusd { int Connection::m_ids = 0; +#ifndef POLLRDHUP +#define POLLRDHUP 0 +#endif + void Connection::run() { int ret; struct timespec tdiff; @@ -113,7 +117,7 @@ void Connection::run() { break; } if (newData) { - size_t datalen = m_socket->recv(data, sizeof(data)-1); + ssize_t datalen = m_socket->recv(data, sizeof(data)-1); // remove closed socket if (datalen <= 0) { @@ -278,9 +282,6 @@ void Network::run() { continue; } Connection* connection = new Connection(socket, isHttp, m_netQueue); - if (connection == NULL) { - continue; - } connection->start("connection"); m_connections.push_back(connection); logInfo(lf_network, "[%05d] %s connection opened %s", connection->getID(), isHttp ? "HTTP" : "client",