Hi.
I investigate to use cxxtools as simple json-rpc client.
Unfortunately I discovered (v2.2.1) that rpcaddclient demo does not check
"id" number in
server's response.
Eg.
* request contains "id":1
* response {"jsonrpc":"2.0","result":"10","id":100}
The client accepts "id" number despite it is different from "id" in the
request. Exception should be thrown or "id" should be possible to read.
I guess src/json/responder.cpp Responder::finalize() is responsible code.
The second "id" issue is that "id" is always increased in rpcclientimpl.cpp
in RpcClientImpl::prepareRequest(). In my opinion prepareRequest() should
not be called by beginCall and call() always.
Let's imagine the case:
- request is sent by client
- request is received by server and RPC procedure is called
- response is sent by server
- connection is broken (eg. WIFI or GPRS TCP disconnection)
- server confirmed the request but client didn't received the response
- client gets timeout or disconnection error
- client connects again to server
- client sends the same request again with the same "id" (prepareRequest
omited for the same "id" and serializer/formatter speed up)
- server sends previous response again without calling RPC procedure (last
"id" saved in history for the same client, method and arguments)
best regards
Janusz
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general