From 51657e10769faa2617d546a06c42e4c62a19bb50 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 30 Jan 2022 17:41:24 +0100 Subject: Removed trailing whitespace all over the place --- NetEx/HttpServer.cpp | 4 ++-- NetEx/HttpServlet.cpp | 4 ++-- NetEx/NetAddr.cpp | 2 +- NetEx/NetHost.cpp | 2 +- NetEx/NetLink.cpp | 2 +- NetEx/NetMsg.cpp | 4 ++-- NetEx/NetPeer.h | 2 +- NetEx/NetServer.cpp | 6 +++--- NetEx/NetSock.cpp | 16 ++++++++-------- 9 files changed, 21 insertions(+), 21 deletions(-) (limited to 'NetEx') diff --git a/NetEx/HttpServer.cpp b/NetEx/HttpServer.cpp index 92a13b2..db27faf 100644 --- a/NetEx/HttpServer.cpp +++ b/NetEx/HttpServer.cpp @@ -221,7 +221,7 @@ HttpServer::DoHead(HttpRequest& request, HttpResponse& response) { if (DoGet(request, response)) { int len = response.Content().length(); - + char buffer[256]; sprintf_s(buffer, "%d", len); response.SetHeader("Content-Length", buffer); @@ -264,7 +264,7 @@ HttpRequest::ParseRequest(Text request) const char* pQuery = 0; switch (request[0]) { - case 'G': + case 'G': if (request.indexOf("GET") == 0) method = HTTP_GET; break; diff --git a/NetEx/HttpServlet.cpp b/NetEx/HttpServlet.cpp index 17f5084..51a5187 100644 --- a/NetEx/HttpServlet.cpp +++ b/NetEx/HttpServlet.cpp @@ -100,7 +100,7 @@ HttpServlet::DoHead(HttpRequest& request, HttpResponse& response) { if (DoGet(request, response)) { int len = response.Content().length(); - + char buffer[256]; sprintf(buffer, "%d", len); response.SetHeader("Content-Length", buffer); @@ -198,7 +198,7 @@ HttpSession::SetIntAttribute(const char* name, int value) { char buf[32]; sprintf(buf, "%d", value); - + ListIter iter = attributes; while (++iter) { HttpParam* p = iter.value(); diff --git a/NetEx/NetAddr.cpp b/NetEx/NetAddr.cpp index ea26f0a..c550f68 100644 --- a/NetEx/NetAddr.cpp +++ b/NetEx/NetAddr.cpp @@ -51,7 +51,7 @@ NetAddr::NetAddr(const char* host_name, WORD p) if (isdigit(*host_name)) { DWORD a = inet_addr(host_name); - h = gethostbyaddr((const char*) &a, 4, AF_INET); + h = gethostbyaddr((const char*) &a, 4, AF_INET); } else { h = gethostbyname(host_name); diff --git a/NetEx/NetHost.cpp b/NetEx/NetHost.cpp index 03330f0..5cb9e08 100644 --- a/NetEx/NetHost.cpp +++ b/NetEx/NetHost.cpp @@ -62,7 +62,7 @@ void NetHost::Init(const char* host_name) if (isdigit(*host_name)) { DWORD addr = inet_addr(host_name); - h = gethostbyaddr((const char*) &addr, 4, AF_INET); + h = gethostbyaddr((const char*) &addr, 4, AF_INET); } else { h = gethostbyname(host_name); diff --git a/NetEx/NetLink.cpp b/NetEx/NetLink.cpp index 05c486a..5c2f99a 100644 --- a/NetEx/NetLink.cpp +++ b/NetEx/NetLink.cpp @@ -333,7 +333,7 @@ NetLink::SendNetGram(NetGram* gram) packets_sent += 1; bytes_sent += gram->Size() + UDP_HEADER_SIZE; } - + if (!gram->IsReliable()) delete gram; } diff --git a/NetEx/NetMsg.cpp b/NetEx/NetMsg.cpp index e326d3a..e44e9e2 100644 --- a/NetEx/NetMsg.cpp +++ b/NetEx/NetMsg.cpp @@ -47,7 +47,7 @@ static DWORD net_msg_sequence = 1; // +-------------------------------------------------------------------+ -NetMsg::NetMsg(DWORD nid, void* d, int l, BYTE f) +NetMsg::NetMsg(DWORD nid, void* d, int l, BYTE f) : msgid(net_msg_sequence++), netid(nid), len(l), flags(f) { data = new(__FILE__,__LINE__) BYTE[len]; @@ -67,7 +67,7 @@ NetMsg::NetMsg(DWORD nid, void* d, int l, BYTE f) // +-------------------------------------------------------------------+ -NetMsg::NetMsg(DWORD nid, BYTE type, const char* text, int l, BYTE f) +NetMsg::NetMsg(DWORD nid, BYTE type, const char* text, int l, BYTE f) : msgid(net_msg_sequence++), netid(nid), len(2+l), flags(f) { data = new(__FILE__,__LINE__) BYTE[len]; diff --git a/NetEx/NetPeer.h b/NetEx/NetPeer.h index c48b69b..49b2ad0 100644 --- a/NetEx/NetPeer.h +++ b/NetEx/NetPeer.h @@ -102,7 +102,7 @@ private: enum HIST { HIST_SIZE=8 }; - DWORD last_recv_time; // time of last received packet + DWORD last_recv_time; // time of last received packet DWORD hist_time[HIST_SIZE]; // history for pps check DWORD hist_size[HIST_SIZE]; // history for bps check int hist_indx; // index into history diff --git a/NetEx/NetServer.cpp b/NetEx/NetServer.cpp index 1ec45fd..b9b3587 100644 --- a/NetEx/NetServer.cpp +++ b/NetEx/NetServer.cpp @@ -249,14 +249,14 @@ NetServer::ProcessRequest(Text msg, const NetAddr& addr) { if (msg.indexOf("GET ") == 0) return DefaultResponse(); - + return ErrorResponse(); } Text NetServer::DefaultResponse() { - Text response = + Text response = "HTTP/1.0 200 OK\nServer: Generic NetServer 1.0\nMIME-Version: 1.0\nContent-type: text/html\n\n"; response += "Generic NetServer 1.0\n\n"; @@ -271,7 +271,7 @@ NetServer::DefaultResponse() Text NetServer::ErrorResponse() { - Text response = + Text response = "HTTP/1.0 501 Not Implemented\nServer: Generic NetServer 1.0\nMIME-Version: 1.0\nContent-type: text/html\n\n"; response += "Generic NetServer 1.0\n\n"; diff --git a/NetEx/NetSock.cpp b/NetEx/NetSock.cpp index 0fb1081..06cbdcc 100644 --- a/NetEx/NetSock.cpp +++ b/NetEx/NetSock.cpp @@ -122,7 +122,7 @@ NetSock::accept(NetAddr* addr) if (addr) { sockaddr a; int asize = sizeof(a); - + conn = ::accept(s, &a, &asize); if (conn != INVALID_SOCKET && asize > 0) { @@ -140,19 +140,19 @@ NetSock::accept(NetAddr* addr) } // +--------------------------------------------------------------------+ - + int NetSock::available() { if (closed || s == INVALID_SOCKET) return 0; - + DWORD nbytes = 0; if (::ioctlsocket(s, FIONREAD, &nbytes) == 0) return (int) nbytes; return 0; } - + // +--------------------------------------------------------------------+ int @@ -279,7 +279,7 @@ NetSock::set_timeout(int msecs) { if (closed || s == INVALID_SOCKET) return 0; if (msecs == current_timeout) return 1; - + // zero timeout means non-blocking if (msecs == 0) { u_long nonblocking = 1; @@ -288,7 +288,7 @@ NetSock::set_timeout(int msecs) return stat; } } - + // non-zero timeout means blocking else { if (current_timeout == 0) { @@ -305,14 +305,14 @@ NetSock::set_timeout(int msecs) ::setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*) &maxto, sizeof(maxto)); ::setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (char*) &maxto, sizeof(maxto)); } - + // otherwise, set the timeout else { ::setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*) &msecs, sizeof(msecs)); ::setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (char*) &msecs, sizeof(msecs)); } } - + current_timeout = msecs; return 1; } -- cgit v1.1