aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/xmpp')
-rw-r--r--src/eu/siacs/conversations/xmpp/XmppConnection.java8
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/JingleInbandTransport.java9
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java11
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/JingleTransport.java2
4 files changed, 5 insertions, 25 deletions
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java
index 4ac61ca7..f2c0962a 100644
--- a/src/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -17,7 +17,6 @@ import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
@@ -241,7 +240,7 @@ public class XmppConnection implements Runnable {
processStream(tagReader.readTag());
break;
} else if (nextTag.isStart("failure")) {
- Element failure = tagReader.readElement(nextTag);
+ tagReader.readElement(nextTag);
changeStatus(Account.STATUS_UNAUTHORIZED);
} else if (nextTag.isStart("challenge")) {
String challange = tagReader.readElement(nextTag).getContent();
@@ -442,17 +441,14 @@ public class XmppConnection implements Runnable {
private void switchOverToTls(Tag currentTag) throws XmlPullParserException,
IOException {
- Tag nextTag = tagReader.readTag(); // should be proceed end tag
+ tagReader.readTag();
try {
SSLContext sc = SSLContext.getInstance("TLS");
TrustManagerFactory tmf = TrustManagerFactory
.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- // Initialise the TMF as you normally would, for example:
- // tmf.in
try {
tmf.init((KeyStore) null);
} catch (KeyStoreException e1) {
- // TODO Auto-generated catch block
e1.printStackTrace();
}
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleInbandTransport.java b/src/eu/siacs/conversations/xmpp/jingle/JingleInbandTransport.java
index 8326fa39..a46e4a47 100644
--- a/src/eu/siacs/conversations/xmpp/jingle/JingleInbandTransport.java
+++ b/src/eu/siacs/conversations/xmpp/jingle/JingleInbandTransport.java
@@ -8,12 +8,10 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import android.util.Base64;
-import android.util.Log;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.utils.CryptoHelper;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xmpp.OnIqPacketReceived;
-import eu.siacs.conversations.xmpp.PacketReceived;
import eu.siacs.conversations.xmpp.stanzas.IqPacket;
public class JingleInbandTransport extends JingleTransport {
@@ -39,7 +37,6 @@ public class JingleInbandTransport extends JingleTransport {
private OnIqPacketReceived onAckReceived = new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- Log.d("xmppService", "on ack received");
if (packet.getType() == IqPacket.TYPE_RESULT) {
sendNextBlock();
}
@@ -82,7 +79,6 @@ public class JingleInbandTransport extends JingleTransport {
public void receive(JingleFile file, OnFileTransmitted callback) {
this.onFileTransmitted = callback;
this.file = file;
- Log.d("xmppService", "receiving file over ibb");
try {
this.digest = MessageDigest.getInstance("SHA-1");
digest.reset();
@@ -101,7 +97,6 @@ public class JingleInbandTransport extends JingleTransport {
public void send(JingleFile file, OnFileTransmitted callback) {
this.onFileTransmitted = callback;
this.file = file;
- Log.d("xmppService", "sending file over ibb");
try {
this.digest = MessageDigest.getInstance("SHA-1");
this.digest.reset();
@@ -151,10 +146,8 @@ public class JingleInbandTransport extends JingleTransport {
this.fileOutputStream.write(buffer);
this.digest.update(buffer);
- Log.d("xmppService", "remaining file size:" + this.remainingSize);
if (this.remainingSize <= 0) {
file.setSha1Sum(CryptoHelper.bytesToHex(digest.digest()));
- Log.d("xmppService","file name: "+file.getAbsolutePath());
fileOutputStream.flush();
fileOutputStream.close();
this.onFileTransmitted.onFileTransmitted(file);
@@ -179,7 +172,7 @@ public class JingleInbandTransport extends JingleTransport {
this.account.getXmppConnection().sendIqPacket(
packet.generateRespone(IqPacket.TYPE_RESULT), null);
} else {
- Log.d("xmppServic","couldnt deliver payload "+packet.toString());
+ //TODO some sort of exception
}
}
}
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java b/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java
index ea5d7285..0f2d4cae 100644
--- a/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java
+++ b/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java
@@ -13,10 +13,6 @@ import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import eu.siacs.conversations.utils.CryptoHelper;
-import eu.siacs.conversations.xml.Element;
-
-import android.util.Log;
-import android.widget.Button;
public class JingleSocks5Transport extends JingleTransport {
private JingleCandidate candidate;
@@ -150,13 +146,12 @@ public class JingleSocks5Transport extends JingleTransport {
byte[] buffer = new byte[8192];
int count = buffer.length;
while(remainingSize > 0) {
- Log.d("xmppService","remaning size:"+remainingSize);
if (remainingSize<=count) {
count = (int) remainingSize;
}
count = inputStream.read(buffer, 0, count);
if (count==-1) {
- Log.d("xmppService","end of stream");
+ // TODO throw exception
} else {
fileOutputStream.write(buffer, 0, count);
digest.update(buffer, 0, count);
@@ -166,7 +161,6 @@ public class JingleSocks5Transport extends JingleTransport {
fileOutputStream.flush();
fileOutputStream.close();
file.setSha1Sum(CryptoHelper.bytesToHex(digest.digest()));
- Log.d("xmppService","transmitted filename was: "+file.getAbsolutePath());
callback.onFileTransmitted(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
@@ -194,9 +188,8 @@ public class JingleSocks5Transport extends JingleTransport {
if (this.socket!=null) {
try {
this.socket.close();
- Log.d("xmppService","cloesd socket with "+candidate.getHost()+":"+candidate.getPort());
} catch (IOException e) {
- Log.d("xmppService","error closing socket with "+candidate.getHost()+":"+candidate.getPort());
+
}
}
}
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleTransport.java b/src/eu/siacs/conversations/xmpp/jingle/JingleTransport.java
index 6e9482a9..290bb5d3 100644
--- a/src/eu/siacs/conversations/xmpp/jingle/JingleTransport.java
+++ b/src/eu/siacs/conversations/xmpp/jingle/JingleTransport.java
@@ -1,7 +1,5 @@
package eu.siacs.conversations.xmpp.jingle;
-import eu.siacs.conversations.xml.Element;
-
public abstract class JingleTransport {
public abstract void connect(final OnTransportConnected callback);
public abstract void receive(final JingleFile file, final OnFileTransmitted callback);