Commit cbf96873 authored by Marko Mikulicic's avatar Marko Mikulicic

Fix MG_SEND_FUNC/MG_RECV_FUNC rename fail

    PUBLISHED_FROM=da28a75111abb5fb49b122133a66ae9bdf63f474
parent 57b35e60
......@@ -2534,7 +2534,7 @@ static void mg_read_from_socket(struct mg_connection *conn) {
}
} else
#endif
while ((n = (int) MG_EV_RECV_FUNC(
while ((n = (int) MG_RECV_FUNC(
conn->sock, buf, recv_avail_size(conn, sizeof(buf)), 0)) > 0) {
DBG(("%p %d bytes (PLAIN) <- %d", conn, n, conn->sock));
mbuf_append(&conn->recv_mbuf, buf, n);
......@@ -2581,7 +2581,7 @@ static void mg_write_to_socket(struct mg_connection *conn) {
} else
#endif
{
n = (int) MG_EV_SEND_FUNC(conn->sock, io->buf, io->len, 0);
n = (int) MG_SEND_FUNC(conn->sock, io->buf, io->len, 0);
}
DBG(("%p %d bytes -> %d", conn, n, conn->sock));
......@@ -2706,8 +2706,8 @@ static void mg_mgr_handle_connection(struct mg_connection *nc, int fd_flags,
static void mg_mgr_handle_ctl_sock(struct mg_mgr *mgr) {
struct ctl_msg ctl_msg;
int len =
(int) MG_EV_RECV_FUNC(mgr->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0);
MG_EV_SEND_FUNC(mgr->ctl[1], ctl_msg.message, 1, 0);
(int) MG_RECV_FUNC(mgr->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0);
MG_SEND_FUNC(mgr->ctl[1], ctl_msg.message, 1, 0);
if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) {
struct mg_connection *nc;
for (nc = mg_next(mgr, NULL); nc != NULL; nc = mg_next(mgr, nc)) {
......@@ -3187,9 +3187,9 @@ void mg_broadcast(struct mg_mgr *mgr, mg_event_handler_t cb, void *data,
len < sizeof(ctl_msg.message)) {
ctl_msg.callback = cb;
memcpy(ctl_msg.message, data, len);
MG_EV_SEND_FUNC(mgr->ctl[0], (char *) &ctl_msg,
MG_SEND_FUNC(mgr->ctl[0], (char *) &ctl_msg,
offsetof(struct ctl_msg, message) + len, 0);
MG_EV_RECV_FUNC(mgr->ctl[0], (char *) &len, 1, 0);
MG_RECV_FUNC(mgr->ctl[0], (char *) &len, 1, 0);
}
}
......
......@@ -605,11 +605,11 @@ typedef void *SSL_CTX;
#endif
#ifdef MG_USE_READ_WRITE
#define MG_EV_RECV_FUNC(s, b, l, f) read(s, b, l)
#define MG_EV_SEND_FUNC(s, b, l, f) write(s, b, l)
#define MG_RECV_FUNC(s, b, l, f) read(s, b, l)
#define MG_SEND_FUNC(s, b, l, f) write(s, b, l)
#else
#define MG_EV_RECV_FUNC(s, b, l, f) recv(s, b, l, f)
#define MG_EV_SEND_FUNC(s, b, l, f) send(s, b, l, f)
#define MG_RECV_FUNC(s, b, l, f) recv(s, b, l, f)
#define MG_SEND_FUNC(s, b, l, f) send(s, b, l, f)
#endif
#ifdef __cplusplus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment