summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-28 00:32:14 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-28 00:32:14 +0200
commit8790551dc182cd8804ee7d8ef89ccb31067cc2a4 (patch)
treefa411b244ae8541e49eb126a9d15a7b5a13504db /include
parent021c09faff4be2e37fa86b0fe3e61707ffddab27 (diff)
parent9b96fee72a3720e6d12812243edb4192d0790b34 (diff)
Merge insp20
Diffstat (limited to 'include')
-rw-r--r--include/modules.h5
-rw-r--r--include/socketengine.h18
2 files changed, 23 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h
index 0b91e6048..72ee2683d 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -391,6 +391,11 @@ class CoreExport Module : public classbase, public usecountbase
*/
DLLManager* ModuleDLLManager;
+ /** If true, this module will be unloaded soon, further unload attempts will fail
+ * Value is used by the ModuleManager internally, you should not modify it
+ */
+ bool dying;
+
/** Default constructor.
* Creates a module class. Don't do any type of hook registration or checks
* for other modules here; do that in init().
diff --git a/include/socketengine.h b/include/socketengine.h
index fd199c324..8e4c3dfc9 100644
--- a/include/socketengine.h
+++ b/include/socketengine.h
@@ -488,6 +488,24 @@ public:
/** Get data transfer statistics, kilobits per second in and out and total.
*/
void GetStats(float &kbitpersec_in, float &kbitpersec_out, float &kbitpersec_total);
+
+ /** Should we ignore the error in errno?
+ * Checks EAGAIN and WSAEWOULDBLOCK
+ */
+ static bool IgnoreError();
};
+inline bool SocketEngine::IgnoreError()
+{
+ if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
+ return true;
+
+#ifdef _WIN32
+ if (WSAGetLastError() == WSAEWOULDBLOCK)
+ return true;
+#endif
+
+ return false;
+}
+
SocketEngine* CreateSocketEngine();