Changeset 129b16d
- Timestamp:
- Jun 19, 2012 8:26:46 PM (9 years ago)
- Branches:
- master
- Children:
- e383477
- Parents:
- 48f29ff1
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java
r48f29ff1 r129b16d 123 123 String spoofHost; 124 124 int ourPort = socket.getLocalPort(); 125 if (ourPort != 80 && ourPort > 0 && ourPort < 65535 && opts != null) {125 if (ourPort != 80 && ourPort > 0 && ourPort <= 65535 && opts != null) { 126 126 String portSpoof = opts.getProperty("spoofedHost." + ourPort); 127 127 if (portSpoof != null) -
apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java
r48f29ff1 r129b16d 112 112 String host = url.getHost(); 113 113 int port = url.getPort(); 114 if (port <= 0 || port > =65535)114 if (port <= 0 || port > 65535) 115 115 port = 80; 116 116 -
apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptions.java
r48f29ff1 r129b16d 106 106 /** 107 107 * The local port. 108 * Zero (default) means you will receive traffic on all ports. 109 * Nonzero means you will get traffic ONLY for that port, use with care, 110 * as most applications do not specify a remote port. 108 111 * @param port 0 - 65535 109 112 * @since 0.8.9 -
apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptionsImpl.java
r48f29ff1 r129b16d 201 201 /** 202 202 * The local port. 203 * Zero (default) means you will receive traffic on all ports. 204 * Nonzero means you will get traffic ONLY for that port, use with care, 205 * as most applications do not specify a remote port. 203 206 * @param port 0 - 65535 204 207 * @since 0.8.9 -
apps/streaming/java/src/net/i2p/client/streaming/ConnectionManager.java
r48f29ff1 r129b16d 68 68 // Right now we get everything, and rely on Datagram to specify PROTO_UDP. 69 69 // PacketQueue has sent PROTO_STREAMING since the beginning of mux support (0.7.1) 70 _session.addMuxedSessionListener(_messageHandler, I2PSession.PROTO_ANY, I2PSession.PORT_ANY); 70 // As of 0.9.1, new option to enforce streaming protocol, off by default 71 // As of 0.9.1, listen on configured port (default 0 = all) 72 int protocol = defaultOptions.getEnforceProtocol() ? I2PSession.PROTO_STREAMING : I2PSession.PROTO_ANY; 73 _session.addMuxedSessionListener(_messageHandler, protocol, defaultOptions.getLocalPort()); 71 74 _outboundQueue = new PacketQueue(_context, _session, this); 72 75 /** Socket timeout for accept() */ -
apps/streaming/java/src/net/i2p/client/streaming/ConnectionOptions.java
r48f29ff1 r129b16d 20 20 private boolean _fullySigned; 21 21 private boolean _answerPings; 22 private boolean _enforceProto; 22 23 private volatile int _windowSize; 23 24 private int _receiveWindow; … … 88 89 public static final String PROP_MAX_TOTAL_CONNS_HOUR = "i2p.streaming.maxTotalConnsPerHour"; 89 90 public static final String PROP_MAX_TOTAL_CONNS_DAY = "i2p.streaming.maxTotalConnsPerDay"; 91 /** @since 0.9.1 */ 92 public static final String PROP_ENFORCE_PROTO = "i2p.streaming.enforceProtocol"; 90 93 91 94 private static final int TREND_COUNT = 3; … … 96 99 static final int MIN_WINDOW_SIZE = 1; 97 100 private static final boolean DEFAULT_ANSWER_PINGS = true; 101 /** 102 * If PROTO is enforced, we cannot communicate with destinations earlier than version 0.7.1. 103 * @since 0.9.1 104 */ 105 private static final boolean DEFAULT_ENFORCE_PROTO = true; 98 106 99 107 // Syncronization fix, but doing it this way causes NPE... … … 285 293 //setReadTimeout(opts.getReadTimeout()); 286 294 setAnswerPings(opts.getAnswerPings()); 295 setEnforceProtocol(opts.getEnforceProtocol()); 287 296 initLists(opts); 288 297 _maxConnsPerMinute = opts.getMaxConnsPerMinute(); … … 318 327 setConnectTimeout(getInt(opts, PROP_CONNECT_TIMEOUT, Connection.DISCONNECT_TIMEOUT)); 319 328 setAnswerPings(getBool(opts, PROP_ANSWER_PINGS, DEFAULT_ANSWER_PINGS)); 329 setEnforceProtocol(getBool(opts, PROP_ENFORCE_PROTO, DEFAULT_ENFORCE_PROTO)); 320 330 initLists(opts); 321 331 _maxConnsPerMinute = getInt(opts, PROP_MAX_CONNS_MIN, 0); … … 372 382 if (opts.containsKey(PROP_ANSWER_PINGS)) 373 383 setAnswerPings(getBool(opts, PROP_ANSWER_PINGS, DEFAULT_ANSWER_PINGS)); 384 if (opts.containsKey(PROP_ENFORCE_PROTO)) 385 setEnforceProtocol(getBool(opts, PROP_ENFORCE_PROTO, DEFAULT_ENFORCE_PROTO)); 374 386 initLists(opts); 375 387 if (opts.containsKey(PROP_MAX_CONNS_MIN)) … … 420 432 public boolean getAnswerPings() { return _answerPings; } 421 433 public void setAnswerPings(boolean yes) { _answerPings = yes; } 434 435 /** 436 * Do we receive all traffic, or only traffic marked with I2PSession.PROTO_STREAMING (6) ? 437 * Default false. 438 * If PROTO is enforced, we cannot communicate with destinations earlier than version 0.7.1 439 * (released March 2009), which is when streaming started sending the PROTO_STREAMING indication. 440 * Set to true if you are running multiple protocols on a single Destination. 441 * 442 * @return if we do 443 * @since 0.9.1 444 */ 445 public boolean getEnforceProtocol() { return _enforceProto; } 446 public void setEnforceProtocol(boolean yes) { _enforceProto = yes; } 422 447 423 448 /** -
core/java/src/net/i2p/client/I2PSession.java
r48f29ff1 r129b16d 39 39 * payload, returning true if the router feels confident that the message 40 40 * was delivered. 41 * 42 * WARNING: It is recommended that you use a method that specifies the protocol and ports. 43 * 41 44 * @param dest location to send the message 42 45 * @param payload body of the message to be sent (unencrypted) … … 150 153 151 154 /** Instruct the I2PSession where it should send event notifications 155 * 156 * WARNING: It is recommended that you use a method that specifies the protocol and ports. 157 * 152 158 * @param lsnr listener to retrieve events 153 159 */
Note: See TracChangeset
for help on using the changeset viewer.