more jingle bug fixes

This commit is contained in:
Daniel Gultsch 2014-04-19 11:58:35 +02:00
parent 7299fe7c8b
commit 8003e53013
3 changed files with 10 additions and 12 deletions

View File

@ -426,9 +426,6 @@ public class JingleConnection {
public void established() { public void established() {
Log.d("xmppService", "established connection with "+candidate.getHost()+":"+candidate.getPort()); Log.d("xmppService", "established connection with "+candidate.getHost()+":"+candidate.getPort());
sendCandidateUsed(candidate.getCid()); sendCandidateUsed(candidate.getCid());
if ((receivedCandidate)&&(status == STATUS_ACCEPTED)) {
connect();
}
} }
}); });
} }
@ -450,9 +447,11 @@ public class JingleConnection {
content.setAttribute("name", "a-file-offer"); content.setAttribute("name", "a-file-offer");
content.setUsedCandidate(this.transportId, cid); content.setUsedCandidate(this.transportId, cid);
packet.setContent(content); packet.setContent(content);
Log.d("xmppService","send using candidate: "+cid);
this.sendJinglePacket(packet); this.sendJinglePacket(packet);
this.sentCandidate = true; this.sentCandidate = true;
if ((receivedCandidate)&&(status == STATUS_ACCEPTED)) {
connect();
}
} }
private void sendCandidateError() { private void sendCandidateError() {
@ -463,9 +462,11 @@ public class JingleConnection {
content.setAttribute("name", "a-file-offer"); content.setAttribute("name", "a-file-offer");
content.setCandidateError(this.transportId); content.setCandidateError(this.transportId);
packet.setContent(content); packet.setContent(content);
Log.d("xmppService","send candidate error");
this.sendJinglePacket(packet); this.sendJinglePacket(packet);
this.sentCandidate = true; this.sentCandidate = true;
if ((receivedCandidate)&&(status == STATUS_ACCEPTED)) {
connect();
}
} }
public String getInitiator() { public String getInitiator() {

View File

@ -86,8 +86,6 @@ public class JingleConnectionManager {
.findChild("streamhost", .findChild("streamhost",
"http://jabber.org/protocol/bytestreams"); "http://jabber.org/protocol/bytestreams");
if (streamhost != null) { if (streamhost != null) {
Log.d("xmppService", "streamhost found "
+ streamhost.toString());
JingleCandidate candidate = new JingleCandidate(nextRandomId(),true); JingleCandidate candidate = new JingleCandidate(nextRandomId(),true);
candidate.setHost(streamhost.getAttribute("host")); candidate.setHost(streamhost.getAttribute("host"));
candidate.setPort(Integer.parseInt(streamhost.getAttribute("port"))); candidate.setPort(Integer.parseInt(streamhost.getAttribute("port")));
@ -109,7 +107,6 @@ public class JingleConnectionManager {
} }
} else { } else {
Log.d("xmppService","found primary candidate in archive");
listener.onPrimaryCandidateFound(true, listener.onPrimaryCandidateFound(true,
this.primaryCandidates.get(account.getJid())); this.primaryCandidates.get(account.getJid()));
} }

View File

@ -95,15 +95,15 @@ public class JinglePacket extends IqPacket {
public String toPrettyString() { public String toPrettyString() {
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
output.append("["+getAction()+ " to:"+getTo()+" "); output.append("["+getAction()+ " to:"+getTo());
if (this.content!=null) { if (this.content!=null) {
if (this.content.getUsedCandidate()!=null) { if (this.content.getUsedCandidate()!=null) {
output.append("used-candidate="+this.content.getUsedCandidate()); output.append(" [used-candidate="+this.content.getUsedCandidate()+"]");
} else if (this.content.hasCandidateError()) { } else if (this.content.hasCandidateError()) {
output.append("candidate-error"); output.append(" [candidate-error]");
} else { } else {
for(Element c : this.content.getCanditates()) { for(Element c : this.content.getCanditates()) {
output.append("["+c.getAttribute("host")+":"+c.getAttribute("port")+"]"); output.append(" ["+c.getAttribute("host")+":"+c.getAttribute("port")+"]");
} }
} }
} }