summaryrefslogtreecommitdiffhomepage
path: root/NetEx
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-03-27 17:42:26 +0200
committerAki <please@ignore.pl>2022-03-27 17:42:26 +0200
commita12e588079700d55a0b788fea2df7727c2e41f52 (patch)
tree690072569624c73af5043b3619acaab4d298b1fa /NetEx
parent72bb517271dad40a440533ad0796a88247011199 (diff)
downloadstarshatter-a12e588079700d55a0b788fea2df7727c2e41f52.zip
starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.gz
starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.bz2
Removed MemDebug from FoundationEx
Diffstat (limited to 'NetEx')
-rw-r--r--NetEx/HttpClient.cpp6
-rw-r--r--NetEx/HttpServer.cpp34
-rw-r--r--NetEx/HttpServlet.cpp6
-rw-r--r--NetEx/HttpServletExec.cpp6
-rw-r--r--NetEx/NetAddr.cpp3
-rw-r--r--NetEx/NetClient.cpp4
-rw-r--r--NetEx/NetGram.cpp2
-rw-r--r--NetEx/NetHost.cpp5
-rw-r--r--NetEx/NetLayer.cpp2
-rw-r--r--NetEx/NetLink.cpp12
-rw-r--r--NetEx/NetMsg.cpp6
-rw-r--r--NetEx/NetPeer.cpp18
-rw-r--r--NetEx/NetServer.cpp8
-rw-r--r--NetEx/NetSock.cpp3
14 files changed, 45 insertions, 70 deletions
diff --git a/NetEx/HttpClient.cpp b/NetEx/HttpClient.cpp
index 710ab88..5b62a51 100644
--- a/NetEx/HttpClient.cpp
+++ b/NetEx/HttpClient.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpClient.h"
#include "NetHost.h"
#include "NetLayer.h"
@@ -38,7 +36,7 @@ HttpClient::DoRequest(HttpRequest& request)
Text req = request.operator Text();
Text msg = SendRecv(req);
- HttpResponse* response = new(__FILE__,__LINE__) HttpResponse(msg);
+ HttpResponse* response = new HttpResponse(msg);
if (response) {
// save cookies returned in response:
@@ -59,7 +57,7 @@ HttpClient::CombineCookies(List<HttpParam>& dst, List<HttpParam>& src)
d->value = s->value;
}
else {
- HttpParam* cookie = new(__FILE__,__LINE__) HttpParam(s->name, s->value);
+ HttpParam* cookie = new HttpParam(s->name, s->value);
if (cookie)
dst.append(cookie);
}
diff --git a/NetEx/HttpServer.cpp b/NetEx/HttpServer.cpp
index 9a63577..8098351 100644
--- a/NetEx/HttpServer.cpp
+++ b/NetEx/HttpServer.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpServer.h"
#include "NetLayer.h"
@@ -313,7 +311,7 @@ HttpRequest::ParseRequest(Text request)
if (*pQuery == '&')
pQuery++;
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, DecodeParam(value_buf));
+ HttpParam* param = new HttpParam(name_buf, DecodeParam(value_buf));
if (param)
query.append(param);
}
@@ -347,7 +345,7 @@ HttpRequest::ParseRequest(Text request)
ParseCookie(value_buf);
}
else {
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, value_buf);
+ HttpParam* param = new HttpParam(name_buf, value_buf);
if (param)
headers.append(param);
}
@@ -385,7 +383,7 @@ HttpRequest::ParseRequest(Text request)
if (*pQuery == '&')
pQuery++;
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, DecodeParam(value_buf));
+ HttpParam* param = new HttpParam(name_buf, DecodeParam(value_buf));
if (param)
query.append(param);
}
@@ -435,7 +433,7 @@ HttpRequest::ParseCookie(const char* param)
if (*p == ';')
p++;
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, data);
+ HttpParam* param = new HttpParam(name, data);
if (param)
cookies.append(param);
}
@@ -492,7 +490,7 @@ HttpRequest::SetHeader(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -500,7 +498,7 @@ HttpRequest::SetHeader(const char* name, const char* value)
void
HttpRequest::AddHeader(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -534,7 +532,7 @@ HttpRequest::SetCookie(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -542,7 +540,7 @@ HttpRequest::SetCookie(const char* name, const char* value)
void
HttpRequest::AddCookie(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -564,7 +562,7 @@ HttpRequest::DecodeParam(const char* value)
char* p = sbuf;
if (size > 255) {
- lbuf = new(__FILE__,__LINE__) char[size+1];
+ lbuf = new char[size+1];
dst = lbuf;
p = lbuf;
}
@@ -618,7 +616,7 @@ HttpRequest::EncodeParam(const char* value)
char* p = sbuf;
if (size > 255) {
- lbuf = new(__FILE__,__LINE__) char[4*size+1];
+ lbuf = new char[4*size+1];
dst = lbuf;
p = lbuf;
}
@@ -820,7 +818,7 @@ HttpResponse::SetHeader(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -828,7 +826,7 @@ HttpResponse::SetHeader(const char* name, const char* value)
void
HttpResponse::AddHeader(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
headers.append(param);
}
@@ -862,7 +860,7 @@ HttpResponse::SetCookie(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -870,7 +868,7 @@ HttpResponse::SetCookie(const char* name, const char* value)
void
HttpResponse::AddCookie(const char* name, const char* value)
{
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
cookies.append(param);
}
@@ -927,7 +925,7 @@ HttpResponse::ParseResponse(Text response)
ParseCookie(value_buf);
}
else {
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name_buf, value_buf);
+ HttpParam* param = new HttpParam(name_buf, value_buf);
if (param)
headers.append(param);
}
@@ -987,7 +985,7 @@ HttpResponse::ParseCookie(const char* param)
// ignore the version attribute
if (_stricmp(name, "version")) {
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, data);
+ HttpParam* param = new HttpParam(name, data);
if (param)
cookies.append(param);
}
diff --git a/NetEx/HttpServlet.cpp b/NetEx/HttpServlet.cpp
index 40632cd..eb9f19e 100644
--- a/NetEx/HttpServlet.cpp
+++ b/NetEx/HttpServlet.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpServlet.h"
#include "NetLayer.h"
@@ -131,7 +129,7 @@ HttpSession::SetAttribute(const char* name, const char* value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, value);
+ HttpParam* param = new HttpParam(name, value);
if (param)
attributes.append(param);
}
@@ -184,7 +182,7 @@ HttpSession::SetIntAttribute(const char* name, int value)
}
}
- HttpParam* param = new(__FILE__,__LINE__) HttpParam(name, buf);
+ HttpParam* param = new HttpParam(name, buf);
if (param)
attributes.append(param);
}
diff --git a/NetEx/HttpServletExec.cpp b/NetEx/HttpServletExec.cpp
index 434945e..357a5f8 100644
--- a/NetEx/HttpServletExec.cpp
+++ b/NetEx/HttpServletExec.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "HttpServletExec.h"
#include "HttpServlet.h"
#include "NetLayer.h"
@@ -120,7 +118,7 @@ HttpServletExec::~HttpServletExec()
HttpServlet*
HttpServletExec::GetServlet(HttpRequest& request)
{
- return new(__FILE__,__LINE__) HttpTestServlet;
+ return new HttpTestServlet;
}
// +--------------------------------------------------------------------+
@@ -144,7 +142,7 @@ HttpServletExec::GetSession(HttpRequest& request)
}
if (!session) {
- session = new(__FILE__,__LINE__) HttpSession;
+ session = new HttpSession;
if (session) {
sessions.append(session);
diff --git a/NetEx/NetAddr.cpp b/NetEx/NetAddr.cpp
index 2e043f1..62eb24a 100644
--- a/NetEx/NetAddr.cpp
+++ b/NetEx/NetAddr.cpp
@@ -11,13 +11,12 @@
Network Address
*/
-
-#include "MemDebug.h"
#include "NetAddr.h"
#include "NetHost.h"
#include "NetLayer.h"
#include <ctype.h>
+
NetAddr::NetAddr(const char* host_name, WORD p)
: addr(0), port(p)
{
diff --git a/NetEx/NetClient.cpp b/NetEx/NetClient.cpp
index 7e7e7b9..a334d64 100644
--- a/NetEx/NetClient.cpp
+++ b/NetEx/NetClient.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "NetClient.h"
#include "NetHost.h"
#include "NetLayer.h"
@@ -39,7 +37,7 @@ NetClient::Send(Text msg)
if (sock)
delete sock;
- sock = new(__FILE__,__LINE__) NetSock(addr, true);
+ sock = new NetSock(addr, true);
delta = 0;
time = timeGetTime();
diff --git a/NetEx/NetGram.cpp b/NetEx/NetGram.cpp
index a2dc346..701d562 100644
--- a/NetEx/NetGram.cpp
+++ b/NetEx/NetGram.cpp
@@ -11,8 +11,6 @@
Generic Network Packet (Datagram) Implementation
*/
-
-#include "MemDebug.h"
#include "NetGram.h"
#include "NetLayer.h"
diff --git a/NetEx/NetHost.cpp b/NetEx/NetHost.cpp
index dca3de0..1c24ff0 100644
--- a/NetEx/NetHost.cpp
+++ b/NetEx/NetHost.cpp
@@ -11,12 +11,11 @@
Network Host
*/
-
-#include "MemDebug.h"
#include "NetHost.h"
#include "NetLayer.h"
#include <ctype.h>
+
NetHost::NetHost()
{
char host_name[256];
@@ -54,7 +53,7 @@ void NetHost::Init(const char* host_name)
char** addr = h->h_addr_list;
while (*addr) {
- NetAddr* pna = new(__FILE__,__LINE__) NetAddr(**(DWORD**) addr);
+ NetAddr* pna = new NetAddr(**(DWORD**) addr);
if (pna)
addresses.append(pna);
addr++;
diff --git a/NetEx/NetLayer.cpp b/NetEx/NetLayer.cpp
index 029091b..c67c6a4 100644
--- a/NetEx/NetLayer.cpp
+++ b/NetEx/NetLayer.cpp
@@ -11,8 +11,6 @@
Wrapper for WinSock Library
*/
-
-#include "MemDebug.h"
#include <windows.h>
#include "NetLayer.h"
diff --git a/NetEx/NetLink.cpp b/NetEx/NetLink.cpp
index a1b83e7..bbba59b 100644
--- a/NetEx/NetLink.cpp
+++ b/NetEx/NetLink.cpp
@@ -11,8 +11,6 @@
Network (IP) Socket Wrapper Implementation
*/
-
-#include "MemDebug.h"
#include "NetLink.h"
#include "NetGram.h"
#include "NetMsg.h"
@@ -94,7 +92,7 @@ NetLink::AddPeer(const NetAddr& a)
NetPeer* peer = FindPeer(a);
if (!peer) {
- peer = new(__FILE__, __LINE__) NetPeer(a, base_netid++);
+ peer = new NetPeer(a, base_netid++);
if (peer)
peer_list.append(peer);
}
@@ -110,13 +108,13 @@ NetLink::AddPeer(const NetAddr& a)
bool
NetLink::SendMessage(DWORD nid, void* d, int l, BYTE f)
{
- return SendMessage(new(__FILE__,__LINE__) NetMsg(nid, d, l, f));
+ return SendMessage(new NetMsg(nid, d, l, f));
}
bool
NetLink::SendMessage(DWORD nid, BYTE type, const char* text, int len, BYTE f)
{
- return SendMessage(new(__FILE__,__LINE__) NetMsg(nid, type, text, len, f));
+ return SendMessage(new NetMsg(nid, type, text, len, f));
}
bool
@@ -323,7 +321,7 @@ NetLink::RecvNetGram()
packets_recv += 1;
bytes_recv += msg.length() + UDP_HEADER_SIZE;
- return new(__FILE__, __LINE__) NetGram(from, msg);
+ return new NetGram(from, msg);
}
// +--------------------------------------------------------------------+
@@ -392,7 +390,7 @@ NetLink::QueueNetGram(NetGram* gram)
sequence = peer->Sequence();
}
else {
- peer = new(__FILE__, __LINE__) NetPeer(gram->Address(), base_netid++);
+ peer = new NetPeer(gram->Address(), base_netid++);
if (peer)
peer_list.append(peer);
}
diff --git a/NetEx/NetMsg.cpp b/NetEx/NetMsg.cpp
index a63bfc0..63489d9 100644
--- a/NetEx/NetMsg.cpp
+++ b/NetEx/NetMsg.cpp
@@ -11,8 +11,6 @@
User level network message
*/
-
-#include "MemDebug.h"
#include <windows.h>
#include "NetMsg.h"
@@ -25,7 +23,7 @@ static DWORD net_msg_sequence = 1;
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];
+ data = new BYTE[len];
if (data) {
CopyMemory(data, d, len);
@@ -45,7 +43,7 @@ NetMsg::NetMsg(DWORD nid, void* d, 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];
+ data = new BYTE[len];
if (data) {
data[0] = type;
diff --git a/NetEx/NetPeer.cpp b/NetEx/NetPeer.cpp
index 4ba22a5..a324f94 100644
--- a/NetEx/NetPeer.cpp
+++ b/NetEx/NetPeer.cpp
@@ -11,8 +11,6 @@
One side of a UDP net link connection
*/
-
-#include "MemDebug.h"
#include <windows.h>
#include "NetPeer.h"
#include "NetGram.h"
@@ -105,10 +103,10 @@ NetPeer::SendMessage(NetMsg* msg)
CopyMemory(multi_part_buffer.payload, p, part_size);
p += part_size;
- part = new(__FILE__,__LINE__) NetMsg(msg->NetID(),
- &multi_part_buffer,
- header_size + part_size,
- msg->Flags());
+ part = new NetMsg(msg->NetID(),
+ &multi_part_buffer,
+ header_size + part_size,
+ msg->Flags());
if (part) {
list->append(part);
@@ -205,7 +203,7 @@ NetPeer::ComposeGram()
}
if (xmit_size > 0 && nmsg > 0) {
- BYTE* buffer = new(__FILE__,__LINE__) BYTE[xmit_size];
+ BYTE* buffer = new BYTE[xmit_size];
BYTE* p = buffer;
if (multi_msg) {
@@ -250,7 +248,7 @@ NetPeer::ComposeGram()
if (hist_indx >= HIST_SIZE)
hist_indx = 0;
- g = new(__FILE__,__LINE__) NetGram(addr, user_data, retries);
+ g = new NetGram(addr, user_data, retries);
delete[] buffer;
}
}
@@ -291,7 +289,7 @@ NetPeer::ReceiveGram(NetGram* g, List<NetMsg>* q)
if (!block_type || !block_size)
break;
- NetMsg* msg = new(__FILE__,__LINE__) NetMsg(netid, p, block_size);
+ NetMsg* msg = new NetMsg(netid, p, block_size);
if (msg) {
if (msg->Type() < NetMsg::RESERVED) {
@@ -427,7 +425,7 @@ NetPeer::CheckMultiRecv(List<NetMsg>* q)
}
}
- NetMsg* msg = new(__FILE__,__LINE__) NetMsg(netid, buffer, a->nbytes, NetMsg::RELIABLE);
+ NetMsg* msg = new NetMsg(netid, buffer, a->nbytes, NetMsg::RELIABLE);
if (msg) {
recv_list.insertSort(msg);
diff --git a/NetEx/NetServer.cpp b/NetEx/NetServer.cpp
index 8de804b..7681aa1 100644
--- a/NetEx/NetServer.cpp
+++ b/NetEx/NetServer.cpp
@@ -11,8 +11,6 @@
Network Server Pump for HTTP Server
*/
-
-#include "MemDebug.h"
#include "NetServer.h"
#include "NetHost.h"
#include "NetLayer.h"
@@ -42,9 +40,9 @@ NetServer::NetServer(WORD port, int nthreads)
if (poolsize < 1) poolsize = 1;
- pool = new(__FILE__,__LINE__) HANDLE[poolsize];
- conn = new(__FILE__,__LINE__) NetSock*[poolsize];
- clients = new(__FILE__,__LINE__) NetAddr[poolsize];
+ pool = new HANDLE[poolsize];
+ conn = new NetSock*[poolsize];
+ clients = new NetAddr[poolsize];
if (pool && conn && clients) {
ZeroMemory(pool, poolsize * sizeof(HANDLE));
diff --git a/NetEx/NetSock.cpp b/NetEx/NetSock.cpp
index 9a6f7e9..5d4f35d 100644
--- a/NetEx/NetSock.cpp
+++ b/NetEx/NetSock.cpp
@@ -15,7 +15,6 @@
// WINSOCK2.H MUST COME FIRST!!
#include <winsock2.h>
-#include "MemDebug.h"
#include "NetSock.h"
#include "NetLayer.h"
@@ -111,7 +110,7 @@ NetSock::accept(NetAddr* addr)
if (conn == INVALID_SOCKET)
return 0;
- return new(__FILE__,__LINE__) NetSock(conn, stream);
+ return new NetSock(conn, stream);
}
// +--------------------------------------------------------------------+