122a7763 | 13-Dec-2018 |
Pawel Wodkowski <pawelx.wodkowski@intel.com> |
jsonrpc: process all requests in buffer
If more than one full request is received by a single recv() call only first one will be parsed. Then next time we call recv() is called it will return EAGAIN
jsonrpc: process all requests in buffer
If more than one full request is received by a single recv() call only first one will be parsed. Then next time we call recv() is called it will return EAGAIN and next request won't be parsed. Fix this by always parsing all requests in the buffer.
Change-Id: I0a2c72fd0ad6184834b9831bda520a28ab815f0d Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/437161 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
show more ...
|
63978010 | 13-Dec-2018 |
Pawel Wodkowski <pawelx.wodkowski@intel.com> |
jsonrpc: fix received JSON buffer overwrite
The receive buffer and JSON values array are shared across all requests on one connection. If RPC handlers deferre processing response, do the lazy decode
jsonrpc: fix received JSON buffer overwrite
The receive buffer and JSON values array are shared across all requests on one connection. If RPC handlers deferre processing response, do the lazy decode or capture JSON by pointer instead of copying it then content of the request array might be overwritten by now. As we don't have any requirement here we must assert that the received request is valid till response is finished.
Fix this issue by copying request data and work on the copy. This change also void the need of having JSON RPC 'id' field releasing over 128 bytes from each spdk_jsonrpc_request.
Change-Id: I665be446cbcd8f625e5a73514582efad3021a4ff Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/437160 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
show more ...
|
4734811d | 18-Oct-2018 |
Pawel Wodkowski <pawelx.wodkowski@intel.com> |
jsonrpc client: move around functions so no forwad declaration is needed
Change-Id: Ie3cdf0fa51c9a373cb7d98e26dfab6a5d45c6005 Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on
jsonrpc client: move around functions so no forwad declaration is needed
Change-Id: Ie3cdf0fa51c9a373cb7d98e26dfab6a5d45c6005 Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/429911 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
show more ...
|
961a286a | 12-Oct-2018 |
Pawel Wodkowski <pawelx.wodkowski@intel.com> |
jsonrpc: simplify parsing client response
Capture json version by reference so we don't need to call free() in parse_single_response.
Change-Id: Ia97fa484ca9ff8692a15160878b625b57d7f4b9e Signed-off
jsonrpc: simplify parsing client response
Capture json version by reference so we don't need to call free() in parse_single_response.
Change-Id: Ia97fa484ca9ff8692a15160878b625b57d7f4b9e Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/429261 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
show more ...
|