Close the provisioning socket
This commit is contained in:
@@ -38356,6 +38356,7 @@ TextSecureWebSocket = function (url) {
|
||||
|
||||
function resetKeepAliveTimer() {
|
||||
clearTimeout(keepAliveTimer);
|
||||
if (calledClose) { return; }
|
||||
keepAliveTimer = setTimeout(function() {
|
||||
if (socket.readyState === WebSocket.OPEN) {
|
||||
socket.send(
|
||||
@@ -39298,7 +39299,8 @@ TextSecureServer = function () {
|
||||
registerSecondDevice: function(setProvisioningUrl, confirmNumber, progressCallback) {
|
||||
return textsecure.protocol_wrapper.createIdentityKeyRecvSocket().then(function(cryptoInfo) {
|
||||
return new Promise(function(resolve) {
|
||||
new WebSocketResource(TextSecureServer.getTempWebsocket(), function(request) {
|
||||
var socket = TextSecureServer.getTempWebsocket();
|
||||
new WebSocketResource(socket, function(request) {
|
||||
if (request.path == "/v1/address" && request.verb == "PUT") {
|
||||
var proto = textsecure.protobuf.ProvisioningUuid.decode(request.body);
|
||||
setProvisioningUrl([
|
||||
@@ -39309,6 +39311,7 @@ TextSecureServer = function () {
|
||||
} else if (request.path == "/v1/message" && request.verb == "PUT") {
|
||||
var envelope = textsecure.protobuf.ProvisionEnvelope.decode(request.body, 'binary');
|
||||
request.respond(200, 'OK');
|
||||
socket.close();
|
||||
resolve(cryptoInfo.decryptAndHandleDeviceInit(envelope).then(function(provisionMessage) {
|
||||
return confirmNumber(provisionMessage.number).then(function() {
|
||||
return createAccount(
|
||||
|
Reference in New Issue
Block a user