diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-23 22:06:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-23 22:06:04 +0000 |
commit | d0d36795e807cf72295c6e73813e0c2daa0a71e7 (patch) | |
tree | 09ae4d94ed7b6f3038d2579037fd2c7ee93a6657 /src/users.cpp | |
parent | 61816ef0dd848225e9ec1c21c3c7a3bc03a34da9 (diff) |
Craquity craq De-craq!
This is probably broken on windows, do not attempt to use there yet unless you like broken stuff. Cant say for sure as i havent even tried to build yet and most likely wont tonight.
--- Abstract most of the berkely socket API out into SocketEngine derived classes. SocketEngine base class implements standard berkely sockets that 'real mens systems' like linux
and freebsd have. For socketengine_iocp we implement the windows specific nonesense like the special things needed for udp and accept (ick).
All this to eliminate a bunch of ifdefs.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7810 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/users.cpp b/src/users.cpp index 4854849ad..ccf506697 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -436,8 +436,8 @@ char* userrec::MakeHostIP() void userrec::CloseSocket() { - shutdown(this->fd,2); - close(this->fd); + ServerInstance->SE->Shutdown(this, 2); + ServerInstance->SE->Close(this); } char* userrec::GetFullHost() @@ -727,11 +727,8 @@ void userrec::FlushWriteBuf() if ((sendq.length()) && (this->fd != FD_MAGIC_NUMBER)) { int old_sendq_length = sendq.length(); -#ifndef WIN32 - int n_sent = write(this->fd, this->sendq.data(), this->sendq.length()); -#else - int n_sent = send(this->fd, (const char*)this->sendq.data(), this->sendq.length(), 0); -#endif + int n_sent = ServerInstance->SE->Send(this, this->sendq.data(), this->sendq.length(), 0); + if (n_sent == -1) { if (errno == EAGAIN) |