Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix problem with pipe hanging from times to times, using data event c…

…ure the

problem
  • Loading branch information...
commit dd386916913043e5c1b34e20019eba029e203843 1 parent cadaf19
@xmilliard authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/oauth.js
View
10 lib/oauth.js
@@ -410,7 +410,15 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
if( (method == "POST" || method =="PUT") && post_body != null && post_body != "" ) {
if(useFile) {
var rs = fs.createReadStream(post_body);
- rs.pipe(request);
+ // pipe hang on large file
+ // using data event cure the problem
+ //rs.pipe(request);
+ rs.on('data', function(chunk) {
+ request.write(chunk);
+ });
+ rs.on('end', function() {
+ request.end();
+ });
}else {
request.write(post_body);
request.end();
Please sign in to comment.
Something went wrong with that request. Please try again.