Skip to content

Commit db59698

Browse files
author
Peter Spiess-Knafl
committed
Merge branch 'release/v0.4.1'
2 parents 31e4f78 + 52b2102 commit db59698

File tree

9 files changed

+39
-20
lines changed

9 files changed

+39
-20
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Changes in v0.4.1
2+
-----------------
3+
- Added coverity scan support
4+
- [Added API compatiblity report](http://upstream.rosalinux.ru/versions/libjson-rpc-cpp.html)
5+
- Improved manpage
6+
- Extended Stubgenerator for protocol switches (JSON-RPC 1.0 & 2.0)
7+
18
Changes in v0.4
29
---------------
310
- Memory leak fixes

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Wnon-virtua
1111

1212
SET(MAJOR_VERSION 0)
1313
SET(MINOR_VERSION 4)
14-
SET(PATCH_VERSION 0)
14+
SET(PATCH_VERSION 1)
1515
SET(SO_VERSION 0)
1616

1717
#possible modules that can be enabled/disabled

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/cinemast/libjson-rpc-cpp.png?branch=master)](https://travis-ci.org/cinemast/libjson-rpc-cpp) [![Coverage Status](https://coveralls.io/repos/cinemast/libjson-rpc-cpp/badge.png?branch=develop)](https://coveralls.io/r/cinemast/libjson-rpc-cpp?branch=develop)
1+
[![Build Status](https://travis-ci.org/cinemast/libjson-rpc-cpp.png?branch=master)](https://travis-ci.org/cinemast/libjson-rpc-cpp) [![Coverage Status](https://coveralls.io/repos/cinemast/libjson-rpc-cpp/badge.png?branch=develop)](https://coveralls.io/r/cinemast/libjson-rpc-cpp?branch=develop) [![Coverity Status](https://scan.coverity.com/projects/3169/badge.svg?flat=1)](https://scan.coverity.com/projects/3169)
22

33
libjson-rpc-cpp
44
===============
@@ -14,7 +14,7 @@ It is fully JSON-RPC [2.0 & 1.0 compatible](http://www.jsonrpc.org/specification
1414
- Full JSON-RPC 2.0 & 1.0 Client and Server Support.
1515
- jsonrpcstub - a tool that generates stub-classes for your JSON-RPC client AND server applications.
1616
- Ready to use HTTP server and client to provide simple interfaces for your JSON-RPC application.
17-
- Cross platform build support and [precompiled binaries for WIN32](https://spiessknafl.at/libjson-rpc-cpp/libjson-rpc-cpp-0.4.0-win32.exe).
17+
- Cross platform build support and [precompiled binaries for WIN32](http://spiessknafl.at/libjson-rpc-cpp/libjson-rpc-cpp-win32.exe).
1818
- Super liberal [MIT-License](http://en.wikipedia.org/wiki/MIT_License).
1919

2020
**Other good reasons to use libjson-rpc-cpp**
@@ -57,7 +57,7 @@ brew install argtable cmake jsoncpp libmicrohttpd
5757

5858
**Windows**
5959

60-
There is a ready to use compiled package for WIN32 [here](https://spiessknafl.at/libjson-rpc-cpp/libjson-rpc-cpp-0.4.0-win32.exe).
60+
There is a ready to use compiled package for WIN32 [here](http://spiessknafl.at/libjson-rpc-cpp/libjson-rpc-cpp-win32.exe).
6161

6262
If you want to compile on your own, here is how:
6363

@@ -221,6 +221,7 @@ References
221221
- [bitcodin](http://www.bitmovin.net): a scaleable cloud based video transcoding platform.
222222
- [wgslib](http://wgslib.com/): A web geostatistics library.
223223
- [bitcoin-api-cpp](https://github.com/minium/bitcoin-api-cpp): a C++ interface to bitcoin.
224+
- [NIT DASH Content Server](http://www.nit.eu/offer/research-projects-products/334-http2dash): Dynamic Adaptive Streaming over HTTP server.
224225

225226
If you use this library and find it useful, I would be very pleased if you let me know about it.
226227

@@ -235,8 +236,12 @@ Changelogs
235236
----------
236237
Changelogs can be found [here](https://github.com/cinemast/libjson-rpc-cpp/blob/master/CHANGELOG.md).
237238

238-
Licsense
239-
--------
239+
API compatiblity
240+
----------------
241+
Can be found [here](http://upstream.rosalinux.ru/versions/libjson-rpc-cpp.html)
242+
243+
License
244+
-------
240245
This framework is licensed under [MIT](http://en.wikipedia.org/wiki/MIT_License).
241246
All of this libraries dependencies are licensed under MIT compatible licenses.
242247

doc/manpage

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Manpage for jsonrpcstub.
22
.\" Contact [email protected] to correct errors or typos.
3-
.TH man 1 "22 November 2014" "0.4" "jsonrpcstub man page"
3+
.TH man 1 "22 November 2014" "0.4.1" "jsonrpcstub man page"
44
.SH NAME
55
jsonrpcstub \- genearate stubs for the libjson\-rpc\-cpp framework.
66
.SH SYNOPSIS
@@ -75,6 +75,8 @@ Generate JavaScript Client class MyRpcClient into file someclient.js:
7575
.B
7676
\& jsonrpcstub spec.json --js--client=MyRpcClient --js-client-file=someclient.js
7777
.B
78+
.SH EXIT STATUS
79+
This command returns 0 if no error occured. In any other case, it returns 1.
7880
.SH SEE ALSO
7981
https://github.com/cinemast/libjson\-rpc\-cpp
8082
.SH BUGS

src/examples/stubclient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ using namespace std;
1818
int main()
1919
{
2020
HttpClient httpclient("http://localhost:8383");
21-
StubClient c(httpclient);
21+
//StubClient c(httpclient, JSONRPC_CLIENT_V1); //json-rpc 1.0
22+
StubClient c(httpclient, JSONRPC_CLIENT_V2); //json-rpc 2.0
23+
2224

2325
try
2426
{
@@ -35,7 +37,5 @@ int main()
3537
{
3638
cerr << e.what() << endl;
3739
}
38-
39-
4040
}
4141

src/examples/stubserver.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using namespace std;
1818
class MyStubServer : public AbstractStubServer
1919
{
2020
public:
21-
MyStubServer(AbstractServerConnector &connector);
21+
MyStubServer(AbstractServerConnector &connector, serverVersion_t type);
2222

2323
virtual void notifyServer();
2424
virtual std::string sayHello(const std::string& name);
@@ -30,8 +30,8 @@ class MyStubServer : public AbstractStubServer
3030

3131
};
3232

33-
MyStubServer::MyStubServer(AbstractServerConnector &connector) :
34-
AbstractStubServer(connector)
33+
MyStubServer::MyStubServer(AbstractServerConnector &connector, serverVersion_t type) :
34+
AbstractStubServer(connector, type)
3535
{
3636
}
3737

@@ -76,9 +76,9 @@ string MyStubServer::methodWithoutParameters()
7676
int main()
7777
{
7878
HttpServer httpserver(8383);
79-
MyStubServer s(httpserver);
79+
MyStubServer s(httpserver, JSONRPC_SERVER_V1V2); //hybrid server (json-rpc 1.0 & 2.0)
8080
s.StartListening();
81-
81+
cout << "Hit enter to stop the server" << endl;
8282
getchar();
8383

8484
s.StopListening();

src/jsonrpccpp/common/procedure.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
using namespace std;
1717
using namespace jsonrpc;
1818

19-
Procedure::Procedure()
19+
Procedure::Procedure() :
20+
procedureName(""),
21+
procedureType(RPC_METHOD),
22+
returntype(JSON_BOOLEAN),
23+
paramDeclaration(PARAMS_BY_NAME)
2024
{
2125
}
2226

@@ -27,7 +31,7 @@ Procedure::Procedure(const string &name, parameterDeclaration_t paramType, jsont
2731
const char* paramname = va_arg(parameters, const char*);
2832
jsontype_t type;
2933
while(paramname != NULL) {
30-
type = (jsontype_t)va_arg(parameters, int); //Needs to be tested
34+
type = (jsontype_t)va_arg(parameters, int);
3135
this->AddParameter(paramname, type);
3236
paramname = va_arg(parameters, const char*);
3337
}
@@ -44,14 +48,15 @@ Procedure::Procedure(const string &name, parameterDeclaration_t paramType, ...)
4448
const char* paramname = va_arg(parameters, const char*);
4549
jsontype_t type;
4650
while(paramname != NULL) {
47-
type = (jsontype_t)va_arg(parameters, int); //Needs to be tested
51+
type = (jsontype_t)va_arg(parameters, int);
4852
this->AddParameter(paramname, type);
4953
paramname = va_arg(parameters, const char*);
5054
}
5155
va_end(parameters);
5256
this->procedureName = name;
5357
this->procedureType = RPC_NOTIFICATION;
5458
this->paramDeclaration = paramType;
59+
this->returntype = JSON_BOOLEAN;
5560
}
5661

5762
bool Procedure::ValdiateParameters (const Json::Value& parameters) const

src/stubgenerator/client/cppclientstubgenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#define TEMPLATE_CPPCLIENT_SIGCLASS "class <stubname> : public jsonrpc::Client"
1414

15-
#define TEMPLATE_CPPCLIENT_SIGCONSTRUCTOR "<stubname>(jsonrpc::IClientConnector &conn) : jsonrpc::Client(conn) {}"
15+
#define TEMPLATE_CPPCLIENT_SIGCONSTRUCTOR "<stubname>(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}"
1616

1717
#define TEMPLATE_CPPCLIENT_SIGMETHOD "<returntype> <methodname>(<parameters>) throw (jsonrpc::JsonRpcException)"
1818

src/stubgenerator/server/cppserverstubgenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define TEMPLATE_CPPSERVER_NOTIFICATIONBINDING "this->bindAndAddNotification(jsonrpc::Procedure(\"<procedurename>\", <paramtype>, <parameterlist> NULL), &<stubname>::<procedurename>I);"
1919

2020
#define TEMPLATE_CPPSERVER_SIGCLASS "class <stubname> : public jsonrpc::AbstractServer<<stubname>>"
21-
#define TEMPLATE_CPPSERVER_SIGCONSTRUCTOR "<stubname>(jsonrpc::AbstractServerConnector &conn) : jsonrpc::AbstractServer<<stubname>>(conn)"
21+
#define TEMPLATE_CPPSERVER_SIGCONSTRUCTOR "<stubname>(jsonrpc::AbstractServerConnector &conn, jsonrpc::serverVersion_t type = jsonrpc::JSONRPC_SERVER_V2) : jsonrpc::AbstractServer<<stubname>>(conn, type)"
2222

2323
#define TEMPLATE_CPPSERVER_SIGMETHOD "inline virtual void <procedurename>I(const Json::Value &request, Json::Value &response)"
2424
#define TEMPLATE_CPPSERVER_SIGNOTIFICATION "inline virtual void <procedurename>I(const Json::Value &request)"

0 commit comments

Comments
 (0)