From 9e66d30f0dfe6d777e3cfaf5b37ed97702ae8404 Mon Sep 17 00:00:00 2001 From: Daniel Moran Date: Thu, 7 Jul 2016 14:13:24 +0200 Subject: [PATCH 1/3] ADD Timeout for command calls --- config.js | 5 +++++ lib/bindings/HTTPBindings.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/config.js b/config.js index 300ed63d..19ce7c20 100644 --- a/config.js +++ b/config.js @@ -55,6 +55,11 @@ config.http = { * Port where the HTTP Ultralight transport binding will be listening for device requests. */ port: 7896 + + /** + * HTTP Timeout for the http command endpoint (in miliseconds). + */ + //timeout: 1000 }; config.iota = { diff --git a/lib/bindings/HTTPBindings.js b/lib/bindings/HTTPBindings.js index 5de78f4d..4a9b3df9 100644 --- a/lib/bindings/HTTPBindings.js +++ b/lib/bindings/HTTPBindings.js @@ -223,6 +223,11 @@ function generateCommandExecution(apiKey, device, attribute) { } }; + + if (config.getConfig().http.timeout) { + options.timeout = config.getConfig().http.timeout; + } + return function sendUlCommandHTTP(callback) { request(options, function(error, response, body) { if (error) { From 7a5185a8413f8fc1df8d99aa03430f1dc794f5e4 Mon Sep 17 00:00:00 2001 From: Daniel Moran Date: Thu, 7 Jul 2016 14:14:13 +0200 Subject: [PATCH 2/3] Change Bugfix version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f1312bae..e86dc401 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "iotagent-ul", "description": "IoT Agent for the Ultrlight 2.0 protocol", - "version": "1.1.6", + "version": "1.1.7", "homepage": "https://github.com/dmoranj/iotagent-ul", "author": { "name": "Daniel Moran", From 0f7fe11b2f6732047766f9de455aadd40af87c10 Mon Sep 17 00:00:00 2001 From: Daniel Moran Date: Thu, 7 Jul 2016 14:15:03 +0200 Subject: [PATCH 3/3] ADD Changes to change list --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 4dce0e50..487ec91e 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- FIX Commands won't write the Error results in the Context Broker. +- No timeout defined for HTTP commands (#97)