-
-struct afb_websock
-{
- int fd;
- struct MHD_Connection *connection;
- struct websock *ws;
-};
-
-static ssize_t afb_websock_writev(struct afb_websock *ws, const struct iovec *iov, int iovcnt)
-{
- ssize_t rc;
- do {
- rc = writev(ws->fd, iov, iovcnt);
- } while(rc == -1 && errno == EINTR);
- return rc;
-}
-
-static ssize_t afb_websock_readv(struct afb_websock *ws, const struct iovec *iov, int iovcnt)
-{
- ssize_t rc;
- do {
- rc = readv(ws->fd, iov, iovcnt);
- } while(rc == -1 && errno == EINTR);
- return rc;
-}
-
-static void afb_websock_disconnect(struct afb_websock *ws)
-{
-}
-
-static void afb_websock_on_close(struct afb_websock *ws, uint16_t code, size_t size)
-{
-}
-
-static void afb_websock_on_content(struct afb_websock *ws, int last, size_t size)
-{
-}
-
-static struct websock_itf afb_websock_itf = {
- .writev = (void*)afb_websock_writev,
- .readv = (void*)afb_websock_readv,
- .disconnect = (void*)afb_websock_disconnect,
-
- .on_ping = NULL,
- .on_pong = NULL,
- .on_close = (void*)afb_websock_on_close,
- .on_text = (void*)afb_websock_on_content,
- .on_binary = (void*)afb_websock_on_content,
- .on_continue = (void*)afb_websock_on_content
-};
-