report not-acceptable on jingle errors
This commit is contained in:
parent
d2d9bbe3da
commit
f8bd4284a5
|
@ -270,9 +270,10 @@ public class JingleConnection implements Transferable {
|
|||
IqPacket response;
|
||||
if (returnResult) {
|
||||
response = packet.generateResponse(IqPacket.TYPE.RESULT);
|
||||
|
||||
} else {
|
||||
response = packet.generateResponse(IqPacket.TYPE.ERROR);
|
||||
final Element error = response.addChild("error").setAttribute("type", "cancel");
|
||||
error.addChild("not-acceptable", "urn:ietf:params:xml:ns:xmpp-stanzas");
|
||||
}
|
||||
mXmppConnectionService.sendIqPacket(account, response, null);
|
||||
}
|
||||
|
@ -933,8 +934,9 @@ public class JingleConnection implements Transferable {
|
|||
|
||||
private boolean receiveTransportAccept(JinglePacket packet) {
|
||||
if (packet.getJingleContent().hasIbbTransport()) {
|
||||
String receivedBlockSize = packet.getJingleContent().ibbTransport()
|
||||
.getAttribute("block-size");
|
||||
final Element ibbTransport = packet.getJingleContent().ibbTransport();
|
||||
final String receivedBlockSize = ibbTransport.getAttribute("block-size");
|
||||
final String sid = ibbTransport.getAttribute("sid");
|
||||
if (receivedBlockSize != null) {
|
||||
try {
|
||||
int bs = Integer.parseInt(receivedBlockSize);
|
||||
|
@ -947,6 +949,10 @@ public class JingleConnection implements Transferable {
|
|||
}
|
||||
this.transport = new JingleInbandTransport(this, this.transportId, this.ibbBlockSize);
|
||||
|
||||
if (sid == null || !sid.equals(this.transportId)) {
|
||||
Log.w(Config.LOGTAG,String.format("%s: sid in transport-accept (%s) did not match our sid (%s) ", account.getJid().asBareJid(), sid, transportId));
|
||||
}
|
||||
|
||||
//might be receive instead if we are not initiating
|
||||
if (initiating()) {
|
||||
this.transport.connect(onIbbTransportConnected);
|
||||
|
@ -955,6 +961,7 @@ public class JingleConnection implements Transferable {
|
|||
}
|
||||
return true;
|
||||
} else {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received invalid transport-accept");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,18 +80,12 @@ public class JingleInbandTransport extends JingleTransport {
|
|||
open.setAttribute("stanza", "iq");
|
||||
open.setAttribute("block-size", Integer.toString(this.blockSize));
|
||||
this.connected = true;
|
||||
this.account.getXmppConnection().sendIqPacket(iq,
|
||||
new OnIqPacketReceived() {
|
||||
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account,
|
||||
IqPacket packet) {
|
||||
this.account.getXmppConnection().sendIqPacket(iq, (account, packet) -> {
|
||||
if (packet.getType() != IqPacket.TYPE.RESULT) {
|
||||
callback.failed();
|
||||
} else {
|
||||
callback.established();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue