Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
[net] Stop sending error for remote socket closure
Browse files Browse the repository at this point in the history
It's not an error that the other side closed the socket.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
  • Loading branch information
grgustaf committed Aug 31, 2017
1 parent 27a2c57 commit 8a3853f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/zjs_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8a3853f

Please sign in to comment.