Skip to content

Commit

Permalink
Tweak socket event logging
Browse files Browse the repository at this point in the history
  • Loading branch information
liliakai committed Apr 13, 2017
1 parent 44a4ff3 commit dcfc470
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions js/libtextsecure.js
Expand Up @@ -37958,11 +37958,14 @@ var TextSecureServer = (function() {
return new Promise(function(resolve, reject) {
var socket = getSocket();
socket.onclose = function(e) {
console.log('websocket closed', e.code);
console.log('provisioning socket closed', e.code);
if (!gotProvisionEnvelope) {
reject(new Error('websocket closed'));
}
};
socket.onopen = function(e) {
console.log('provisioning socket open');
};
var wsr = new WebSocketResource(socket, {
keepalive: { path: '/v1/keepalive/provisioning' },
handleRequest: function(request) {
Expand Down Expand Up @@ -38212,7 +38215,6 @@ MessageReceiver.prototype.extend({
if (this.socket && this.socket.readyState !== WebSocket.CLOSED) {
this.socket.close();
}
console.log('opening websocket');
// initialize the socket and start listening for messages
this.socket = this.server.getMessageSocket();
this.socket.onclose = this.onclose.bind(this);
Expand Down
5 changes: 4 additions & 1 deletion libtextsecure/account_manager.js
Expand Up @@ -50,11 +50,14 @@
return new Promise(function(resolve, reject) {
var socket = getSocket();
socket.onclose = function(e) {
console.log('websocket closed', e.code);
console.log('provisioning socket closed', e.code);
if (!gotProvisionEnvelope) {
reject(new Error('websocket closed'));
}
};
socket.onopen = function(e) {
console.log('provisioning socket open');
};
var wsr = new WebSocketResource(socket, {
keepalive: { path: '/v1/keepalive/provisioning' },
handleRequest: function(request) {
Expand Down
1 change: 0 additions & 1 deletion libtextsecure/message_receiver.js
Expand Up @@ -21,7 +21,6 @@ MessageReceiver.prototype.extend({
if (this.socket && this.socket.readyState !== WebSocket.CLOSED) {
this.socket.close();
}
console.log('opening websocket');
// initialize the socket and start listening for messages
this.socket = this.server.getMessageSocket();
this.socket.onclose = this.onclose.bind(this);
Expand Down

0 comments on commit dcfc470

Please sign in to comment.