diff --git a/engine/http/ftpclient.c b/engine/http/ftpclient.c index ce710659..02480640 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 b8478838..8213efce 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 cf83e5ff..e02b2299 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 aba1f063..07c13cb7 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;