Permalink
Browse files

An untested fix to the broken HDFS node. The issue: it only returns t…

…he last chunk, if the HTTP response from HDFS is chunked.
  • Loading branch information...
amcgail committed Feb 24, 2015
1 parent 8efa774 commit 9b56e8d0b0a47348afa27956d5769354e21dfdf0
Showing with 8 additions and 1 deletion.
  1. +8 −1 node-red-contrib-bluemix-hdfs/application/47-ibmhdfs-cf.js
@@ -116,9 +116,16 @@ function HDFSRequestInNode(n) {
} else {
msg.payload = "";
}
+ var begun = false;
res.on('data',function(chunk) {
node.status({fill:"green",shape:"dot",text:"connected"});
- msg.payload = chunk;
+ if( begun )
+ msg.payload += chunk;
+ else {
+ msg.payload = chunk;
+ begun = true;
+ }
+
payload = msg.payload;
node.log("Payload in DATA = " + msg.payload);

0 comments on commit 9b56e8d

Please sign in to comment.