summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dns.h2
-rw-r--r--include/inspircd.h2
-rw-r--r--include/inspsocket.h2
-rw-r--r--include/socket.h2
-rw-r--r--include/socketengine.h8
-rw-r--r--include/users.h2
6 files changed, 11 insertions, 7 deletions
diff --git a/include/dns.h b/include/dns.h
index b011a9ddb..79b286233 100644
--- a/include/dns.h
+++ b/include/dns.h
@@ -330,7 +330,7 @@ class DNS : public EventHandler
* Handle a SocketEngine read event
* Inherited from EventHandler
*/
- void HandleEvent(EventType et);
+ void HandleEvent(EventType et, int errornum = 0);
/**
* Add a Resolver* to the list of active classes
diff --git a/include/inspircd.h b/include/inspircd.h
index 3a752e21c..014f729b0 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -172,7 +172,7 @@ class FileLogger : public EventHandler
* another write event is scheduled to write
* the rest of the data when possible.
*/
- virtual void HandleEvent(EventType et);
+ virtual void HandleEvent(EventType et, int errornum = 0);
/** Write one or more preformatted log lines.
* If the data cannot be written immediately,
* this class will insert itself into the
diff --git a/include/inspsocket.h b/include/inspsocket.h
index af92615ea..71f16951e 100644
--- a/include/inspsocket.h
+++ b/include/inspsocket.h
@@ -365,7 +365,7 @@ class InspSocket : public EventHandler
*/
void MarkAsClosed();
- void HandleEvent(EventType et);
+ void HandleEvent(EventType et, int errornum = 0);
bool Readable();
};
diff --git a/include/socket.h b/include/socket.h
index f868daf92..6264b196f 100644
--- a/include/socket.h
+++ b/include/socket.h
@@ -154,7 +154,7 @@ class ListenSocket : public EventHandler
ListenSocket(InspIRCd* Instance, int sockfd, irc::sockets::insp_sockaddr client, irc::sockets::insp_sockaddr server, int port, char* addr);
/** Handle an I/O event
*/
- void HandleEvent(EventType et);
+ void HandleEvent(EventType et, int errornum = 0);
};
#endif
diff --git a/include/socketengine.h b/include/socketengine.h
index a4628b648..9b3cdec64 100644
--- a/include/socketengine.h
+++ b/include/socketengine.h
@@ -26,11 +26,15 @@
/** Types of event an EventHandler may receive.
* EVENT_READ is a readable file descriptor,
* and EVENT_WRITE is a writeable file descriptor.
+ * EVENT_ERROR can always occur, and indicates
+ * a write error or read error on the socket,
+ * e.g. EOF condition or broken pipe.
*/
enum EventType
{
EVENT_READ = 0,
- EVENT_WRITE = 1
+ EVENT_WRITE = 1,
+ EVENT_ERROR = 2
};
class InspIRCd;
@@ -127,7 +131,7 @@ class EventHandler : public Extensible
* @param et either one of EVENT_READ for read events,
* and EVENT_WRITE for write events.
*/
- virtual void HandleEvent(EventType et) = 0;
+ virtual void HandleEvent(EventType et, int errornum = 0) = 0;
};
/** Provides basic file-descriptor-based I/O support.
diff --git a/include/users.h b/include/users.h
index 1dc0aa43e..536f37a80 100644
--- a/include/users.h
+++ b/include/users.h
@@ -767,7 +767,7 @@ class userrec : public connection
/** Handle socket event.
* From EventHandler class.
*/
- void HandleEvent(EventType et);
+ void HandleEvent(EventType et, int errornum = 0);
/** Default destructor
*/