Skip to content

Commit a317a40

Browse files
committed
need to save this, dying harddrive
1 parent cc11fae commit a317a40

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

lib/frame.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,17 @@ Frame.prototype.send_frame = function(frame) {
7373
self = this;
7474
this.sock.write(frame.as_string());
7575

76-
if ('receipt' in frame.headers)
76+
if ('receipt' in frame.headers) {
77+
console.log('receipt in headers');
7778
return this.get_reply();
79+
}
7880

7981
};
8082

8183
Frame.prototype.parse_frame = function(data) {
84+
85+
console.log("RAW DATA AT PARSE_FRAME: " + data);
86+
8287
var self = this,
8388
args = {},
8489
headers_str = null;

lib/stomp.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ Stomp.prototype.connect = function(headers) {
2424
this.stomp_log.debug('Connecting to ' + this.host + ':' + this.port);
2525
socket = net.createConnection(this.port, this.host);
2626
socket.setEncoding('ascii');
27-
socket.setTimeout(0);
27+
// socket.setTimeout(0);
2828
socket.setNoDelay(true);
2929

3030
socket.addListener('connect', function() {
3131
self.stomp_log.debug('Connected to socket');
3232
self.connected_frame = self.frame_object.stomp_connect(self.socket);
3333
});
3434

35-
socket.addListener('drain', function() {
36-
35+
socket.addListener('drain', function(data) {
36+
console.log("DRAIN_DATA: " + data);
3737
});
3838

3939
socket.addListener('data', function(data) {
@@ -110,19 +110,19 @@ Stomp.prototype.ack = function(message_id) {
110110
};
111111

112112
Stomp.prototype.send = function(headers) {
113-
113+
extra = {};
114114
destination = headers['destination'];
115115
body = headers['body'] || null;
116-
headers['want_receipt'] = true;
117-
116+
extra['want_receipt'] = true;
118117
return this._send_command('SEND', headers, body)
119118
};
120119

121-
Stomp.prototype._send_command = function(command, headers, body) {
120+
Stomp.prototype._send_command = function(command, headers, body, the_rest) {
122121

123122
if (!this.utils.really_defined(headers))
124123
headers = {};
125124

125+
console.log("HEADERS: " + sys.inspect(headers));
126126
frame_conf = {
127127
'command': command,
128128
'headers': headers,
@@ -132,8 +132,10 @@ Stomp.prototype._send_command = function(command, headers, body) {
132132
var this_frame = this.connected_frame.build_frame(frame_conf);
133133
var reply = this.connected_frame.send_frame(this_frame);
134134

135-
if ('want_receipt' in headers)
135+
if ('want_receipt' in the_rest) {
136+
console.log('want_receipt = true');
136137
return reply;
138+
}
137139

138140
return this_frame;
139141

0 commit comments

Comments
 (0)