Changed RPC sucessful execution code from 1 to 200. Included RpcHandler.h in main header file. Effectively allows RPC through HTTP.
Dependents: RPC_HTTP RPC_HTTP_WIZnetInterface RPC_HTTP rpc_over_http_TL_interrupter_gatePJ
Fork of HTTPServer by
Revision 17:c690fb2de477, committed 2015-06-15
- Comitter:
- sarahmarshy
- Date:
- Mon Jun 15 16:07:28 2015 +0000
- Parent:
- 16:cc3f5c53d0d5
- Commit message:
- Included RpcHandler in main HTTPServer header - allowed templating of RPC handler. Changed RPC succesful execution return code from 1 to 200. HTTP was sending a response of 1 on success, causing the client to assume there was an error.
Changed in this revision
HTTPServer.h | Show annotated file Show diff for this revision Revisions of this file |
Handler/RpcHandler.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r cc3f5c53d0d5 -r c690fb2de477 HTTPServer.h --- a/HTTPServer.h Sat Aug 17 16:17:55 2013 +0000 +++ b/HTTPServer.h Mon Jun 15 16:07:28 2015 +0000 @@ -26,6 +26,7 @@ #include "EthernetInterface.h" #include "HTTPConnection.h" #include "HTTPRequestHandler.h" +#include "RpcHandler.h" #include <map> using std::map;
diff -r cc3f5c53d0d5 -r c690fb2de477 Handler/RpcHandler.cpp --- a/Handler/RpcHandler.cpp Sat Aug 17 16:17:55 2013 +0000 +++ b/Handler/RpcHandler.cpp Mon Jun 15 16:07:28 2015 +0000 @@ -53,10 +53,10 @@ } INFO("RPC to %s", rpc_args.c_str()); retval = rpc.call(rpc_args.c_str(),outBuf); - INFO("RPC Request returned %d with args : %s", retval==true ? 1 : 0, outBuf); + INFO("RPC Request returned %d with args : %s", retval==true ? 200 : 0, outBuf); if (retval) { // No error - startResponse(retval, strlen(outBuf)); + startResponse(200, strlen(outBuf)); processResponse(strlen(outBuf), outBuf); endResponse(); err = 0;