11diff --git a/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js b/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js
2- index 17e0d0c..d1ead4a 100644
2+ index 17e0d0c..9e90096 100644
33--- a/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js
44+++ b/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js
55@@ -106,7 +106,7 @@ var HttpConnection = exports.HttpConnection = function(options) {
@@ -34,7 +34,7 @@ index 17e0d0c..d1ead4a 100644
3434 }
3535 }
3636 }
37- @@ -165,17 +166,15 @@ var HttpConnection = exports.HttpConnection = function(options) {
37+ @@ -165,17 +166,17 @@ var HttpConnection = exports.HttpConnection = function(options) {
3838
3939 //Response handler
4040 //////////////////////////////////////////////////
@@ -46,6 +46,8 @@ index 17e0d0c..d1ead4a 100644
4646 if (response.statusCode !== 200) {
4747- this.emit("error", new THTTPException(response));
4848+ handleError(new THTTPException(response));
49+ + response.destroy();
50+ + return;
4951 }
5052
5153- response.on('error', function (e) {
@@ -55,7 +57,7 @@ index 17e0d0c..d1ead4a 100644
5557
5658 // When running directly under node, chunk will be a buffer,
5759 // however, when running in a Browser (e.g. Browserify), chunk
58- @@ -199,7 +198 ,9 @@ var HttpConnection = exports.HttpConnection = function(options) {
60+ @@ -199,7 +200 ,9 @@ var HttpConnection = exports.HttpConnection = function(options) {
5961 }
6062 //Get the receiver function for the transport and
6163 // call it with the buffer
@@ -66,7 +68,7 @@ index 17e0d0c..d1ead4a 100644
6668 });
6769 };
6870 };
69- @@ -212,18 +213 ,33 @@ util.inherits(HttpConnection, EventEmitter);
71+ @@ -212,18 +215 ,33 @@ util.inherits(HttpConnection, EventEmitter);
7072 * @event {error} the "error" event is raised upon request failure passing the
7173 * Node.js error object to the listener.
7274 */
0 commit comments