aboutsummaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Set errno to EINPROGRESS on Windows when the connect() call does not ↵Gravatar attilamolnar2012-09-131-1/+6
| | | | | | | complete immediately, to simulate unix behavior This makes code that checks errno to determine whether connect() has succeeded or not work properly on Windows Fixes #298 reported by @butaman
* Count the actual number of sent/received bytes in SocketEngine instead of ↵Gravatar attilamolnar2012-05-231-8/+16
| | | | the buffer size passed to the send/receive functions
* Replace copyright headers with headers granting specific authors copyrightGravatar Robby-2012-04-191-8/+18
|
* Fix possible uninit memory access detected by valgrindGravatar danieldg2010-02-011-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12346 e03df62e-2008-0410-955e-edbf42e46eb7
* ...because every now and again, i have to do a massive commit.Gravatar brain2010-01-111-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
* Get rid of socklen_t parameter to Bind, we are using C++ here and can do it ↵Gravatar danieldg2009-11-131-2/+2
| | | | | | other ways git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12129 e03df62e-2008-0410-955e-edbf42e46eb7
* Get rid of OpenTCPSocketGravatar danieldg2009-10-241-2/+8
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11969 e03df62e-2008-0410-955e-edbf42e46eb7
* Compile fixes, these too take char* on windows and not void*.Gravatar peavey2009-10-101-4/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11826 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove include/inspircd_se_config.h and socketengine-specific headersGravatar danieldg2009-09-301-28/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11784 e03df62e-2008-0410-955e-edbf42e46eb7
* Clean up SocketEngine interface to allow edge-triggered I/O and sockets that ↵Gravatar danieldg2009-09-261-15/+49
| | | | | | do not force readability. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11760 e03df62e-2008-0410-955e-edbf42e46eb7
* Create StreamSocket for IO hooking implementationGravatar danieldg2009-09-211-59/+2
| | | | | | | | | | | | | | Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
* ThreadWindows: Remove ThreadSignalListener and connect the socket right awayGravatar danieldg2009-09-021-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11617 e03df62e-2008-0410-955e-edbf42e46eb7
* Cast rework: use C++ style static_cast<> instead of C-style castsGravatar danieldg2009-09-021-4/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11595 e03df62e-2008-0410-955e-edbf42e46eb7
* Update all wiki links to point to the new wiki. This was done automatically ↵Gravatar psychon2009-03-151-1/+1
| | | | | | | | | with the following command, only .Makefile.inc got some indent fixups by hand. for file in $(find -type f -and -not -path '*/.svn/*' -and -not -name '*.so') ; do sed -e 's#http://www.inspircd.org/wiki#http://wiki.inspircd.org#' -e 's#http://wiki.inspircd.org/index.php/#http://wiki.inspircd.org/#' -i $file ; done git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11223 e03df62e-2008-0410-955e-edbf42e46eb7
* Nuke trailing spacesGravatar peavey2009-02-141-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11105 e03df62e-2008-0410-955e-edbf42e46eb7
* Update copyrights for 2009.Gravatar w00t2009-01-021-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10932 e03df62e-2008-0410-955e-edbf42e46eb7
* Second attempt at time() -> SI->Time(), now problems with the original were ↵Gravatar w00t2008-11-011-3/+3
| | | | | | | | | fixed. (SI::TIME was not initialised). Thanks Namegduf! (Please test, all, valdebug etc, report odd behaviour/warnings!) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10783 e03df62e-2008-0410-955e-edbf42e46eb7
* Revert earlier time() -> SI->Time() diff for now, this causes problems with ↵Gravatar w00t2008-10-231-3/+3
| | | | | | dns.cpp in mysterious ways.. seemingly a bad pointer there somehow..? git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10695 e03df62e-2008-0410-955e-edbf42e46eb7
* Patch from Namegduf converting all instances (where possible) of time() -> ↵Gravatar w00t2008-10-231-3/+3
| | | | | | ServerInstance->Time(). Thanks! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10691 e03df62e-2008-0410-955e-edbf42e46eb7
* Initialising the member we added might be an idea.Gravatar w00t2008-09-071-1/+6
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10456 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix a stupid error, and two warnings.Gravatar w00t2008-09-071-1/+3
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10450 e03df62e-2008-0410-955e-edbf42e46eb7
* Start moving IO hooking from being bufferedsocket based to residing in ↵Gravatar w00t2008-09-071-0/+21
| | | | | | EventHandler, this will pave the way for a generic listener type, and also simplifies a lot of code. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10447 e03df62e-2008-0410-955e-edbf42e46eb7
* Add poll to build system if kqueue/epoll/ports are not used, above select.Gravatar w00t2008-08-251-0/+6
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10267 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove last vestige of libircdfoo, by changing tag into a single ↵Gravatar w00t2008-07-291-1/+1
| | | | | | identifier marking object as requiring compilation into a .o (minor commit) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10076 e03df62e-2008-0410-955e-edbf42e46eb7
* Properly clear the bandwidth measurementsGravatar brain2008-06-181-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9923 e03df62e-2008-0410-955e-edbf42e46eb7
* another fix just to piss off people who are trying to build every svn revisionGravatar brain2008-06-181-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9920 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix typoGravatar brain2008-06-181-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9919 e03df62e-2008-0410-955e-edbf42e46eb7
* Measure bandwidth statistics from the socket engine (kiloBITS per second in, ↵Gravatar brain2008-06-181-0/+25
| | | | | | out, total) and display them in /stats z plus send them via the named pipe to the windows gui git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9918 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix the problems GreenReaper found with the windows select engine, this has ↵Gravatar brain2008-04-151-14/+19
| | | | | | never worked properly in trunk! -- This needs tidying up, its on my todo either tonight if im awake enough, or tomorrow evening git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9514 e03df62e-2008-0410-955e-edbf42e46eb7
* Automatic detection and allocation of max fds. No longer needs recompile to ↵Gravatar brain2008-04-021-1/+0
| | | | | | | | | change, just adjust it in your kernel or whatever and restart insp. Please note that select and iocp socket engines do not support detection and are always set to FD_SETSIZE and 10240 descriptors respectively. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9263 e03df62e-2008-0410-955e-edbf42e46eb7
* Keep count of the number of events in total, and seperate read, write and ↵Gravatar brain2008-02-141-0/+1
| | | | | | error event counters. We can use this for monitoring of heavy socket engine activity, e.g. a 'stuck' eventhandler git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8933 e03df62e-2008-0410-955e-edbf42e46eb7
* Header update: 2007 -> 2008Gravatar w00t2008-01-101-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8694 e03df62e-2008-0410-955e-edbf42e46eb7
* Move socketengines into their own dir. This was all w00t's idea, but i told ↵Gravatar brain2007-10-231-4/+4
| | | | | | him no because i didnt think it would work. Now ive done it myself :P ner ner ne ner ner :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8332 e03df62e-2008-0410-955e-edbf42e46eb7
* Conditionals in the buildsystem language allowing for checking of configure ↵Gravatar brain2007-10-221-0/+19
| | | | | | | | | | | | | flags: /* $If: USE_KQUEUE */ /* $ExtraSources: socketengine_kqueue.cpp */ /* $ExtraObjects: socketengine_kqueue.o */ /* $EndIf */ This is used exactly where the example dictates: to pick a socket engine from the socketengine.cpp. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8308 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove the need for a bunch of the hard coded arrays/hashes by scanning the ↵Gravatar brain2007-10-221-0/+2
| | | | | | src/ dir for tag comments, like in modules git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8307 e03df62e-2008-0410-955e-edbf42e46eb7
* * Fixed some incorrect declarations in IOCPEngineGravatar burlex2007-09-041-26/+37
| | | | | | | | | | * Fixed the virtual socket wrapper functions in IOCPEngine {these should really be inlined on unix} * Fixed several compilation issues under Win32 * Fixed calls to close() which should've been changed to SE->Close() + Added a crashdump saving system to Win32 builds. Dumps are saved in the format of dump-<exename>-<year>-<month>-<day>-<hour>-<minute>-<second>.dmp in the working directory. Enabled by default, undefine ENABLE_CRASHDUMPS to disable. + Added m_operflood, this is a module I've had lying around for some time but some users may like it as it allows unreal-like behaviour without increasing flood limits for non-opers. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8015 e03df62e-2008-0410-955e-edbf42e46eb7
* Craquity craq De-craq!Gravatar brain2007-08-231-1/+85
| | | | | | | | | | 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
* This is now correct.Gravatar brain2007-08-151-14/+0
| | | | | | | | No win32 #ifdefs in the base class, being as IOCPEngine is only built on windows we can put the code here without the need for ifdef. The original check in socketengine_iocp was broken, copied burlex's fixed version into the child class git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7724 e03df62e-2008-0410-955e-edbf42e46eb7
* * include/caller.h will now compile correctly on Windows platforms.Gravatar burlex2007-08-151-0/+14
| | | | | | | | + Implemented gettimeofday in win32 wrapper, link rtt's will now display in milliseconds. * SocketEngine::BoundsCheckFd will now handle Windows event handler cases correctly. (fixing writing to sockets not working) * Fixed VC71 project. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7723 e03df62e-2008-0410-955e-edbf42e46eb7
* Some smart tricks to eliminate win32 ifdefs that are creeping into portable ↵Gravatar brain2007-07-271-0/+9
| | | | | | files git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7589 e03df62e-2008-0410-955e-edbf42e46eb7
* OOPS! We try again, since I'm smoking craq. LF is 0x0a NOT CR.Gravatar peavey2007-07-161-1/+93
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7456 e03df62e-2008-0410-955e-edbf42e46eb7
* 'svn propset -R svn:eol-style CR *' Set to UNIX-style always. Binaries are ↵Gravatar peavey2007-07-161-93/+1
| | | | | | auto skipped by svn. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7454 e03df62e-2008-0410-955e-edbf42e46eb7
* Windows support. Tested and working to compile on freebsd and linux. Next ↵Gravatar w00t2007-05-191-1/+1
| | | | | | step is to make sure it actually works in windows too. ;p. Add Burlex to contributors. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7043 e03df62e-2008-0410-955e-edbf42e46eb7
* pgsql should now work thx to added posibility to force a fd out of the ↵Gravatar peavey2007-01-111-1/+1
| | | | | | socketengine. This should only be used as a *last resort* when dealing with 3rd party libs that invalidates a file descriptor beyond your control. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6295 e03df62e-2008-0410-955e-edbf42e46eb7
* Jesus, look who's the commit whore today. More header updates, and removal ↵Gravatar w00t2006-12-151-5/+2
| | | | | | of namespacing. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5996 e03df62e-2008-0410-955e-edbf42e46eb7
* WARNING: This commit breaks kqueue and select -- work in progress!Gravatar brain2006-10-301-0/+4
| | | | | | | epoll now allows both a write and a read event on a socket at the same time. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5580 e03df62e-2008-0410-955e-edbf42e46eb7
* Wahhhhhhhhhhhh bwahahaha. Mass commit to tidy up tons of messy include listsGravatar brain2006-08-301-3/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5080 e03df62e-2008-0410-955e-edbf42e46eb7
* Get rid of SocketEngine::Wait and array-copy, change to ↵Gravatar brain2006-08-181-1/+1
| | | | | | SocketEngine::DispatchEvents git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4944 e03df62e-2008-0410-955e-edbf42e46eb7
* EventHandler class, an abstraction for raw i/oGravatar brain2006-08-181-21/+30
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4941 e03df62e-2008-0410-955e-edbf42e46eb7
* So i wonder why we've not had this problem soonerGravatar brain2006-08-121-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4914 e03df62e-2008-0410-955e-edbf42e46eb7