struct MBuf *mbuf);
/* for some reason, libevent has no typedef for callback */
-typedef void (*sbuf_libevent_cb)(int, short, void *);
+typedef void (*sbuf_libevent_cb)(evutil_socket_t, short, void *);
struct SBufIO {
int (*sbufio_recv)(SBuf *sbuf, void *buf, unsigned int len);
req->zone = z;
}
-static void zone_timer(int fd, short flg, void *arg)
+static void zone_timer(evutil_socket_t fd, short flg, void *arg)
{
struct DNSContext *ctx = arg;
struct List *el;
}
/* full-scale maintenance, done only occasionally */
-static void do_full_maint(int sock, short flags, void *arg)
+static void do_full_maint(evutil_socket_t sock, short flags, void *arg)
{
struct List *item, *tmp;
PgPool *pool;
static struct event ev_sigterm;
static struct event ev_sigint;
-static void handle_sigterm(int sock, short flags, void *arg)
+static void handle_sigterm(evutil_socket_t sock, short flags, void *arg)
{
log_info("got SIGTERM, fast exit");
/* pidfile cleanup happens via atexit() */
exit(1);
}
-static void handle_sigint(int sock, short flags, void *arg)
+static void handle_sigint(evutil_socket_t sock, short flags, void *arg)
{
log_info("got SIGINT, shutting down");
if (cf_reboot)
return res == amount;
}
-static void pktbuf_send_func(int fd, short flags, void *arg)
+static void pktbuf_send_func(evutil_socket_t fd, short flags, void *arg)
{
PktBuf *buf = arg;
SBuf *sbuf = &buf->queued_dst->sbuf;
int amount, res;
- log_debug("pktbuf_send_func(%d, %d, %p)", fd, (int)flags, buf);
+ log_debug("pktbuf_send_func(%" PRId64 ", %d, %p)", (int64_t)fd, (int)flags, buf);
if (buf->failed)
return;
}
}
-static void err_wait_func(int sock, short flags, void *arg)
+static void err_wait_func(evutil_socket_t sock, short flags, void *arg)
{
if (cf_pause_mode != P_SUSPEND)
resume_pooler();
}
/* got new connection, associate it with client struct */
-static void pool_accept(int sock, short flags, void *arg)
+static void pool_accept(evutil_socket_t sock, short flags, void *arg)
{
struct ListenSocket *ls = arg;
int fd;
static bool sbuf_queue_send(SBuf *sbuf) _MUSTCHECK;
static bool sbuf_send_pending(SBuf *sbuf) _MUSTCHECK;
static bool sbuf_process_pending(SBuf *sbuf) _MUSTCHECK;
-static void sbuf_connect_cb(int sock, short flags, void *arg);
-static void sbuf_recv_cb(int sock, short flags, void *arg);
-static void sbuf_send_cb(int sock, short flags, void *arg);
+static void sbuf_connect_cb(evutil_socket_t sock, short flags, void *arg);
+static void sbuf_recv_cb(evutil_socket_t sock, short flags, void *arg);
+static void sbuf_send_cb(evutil_socket_t sock, short flags, void *arg);
static void sbuf_try_resync(SBuf *sbuf, bool release);
static bool sbuf_wait_for_data(SBuf *sbuf) _MUSTCHECK;
static void sbuf_main_loop(SBuf *sbuf, bool skip_recv);
tls_sbufio_send,
tls_sbufio_close
};
-static void sbuf_tls_handshake_cb(int fd, short flags, void *_sbuf);
+static void sbuf_tls_handshake_cb(evutil_socket_t fd, short flags, void *_sbuf);
#endif
/*********************************
return true;
}
-static void sbuf_recv_forced_cb(int sock, short flags, void *arg)
+static void sbuf_recv_forced_cb(evutil_socket_t sock, short flags, void *arg)
{
SBuf *sbuf = arg;
}
/* libevent EV_WRITE: called when dest socket is writable again */
-static void sbuf_send_cb(int sock, short flags, void *arg)
+static void sbuf_send_cb(evutil_socket_t sock, short flags, void *arg)
{
SBuf *sbuf = arg;
bool res;
}
/* callback for libevent EV_READ */
-static void sbuf_recv_cb(int sock, short flags, void *arg)
+static void sbuf_recv_cb(evutil_socket_t sock, short flags, void *arg)
{
SBuf *sbuf = arg;
sbuf_main_loop(sbuf, DO_RECV);
}
/* callback for libevent EV_WRITE when connecting */
-static void sbuf_connect_cb(int sock, short flags, void *arg)
+static void sbuf_connect_cb(evutil_socket_t sock, short flags, void *arg)
{
SBuf *sbuf = arg;
}
}
-static void sbuf_tls_handshake_cb(int fd, short flags, void *_sbuf)
+static void sbuf_tls_handshake_cb(evutil_socket_t fd, short flags, void *_sbuf)
{
SBuf *sbuf = _sbuf;
sbuf->wait_type = W_NONE;
return true;
}
-static void refresh_stats(int s, short flags, void *arg)
+static void refresh_stats(evutil_socket_t s, short flags, void *arg)
{
struct List *item;
PgPool *pool;
*
* use always recvmsg, to keep code simpler
*/
-static void takeover_recv_cb(int sock, short flags, void *arg)
+static void takeover_recv_cb(evutil_socket_t sock, short flags, void *arg)
{
PgSocket *bouncer = container_of(arg, PgSocket, sbuf);
uint8_t data_buf[STARTUP_BUF * 2];