aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-12-05 01:48:44 -0500
committerDeterminant <ted.sybil@gmail.com>2019-12-05 01:48:44 -0500
commit6225a46eb219fd63b3a11c1805d08c217188e94d (patch)
tree94f5d7b084220a9706999ea6b48713aaaf16e690 /src
parent4fd25c23a5b2bd3ccedfe756c6f05d0bd9d3e0ca (diff)
WIP: OSX(macOS) support
Diffstat (limited to 'src')
-rw-r--r--src/conn.cpp12
-rw-r--r--src/event.cpp4
2 files changed, 14 insertions, 2 deletions
diff --git a/src/conn.cpp b/src/conn.cpp
index dab10dc..311b1f8 100644
--- a/src/conn.cpp
+++ b/src/conn.cpp
@@ -33,6 +33,14 @@
#include "salticidae/util.h"
#include "salticidae/conn.h"
+#if !defined(SOL_TCP) && defined(IPPROTO_TCP)
+#define SOL_TCP IPPROTO_TCP
+#endif
+
+#if !defined(TCP_KEEPIDLE) && defined(TCP_KEEPALIVE)
+#define TCP_KEEPIDLE TCP_KEEPALIVE
+#endif
+
namespace salticidae {
ConnPool::Conn::operator std::string() const {
@@ -64,7 +72,7 @@ void ConnPool::Conn::_send_data(const conn_t &conn, int fd, int events) {
bytearray_t buff_seg = conn->send_buffer.move_pop();
ssize_t size = buff_seg.size();
if (!size) break;
- ret = send(fd, buff_seg.data(), size, MSG_NOSIGNAL);
+ ret = send(fd, buff_seg.data(), size, 0);
SALTICIDAE_LOG_DEBUG("socket sent %zd bytes", ret);
size -= ret;
if (size > 0)
@@ -330,7 +338,7 @@ void ConnPool::accept_client(int fd, int) {
void ConnPool::conn_server(const conn_t &conn, int fd, int events) {
try {
- if (send(fd, "", 0, MSG_NOSIGNAL) == 0)
+ if (send(fd, "", 0, 0) == 0)
{
conn->ev_connect.del();
SALTICIDAE_LOG_INFO("connected to remote %s", std::string(*conn).c_str());
diff --git a/src/event.cpp b/src/event.cpp
index 18aca18..16a3c41 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -2,6 +2,10 @@
#ifdef SALTICIDAE_CBINDINGS
#include "salticidae/event.h"
+#if defined(__linux__)
+const uint64_t salticidae::NotifyFd::dummy = 1;
+#endif
+
extern "C" {
eventcontext_t *eventcontext_new() { return new eventcontext_t(); }