i2ptunnel: Add internal sockets for SMTP and POP3 (ticket #2118)

This commit is contained in:
zzz
2017-12-13 23:23:02 +00:00
parent 5f413efc08
commit e6251e7cb5
5 changed files with 25 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
private final List<I2PSocketAddress> _addrs;
private static final long DEFAULT_READ_TIMEOUT = 5*60*1000; // -1
protected long readTimeout = DEFAULT_READ_TIMEOUT;
private InternalSocketRunner _isr;
/**
* As of 0.9.20 this is fast, and does NOT connect the manager to the router,
@@ -200,6 +201,8 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
svc = PortMapper.SVC_POP;
}
if (svc != null) {
_isr = new InternalSocketRunner(this);
_isr.start();
_context.portMapper().register(svc, getTunnel().listenHost, getLocalPort());
}
}
@@ -223,6 +226,9 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
_context.portMapper().unregister(PortMapper.SVC_POP);
}
boolean rv = super.close(forced);
if (_isr != null) {
_isr.stopRunning();
}
return rv;
}
}

View File

@@ -42,6 +42,7 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import net.i2p.data.DataHelper;
import net.i2p.util.InternalSocket;
/**
* @author susi23
@@ -609,7 +610,7 @@ public class POP3MailBox implements NewMailListener {
close();
try {
socket = new Socket(host, port);
socket = InternalSocket.getSocket(host, port);
} catch (IOException e) {
Debug.debug( Debug.DEBUG, "Error connecting: " + e);
lastError = _t("Cannot connect") + " (" + host + ':' + port + ") - " + e.getLocalizedMessage();

View File

@@ -41,6 +41,7 @@ import java.util.ArrayList;
import java.util.List;
import net.i2p.data.DataHelper;
import net.i2p.util.InternalSocket;
/**
* @author susi
@@ -233,7 +234,7 @@ public class SMTPClient {
Writer out = null;
try {
socket = new Socket( host, port );
socket = InternalSocket.getSocket(host, port);
} catch (IOException e) {
error += _t("Cannot connect") + " (" + host + ':' + port + ") : " + e.getMessage() + '\n';
ok = false;

View File

@@ -1,11 +1,25 @@
2017-12-13 zzz
* i2ptunnel: Add internal sockets for SMTP and POP3 (ticket #2118)
* Util: InternalSocket improvements
2017-12-11 zzz
* Jetty: Fix request log showing zero length for static content
* Startup: Raise open files ulimit (ticket #1967)
2017-12-10 zzz
* Router: Change RI locking to a read/write lock (ticket #2096)
2017-12-08 zzz
* SU3File: Flush and sync on extract (ticket #1941)
* SusiMail:
- Reference mails by UIDL, not index on page, put UIDL in
attachment links, remove session object UIDL (ticket #1373)
- Fix download of attachments without a Content-Transfer-Encoding
- Fix error return for attachment not found
- Fix handling of requests for unknown messages
- Set encoding for text attachments
- Add more safe mime types for downloading
- Add tooltips for icon-only buttons
2017-12-07 zzz
* Console: Don't list aliased tunnels separately on

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 14;
public final static long BUILD = 15;
/** for example "-test" */
public final static String EXTRA = "";