Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit 4bcf113

Browse files
committed
Return if stream not writable, so errors will bubble up properly
1 parent 325c727 commit 4bcf113

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/frame.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ Frame.prototype.as_string = function() {
7171

7272
Frame.prototype.send_frame = function(frame) {
7373
self = this;
74+
75+
if (this.sock.readyState != 'open')
76+
return
77+
7478
this.sock.write(frame.as_string());
7579

7680
if ('receipt' in frame.headers) {
@@ -82,8 +86,6 @@ Frame.prototype.send_frame = function(frame) {
8286

8387
Frame.prototype.parse_frame = function(data) {
8488

85-
console.log("RAW DATA AT PARSE_FRAME: " + data);
86-
8789
var self = this,
8890
args = {},
8991
headers_str = null;

0 commit comments

Comments
 (0)