X-Git-Url: https://git.wh0rd.org/?p=chrome-ext%2Fmusic-player-client.git;a=blobdiff_plain;f=js%2Fmpc.js;fp=js%2Fmpc.js;h=ae013332e618a7700ae0e5a75f4d913c3f94f671;hp=dfcd5fd304278d8d520e637ad98f560dd06c25a1;hb=3903477400d2618c07543eba122ab794dac8fb5a;hpb=e9aee305f74ecbec9552d21836c50609cab6d954 diff --git a/js/mpc.js b/js/mpc.js index dfcd5fd..ae01333 100644 --- a/js/mpc.js +++ b/js/mpc.js @@ -34,6 +34,8 @@ Mpc.prototype.send = function(msg) { Mpc.prototype.recv_msg = function(lines) { curr = this._queue.shift(); this.log(0x2, 'recv: [' + curr + ']:', lines.join('\n')); + if (lines[0].substr(0, 4) == 'ACK ') + this.err(curr, lines.join('\n')); curr = curr.split(' '); switch (curr[0]) { @@ -79,7 +81,8 @@ Mpc.prototype.recv = function(msg) { var lines = this._recv_buffer = this._recv_buffer.concat(msg.split('\n')); var i = 0; while (i < lines.length) { - if (lines[i] == 'OK' || lines[i].substr(0, 3) == 'OK ') { + if (lines[i] == 'OK' || lines[i].substr(0, 3) == 'OK ' || + lines[i].substr(0, 4) == 'ACK ') { this.recv_msg(lines.splice(0, i + 1)); i = 0; } else