numam-spdk/lib/jsonrpc
Daniel Verkamp cc7407947b jsonrpc: avoid calling poll() with a closed fd
If a connection is closed by the remote end, the JSON-RPC server could
potentially call poll() on the pollfd containing the invalid file
descriptor.  Rework the logic so that the pollfd's fd field is set to a
negative value so that poll() will ignore it until the connection is
fully cleaned up by spdk_jsonrpc_server_conn_remove().

Also add handling for the potential error conditions returned by poll()
so that if something does go wrong, the server doesn't get stuck polling
a broken pollfd forever.

Change-Id: Id02e3a230740c8ffd513888cb0564891b3aca069
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369285
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 17:43:22 -04:00
..
jsonrpc_internal.h jsonrpc: avoid calling poll() with a closed fd 2017-07-12 17:43:22 -04:00
jsonrpc_server_tcp.c jsonrpc: avoid calling poll() with a closed fd 2017-07-12 17:43:22 -04:00
jsonrpc_server.c jsonrpc: allow asynchronous request completion 2017-07-12 12:10:31 -04:00
Makefile build: include spdk.common.mk in lib Makefiles 2016-07-18 16:17:40 -07:00