From 8a3853fa028c85fb28e1d84432d8455ab60ad7ca Mon Sep 17 00:00:00 2001 From: Geoff Gustafson Date: Wed, 30 Aug 2017 10:50:26 -0700 Subject: [PATCH] [net] Stop sending error for remote socket closure It's not an error that the other side closed the socket. Signed-off-by: Geoff Gustafson --- src/zjs_net.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/zjs_net.c b/src/zjs_net.c index 8f5ff1447..289010c5e 100644 --- a/src/zjs_net.c +++ b/src/zjs_net.c @@ -272,14 +272,12 @@ static void handle_wbuf_arg(void *h, jerry_value_t argv[], u32_t *argc, } enum { - ERROR_READ_SOCKET_CLOSED, ERROR_WRITE_SOCKET, ERROR_ACCEPT_SERVER, ERROR_CONNECT_SOCKET, }; static const char *error_messages[] = { - "socket has been closed", "error writing to socket", "error listening to accepted connection", "failed to make connection", @@ -335,9 +333,6 @@ static void tcp_received(struct net_context *context, // this means the socket closed properly DBG_PRINT("closing socket, context=%p, socket=%u\n", context, handle->socket); - error_desc_t desc = create_error_desc(ERROR_READ_SOCKET_CLOSED, 0, 0); - zjs_defer_emit_event(handle->socket, "error", &desc, sizeof(desc), - handle_error_arg, zjs_release_args); // note: we're not really releasing anything but release_close will // just ignore the 0 args and this way we don't need a new function