celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1628891 - in /celix/trunk/remote_services: calculator_endpoint/private/src/calculator_endpoint_impl.c calculator_proxy/private/src/calculator_proxy_impl.c
Date Thu, 02 Oct 2014 06:43:23 GMT
Author: abroekhuis
Date: Thu Oct  2 06:43:23 2014
New Revision: 1628891

URL: http://svn.apache.org/r1628891
Log:
CELIX-162: Updated endpoint and proxy to use new reply format.

Modified:
    celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c
    celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c

Modified: celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c?rev=1628891&r1=1628890&r2=1628891&view=diff
==============================================================================
--- celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c
(original)
+++ celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c
Thu Oct  2 06:43:23 2014
@@ -89,9 +89,9 @@ celix_status_t calculatorEndpoint_add(re
 			json_t *resultRoot;
 			calculator_service_pt service = endpoint->service;
 			service->add(service->calculator, a, b, &result);
-			resultRoot = json_pack("f", result);
+			resultRoot = json_pack("{s:f}", "r", result);
 
-			char *c = json_dumps(resultRoot, JSON_ENCODE_ANY);
+			char *c = json_dumps(resultRoot, 0);
 			*reply = c;
 		} else {
 			printf("CALCULATOR_ENDPOINT: No service available");
@@ -120,7 +120,7 @@ celix_status_t calculatorEndpoint_sub(re
 			json_t *resultRoot;
 			calculator_service_pt service = endpoint->service;
 			service->sub(service->calculator, a, b, &result);
-			resultRoot = json_pack("f", result);
+			resultRoot = json_pack("{s:f}", "r", result);
 
 			char *c = json_dumps(resultRoot, JSON_ENCODE_ANY);
 			*reply = c;
@@ -150,7 +150,7 @@ celix_status_t calculatorEndpoint_sqrt(r
 			json_t *resultRoot;
 			calculator_service_pt service = endpoint->service;
 			service->sqrt(service->calculator, a, &result);
-			resultRoot = json_pack("f", result);
+			resultRoot = json_pack("{s:f}", "r", result);
 
 			char *c = json_dumps(resultRoot, JSON_ENCODE_ANY);
 			*reply = c;

Modified: celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c?rev=1628891&r1=1628890&r2=1628891&view=diff
==============================================================================
--- celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c (original)
+++ celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c Thu Oct
 2 06:43:23 2014
@@ -112,7 +112,7 @@ celix_status_t calculatorProxy_sub(calcu
 			json_error_t error;
 			json_t *js_reply = json_loads(reply, 0, &error);
 			if (js_reply) {
-				json_unpack(js_reply, "f", result);
+			    json_unpack(js_reply, "{s:f}", "r", result);
 			} else {
 				printf("PROXY: got error '%s' for '%s'\n", error.text, reply);
 				status = CELIX_BUNDLE_EXCEPTION;
@@ -145,7 +145,7 @@ celix_status_t calculatorProxy_sqrt(calc
 			json_error_t error;
 			json_t *js_reply = json_loads(reply, JSON_DECODE_ANY, &error);
 			if (js_reply) {
-				json_unpack(js_reply, "f", result);
+			    json_unpack(js_reply, "{s:f}", "r", result);
 			} else {
 				printf("PROXY: got error '%s' for '%s'\n", error.text, reply);
 				status = CELIX_BUNDLE_EXCEPTION;



Mime
View raw message