diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-10-28 17:26:38 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-10-28 17:26:38 (GMT) |
commit | a68b6c1d31cb94675dd4dda0a2da11d8e83063c3 (patch) | |
tree | d96b56f209f2b65c703be4e611a7e3e6da899067 /src/uscxml/plugins | |
parent | 1be1af2d15375dbbf20cd07e85afdf3cee23c992 (diff) | |
download | uscxml-a68b6c1d31cb94675dd4dda0a2da11d8e83063c3.zip uscxml-a68b6c1d31cb94675dd4dda0a2da11d8e83063c3.tar.gz uscxml-a68b6c1d31cb94675dd4dda0a2da11d8e83063c3.tar.bz2 |
Bug fixes (see details)
- No more 100-continue HTTP header
- Correctly delegate HTTP requests
- More elaborate expressions when communicating via HTTP
- Fixed off-by-one in JSCNodeSet
Diffstat (limited to 'src/uscxml/plugins')
3 files changed, 25 insertions, 9 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp index 821f463..6de5793 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp @@ -61,7 +61,7 @@ JSValueRef JSCNodeSet::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef o int index = boost::lexical_cast<int>(propName); struct JSCNodeSetPrivate* privData = (struct JSCNodeSetPrivate*)JSObjectGetPrivate(object); - if (privData->nativeObj->size() < index) { + if (privData->nativeObj->size() <= index) { return JSValueMakeUndefined(ctx); } diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp index d615238..cd690ff 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp @@ -101,7 +101,7 @@ void OSGInvoker::invoke(const InvokeRequest& req) { setupColors(); - std::cout << req.dom; +// std::cout << req.dom; // register default event handlers Arabica::DOM::Events::EventTarget<std::string> evTarget = Arabica::DOM::Events::EventTarget<std::string>(req.dom); diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp index dc0e27a..2edb8ba 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp @@ -170,28 +170,44 @@ void BasicHTTPIOProcessor::send(const SendRequest& req) { } } - // content - + // try hard to find actual content + char* keyCStr = evhttp_encode_uri("content"); if (req.content.size() > 0) { - char* keyCStr = evhttp_encode_uri("content"); char* valueCStr = evhttp_encode_uri(req.content.c_str()); kvps << kvpSeperator << keyCStr << "=" << valueCStr; free(keyCStr); free(valueCStr); kvpSeperator = "&"; - } - if (req.dom) { + } else if (req.dom) { std::stringstream xmlStream; xmlStream << req.dom; - char* keyCStr = evhttp_encode_uri("content"); char* valueCStr = evhttp_encode_uri(xmlStream.str().c_str()); kvps << kvpSeperator << keyCStr << "=" << valueCStr; - free(keyCStr); free(valueCStr); kvpSeperator = "&"; + } else if (req.data) { + char* valueCStr = NULL; + if (req.data.atom.length() || req.data.array.size() || req.data.compound.size()) { + valueCStr = evhttp_encode_uri(Data::toJSON(req.data).c_str()); + } else if(req.data.node) { + std::stringstream xmlStream; + xmlStream << req.data.node; + valueCStr = evhttp_encode_uri(xmlStream.str().c_str()); + } else if(req.data.binary) { + valueCStr = evhttp_encode_uri(req.data.binary->base64().c_str()); + } + if (valueCStr != NULL) { + kvps << kvpSeperator << keyCStr << "=" << valueCStr; + free(valueCStr); + kvpSeperator = "&"; + } } + free(keyCStr); + targetURL.setOutContent(kvps.str()); +// targetURL.addOutHeader("Content-Type", "application/x-www-form-urlencoded"); + targetURL.setRequestType("post"); targetURL.addMonitor(this); |