diff options
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); |