From 170820cc8d09064742b6c2d3d716abac457cd880 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 12 Oct 2009 01:13:51 +0000 Subject: Define DISABLE_WRITEV and use the IOHook single-copy method for Windows send() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11848 e03df62e-2008-0410-955e-edbf42e46eb7 --- win/inspircd_win32wrapper.cpp | 24 ------------------------ win/inspircd_win32wrapper.h | 9 +-------- 2 files changed, 1 insertion(+), 32 deletions(-) (limited to 'win') diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index eb73378f2..1309e6064 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -147,30 +147,6 @@ const char * dlerror() return errormessage; } -ssize_t writev(int fd, const struct iovec* iov, int iovcnt) -{ - ssize_t ret; - size_t tot = 0; - int i; - char *buf, *p; - - for(i = 0; i < iovcnt; ++i) - tot += iov[i].iov_len; - buf = (char*)malloc(tot); - if (tot != 0 && buf == NULL) { - errno = ENOMEM; - return -1; - } - p = buf; - for (i = 0; i < iovcnt; ++i) { - memcpy (p, iov[i].iov_base, iov[i].iov_len); - p += iov[i].iov_len; - } - ret = send((SOCKET)fd, buf, tot, 0); - free (buf); - return ret; -} - #define TRED FOREGROUND_RED | FOREGROUND_INTENSITY #define TGREEN FOREGROUND_GREEN | FOREGROUND_INTENSITY #define TYELLOW FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index 4b9ce80ec..740436d93 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -229,14 +229,7 @@ class ServerConfig; /* Look up the nameserver in use from the registry on windows */ CoreExport std::string FindNameServerWin(); -/* no uio.h on win, but win has alternatives in io.h rest is wrapped here */ -#define IOV_MAX 1024 -struct iovec -{ - size_t iov_len; - void* iov_base; -}; -CoreExport ssize_t writev(int fd, const struct iovec* iov, int iovcnt); +#define DISABLE_WRITEV /* Clear a windows console */ CoreExport void ClearConsole(); -- cgit v1.2.3