Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afm-main-plugin: fix bug
[src/app-framework-binder.git]
/
plugins
/
afm-main-plugin
/
afm-main-plugin.c
diff --git
a/plugins/afm-main-plugin/afm-main-plugin.c
b/plugins/afm-main-plugin/afm-main-plugin.c
index
3f9de71
..
1fcc554
100644
(file)
--- a/
plugins/afm-main-plugin/afm-main-plugin.c
+++ b/
plugins/afm-main-plugin/afm-main-plugin.c
@@
-38,6
+38,7
@@
static char _uninstall_[] = "uninstall";
static const char _mode_[] = "mode";
static const char _local_[] = "local";
static const char _remote_[]= "remote";
static const char _mode_[] = "mode";
static const char _local_[] = "local";
static const char _remote_[]= "remote";
+static const char _auto_[] = "auto";
static const char _uri_[] = "uri";
static struct jbus *jbus;
static const char _uri_[] = "uri";
static struct jbus *jbus;
@@
-138,7
+139,7
@@
static struct json_object *call_start(AFB_request *request, AFB_PostItem *item)
}
/* get the mode */
mode = getQueryValue(request, _mode_);
}
/* get the mode */
mode = getQueryValue(request, _mode_);
- if (mode == NULL) {
+ if (mode == NULL
|| !strcmp(mode, _auto_)
) {
mode = request->config->mode == AFB_MODE_REMOTE ? _remote_ : _local_;
}
mode = request->config->mode == AFB_MODE_REMOTE ? _remote_ : _local_;
}
@@
-156,7
+157,7
@@
static struct json_object *call_start(AFB_request *request, AFB_PostItem *item)
free(query);
/* embed if needed */
free(query);
/* embed if needed */
- if (json_object_get_type(resp) == json_type_
string
)
+ if (json_object_get_type(resp) == json_type_
int
)
resp = embed(request, _runid_, resp);
request->errcode = resp ? MHD_HTTP_OK : MHD_HTTP_FAILED_DEPENDENCY;
return resp;
resp = embed(request, _runid_, resp);
request->errcode = resp ? MHD_HTTP_OK : MHD_HTTP_FAILED_DEPENDENCY;
return resp;