From fef8729179468a6cac1610e154f20b2f3c6f7035 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Tue, 29 Nov 2005 13:14:15 +0000 Subject: [PATCH] Use netinc.h git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1620 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/http/ftpclient.c | 37 +------------------------------------ engine/http/ftpserver.c | 37 +------------------------------------ engine/http/httpclient.c | 40 +--------------------------------------- engine/http/httpserver.c | 40 ++-------------------------------------- 4 files changed, 5 insertions(+), 149 deletions(-) diff --git a/engine/http/ftpclient.c b/engine/http/ftpclient.c index ce7106596..02480640c 100644 --- a/engine/http/ftpclient.c +++ b/engine/http/ftpclient.c @@ -4,42 +4,7 @@ #include "iweb.h" -#ifdef _WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EMSGSIZE WSAEMSGSIZE -#define ECONNRESET WSAECONNRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNREFUSED WSAECONNREFUSED -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL - -#define qerrno WSAGetLastError() -#else -#define qerrno errno - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifdef sun -#include -#endif - -#ifdef NeXT -#include -#endif - -#define closesocket close -#define ioctlsocket ioctl -#endif - +#include "netinc.h" typedef struct FTPclientconn_s{ char server[256]; diff --git a/engine/http/ftpserver.c b/engine/http/ftpserver.c index b84788388..8213efce1 100644 --- a/engine/http/ftpserver.c +++ b/engine/http/ftpserver.c @@ -10,42 +10,7 @@ //the later bits of the file may not arrive before the client closes the conenction. //this is a major bug and can prevent the server from giving files at a high pl/ping -#ifdef _WIN32 - -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EMSGSIZE WSAEMSGSIZE -#define ECONNRESET WSAECONNRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNREFUSED WSAECONNREFUSED -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL - -#define qerrno WSAGetLastError() -#else -#define qerrno errno - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifdef sun -#include -#endif - -#ifdef NeXT -#include -#endif - -#define closesocket close -#define ioctlsocket ioctl -#endif +#include "netinc.h" int ftpfilelistsocket; diff --git a/engine/http/httpclient.c b/engine/http/httpclient.c index cf83e5ffc..e02b2299b 100644 --- a/engine/http/httpclient.c +++ b/engine/http/httpclient.c @@ -5,49 +5,11 @@ #include "iweb.h" #ifdef _WIN32 - //msvc crap - -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EMSGSIZE WSAEMSGSIZE -#define ECONNRESET WSAECONNRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNREFUSED WSAECONNREFUSED -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL - #define snprintf _snprintf - -#define qerrno WSAGetLastError() -#else - -//gcc stuff - -#define qerrno errno - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifdef sun -#include -#endif - -#ifdef NeXT -#include -#endif - -#define closesocket close -#define ioctlsocket ioctl #endif +#include "netinc.h" /* Test files/servers.: diff --git a/engine/http/httpserver.c b/engine/http/httpserver.c index aba1f0638..07c13cb77 100644 --- a/engine/http/httpserver.c +++ b/engine/http/httpserver.c @@ -4,46 +4,10 @@ #include "iweb.h" +#include "netinc.h" + //FIXME: Before any admins use this for any serious usage, make the server send bits of file slowly. - -#ifdef _WIN32 - -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EMSGSIZE WSAEMSGSIZE -#define ECONNRESET WSAECONNRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNREFUSED WSAECONNREFUSED -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL - -#define qerrno WSAGetLastError() -#else -#define qerrno errno - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifdef sun -#include -#endif - -#ifdef NeXT -#include -#endif - -#define closesocket close -#define ioctlsocket ioctl -#endif - static qboolean httpserverinitied = false; static int httpserversocket;