aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-03-31 17:56:32 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-03-31 17:56:32 +0200
commit1205c90cccd3144bab24b4b5fd8dcbf0d0e6b570 (patch)
treeed8b93e852f4f7e6b1884348891e39b562eb74bb /plugins
parentcc4b56b6710624c069642d1a510d0060949fe5b9 (diff)
refactoring (in progress, tbf)
Change-Id: I8f2684a38d0894d827510d9a171ee6d5c39fb55e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/radio/radio-api.c2
-rw-r--r--plugins/samples/HelloWorld.c5
-rw-r--r--plugins/samples/SamplePost.c17
3 files changed, 7 insertions, 17 deletions
diff --git a/plugins/radio/radio-api.c b/plugins/radio/radio-api.c
index bdb1768f..c6e4b905 100644
--- a/plugins/radio/radio-api.c
+++ b/plugins/radio/radio-api.c
@@ -329,6 +329,6 @@ PUBLIC AFB_plugin* pluginRegister () {
plugin->freeCtxCB = (AFB_freeCtxCB)freeRadio;
- radio = initRadioPlugin();
+ the_radio = initRadioPlugin();
return plugin;
};
diff --git a/plugins/samples/HelloWorld.c b/plugins/samples/HelloWorld.c
index 067365dd..6c2d0cf9 100644
--- a/plugins/samples/HelloWorld.c
+++ b/plugins/samples/HelloWorld.c
@@ -29,11 +29,8 @@ STATIC json_object* pingSample (AFB_request *request) {
len = getQueryAll (request, query, sizeof(query));
if (len == 0) strcpy (query,"NoSearchQueryList");
- // check if we have some post data
- if (request->post != NULL) request->post->data="NoData";
-
// return response to caller
- response = jsonNewMessage(AFB_SUCCESS, "Ping Binder Daemon %d query={%s} PostData: \'%s\' ", pingcount++, query, request->post);
+ response = jsonNewMessage(AFB_SUCCESS, "Ping Binder Daemon %d query={%s}", pingcount++, query);
if (verbose) fprintf(stderr, "%d: \n", pingcount);
return (response);
diff --git a/plugins/samples/SamplePost.c b/plugins/samples/SamplePost.c
index d29fb05a..24ee5385 100644
--- a/plugins/samples/SamplePost.c
+++ b/plugins/samples/SamplePost.c
@@ -23,38 +23,31 @@
static json_object* getPingTest(AFB_request *request) {
static int pingcount = 0;
json_object *response;
- char query [256];
- char session[256];
+ char query [8000];
int len;
// request all query key/value
len = getQueryAll (request, query, sizeof(query));
if (len == 0) strncpy (query, "NoSearchQueryList", sizeof(query));
- // check if we have some post data
- if (request->post == NULL) request->post->data="NoData";
-
// return response to caller
- response = jsonNewMessage(AFB_SUCCESS, "Ping Binder Daemon count=%d uuid=%s query={%s} session={0x%x} PostData: [%s] "
- , pingcount++, request->uuid, query, session, request->post->data);
+ response = jsonNewMessage(AFB_SUCCESS, "Ping Binder Daemon count=%d uuid=%s query={%s}"
+ , pingcount++, request->uuid, query);
return (response);
}
// With content-type=json data are directly avaliable in request->post->data
STATIC json_object* GetJsonByPost (AFB_request *request) {
json_object* jresp;
- char query [256];
+ char query [8000];
int len;
- // check if we have some post data
- if (request->post == NULL) request->post->data="NoData";
-
// Get all query string [Note real app should probably use value=getQueryValue(request,"key")]
len = getQueryAll (request, query, sizeof(query));
if (len == 0) strncpy (query, "NoSearchQueryList", sizeof(query));
// for debug/test return response to caller
- jresp = jsonNewMessage(AFB_SUCCESS, "GetJsonByPost query={%s} PostData: [%s]", query, request->post->data);
+ jresp = jsonNewMessage(AFB_SUCCESS, "GetJsonByPost query={%s}", query);
return (jresp);
}