Browse Source

Merge remote-tracking branch 'purple/master'

pull/628/head
Jeff Becker 8 years ago
parent
commit
c16632d99a
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 8
      ChangeLog
  2. 23
      NetDbRequests.cpp
  3. 2
      NetDbRequests.h
  4. 13
      Reseed.cpp
  5. 64
      RouterInfo.cpp
  6. 4
      RouterInfo.h
  7. 32
      contrib/certificates/reseed/r4sas_at_mail.i2p.crt
  8. 11
      debian/changelog
  9. 4
      debian/i2pd.default
  10. 8
      debian/i2pd.init
  11. 4
      debian/i2pd.install
  12. 4
      debian/i2pd.upstart
  13. 18
      debian/logrotate
  14. 2
      docs/build_notes_unix.md
  15. 26
      docs/i2pd.conf
  16. 0
      docs/subscriptions.txt
  17. 0
      docs/tunnels.conf
  18. 4
      filelist.mk

8
ChangeLog

@ -1,9 +1,15 @@
# for this file format description, # for this file format description,
# see https://github.com/olivierlacan/keep-a-changelog # see https://github.com/olivierlacan/keep-a-changelog
## [2.9.0] - UNRELEASED ## [2.9.0] - 2016-08-12
### Changed ### Changed
- Proxy refactoring & speedup - Proxy refactoring & speedup
- Transmission-I2P support
- Graceful shutdown for Windows
- Android without QT
- Reduced number of timers in SSU
- ipv6 peer test support
- Reseed from SU3 file
## [2.8.0] - 2016-06-20 ## [2.8.0] - 2016-06-20
### Added ### Added

23
NetDbRequests.cpp

@ -68,8 +68,7 @@ namespace data
dest->SetRequestComplete (requestComplete); dest->SetRequestComplete (requestComplete);
{ {
std::unique_lock<std::mutex> l(m_RequestedDestinationsMutex); std::unique_lock<std::mutex> l(m_RequestedDestinationsMutex);
if (!m_RequestedDestinations.insert (std::make_pair (destination, if (!m_RequestedDestinations.insert (std::make_pair (destination, dest)).second) // not inserted
std::shared_ptr<RequestedDestination> (dest))).second) // not inserted
return nullptr; return nullptr;
} }
return dest; return dest;
@ -77,20 +76,28 @@ namespace data
void NetDbRequests::RequestComplete (const IdentHash& ident, std::shared_ptr<RouterInfo> r) void NetDbRequests::RequestComplete (const IdentHash& ident, std::shared_ptr<RouterInfo> r)
{ {
auto it = m_RequestedDestinations.find (ident); std::shared_ptr<RequestedDestination> request;
if (it != m_RequestedDestinations.end ()) {
std::unique_lock<std::mutex> l(m_RequestedDestinationsMutex);
auto it = m_RequestedDestinations.find (ident);
if (it != m_RequestedDestinations.end ())
{
request = it->second;
m_RequestedDestinations.erase (it);
}
}
if (request)
{ {
if (r) if (r)
it->second->Success (r); request->Success (r);
else else
it->second->Fail (); request->Fail ();
std::unique_lock<std::mutex> l(m_RequestedDestinationsMutex);
m_RequestedDestinations.erase (it);
} }
} }
std::shared_ptr<RequestedDestination> NetDbRequests::FindRequest (const IdentHash& ident) const std::shared_ptr<RequestedDestination> NetDbRequests::FindRequest (const IdentHash& ident) const
{ {
std::unique_lock<std::mutex> l(m_RequestedDestinationsMutex);
auto it = m_RequestedDestinations.find (ident); auto it = m_RequestedDestinations.find (ident);
if (it != m_RequestedDestinations.end ()) if (it != m_RequestedDestinations.end ())
return it->second; return it->second;

2
NetDbRequests.h

@ -59,7 +59,7 @@ namespace data
private: private:
std::mutex m_RequestedDestinationsMutex; mutable std::mutex m_RequestedDestinationsMutex;
std::map<IdentHash, std::shared_ptr<RequestedDestination> > m_RequestedDestinations; std::map<IdentHash, std::shared_ptr<RequestedDestination> > m_RequestedDestinations;
}; };
} }

13
Reseed.cpp

@ -30,15 +30,16 @@ namespace data
#else #else
// mainline i2p reseeds // mainline i2p reseeds
"https://reseed.i2p-projekt.de/", // Only HTTPS "https://reseed.i2p-projekt.de/", // Only HTTPS
"https://i2p.mooo.com/netDb/", "https://i2p.mooo.com/netDb/",
"https://netdb.i2p2.no/", // Only SU3 (v3) support, SNI required "https://netdb.i2p2.no/", // Only SU3 (v3) support, SNI required
"https://us.reseed.i2p2.no:444/", "https://us.reseed.i2p2.no:444/",
"https://uk.reseed.i2p2.no:444/", "https://uk.reseed.i2p2.no:444/",
"https://i2p.manas.ca:8443/", "https://i2p.manas.ca:8443/",
"https://i2p-0.manas.ca:8443/", "https://i2p-0.manas.ca:8443/",
"https://reseed.i2p.vzaws.com:8443/", // Only SU3 (v3) support "https://reseed.i2p.vzaws.com:8443/", // Only SU3 (v3) support
"https://user.mx24.eu/", // Only HTTPS and SU3 (v3) support "https://user.mx24.eu/", // Only HTTPS and SU3 (v3) support
"https://download.xxlspeed.com/" // Only HTTPS and SU3 (v3) support "https://download.xxlspeed.com/", // Only HTTPS and SU3 (v3) support
"https://reseed-ru.lngserv.ru/"
#endif #endif
}; };

64
RouterInfo.cpp

@ -163,7 +163,7 @@ namespace data
s.read ((char *)&address.cost, sizeof (address.cost)); s.read ((char *)&address.cost, sizeof (address.cost));
s.read ((char *)&address.date, sizeof (address.date)); s.read ((char *)&address.date, sizeof (address.date));
char transportStyle[5]; char transportStyle[5];
ReadString (transportStyle, s); ReadString (transportStyle, 5, s);
if (!strcmp (transportStyle, "NTCP")) if (!strcmp (transportStyle, "NTCP"))
address.transportStyle = eTransportNTCP; address.transportStyle = eTransportNTCP;
else if (!strcmp (transportStyle, "SSU")) else if (!strcmp (transportStyle, "SSU"))
@ -177,10 +177,10 @@ namespace data
size = be16toh (size); size = be16toh (size);
while (r < size) while (r < size)
{ {
char key[500], value[500]; char key[255], value[255];
r += ReadString (key, s); r += ReadString (key, 255, s);
s.seekg (1, std::ios_base::cur); r++; // = s.seekg (1, std::ios_base::cur); r++; // =
r += ReadString (value, s); r += ReadString (value, 255, s);
s.seekg (1, std::ios_base::cur); r++; // ; s.seekg (1, std::ios_base::cur); r++; // ;
if (!strcmp (key, "host")) if (!strcmp (key, "host"))
{ {
@ -257,16 +257,10 @@ namespace data
size = be16toh (size); size = be16toh (size);
while (r < size) while (r < size)
{ {
#ifdef _WIN32 char key[255], value[255];
char key[500], value[500]; r += ReadString (key, 255, s);
// TODO: investigate why properties get read as one long string under Windows
// length should not be more than 44
#else
char key[50], value[50];
#endif
r += ReadString (key, s);
s.seekg (1, std::ios_base::cur); r++; // = s.seekg (1, std::ios_base::cur); r++; // =
r += ReadString (value, s); r += ReadString (value, 255, s);
s.seekg (1, std::ios_base::cur); r++; // ; s.seekg (1, std::ios_base::cur); r++; // ;
m_Properties[key] = value; m_Properties[key] = value;
@ -348,19 +342,16 @@ namespace data
void RouterInfo::UpdateCapsProperty () void RouterInfo::UpdateCapsProperty ()
{ {
std::string caps; std::string caps;
if (m_Caps & eFloodfill) { if (m_Caps & eFloodfill)
{
if (m_Caps & eExtraBandwidth) caps += CAPS_FLAG_EXTRA_BANDWIDTH1; // 'P'
caps += CAPS_FLAG_HIGH_BANDWIDTH3; // 'O'
caps += CAPS_FLAG_FLOODFILL; // floodfill caps += CAPS_FLAG_FLOODFILL; // floodfill
caps += (m_Caps & eExtraBandwidth) }
? CAPS_FLAG_EXTRA_BANDWIDTH1 // 'P' else
: CAPS_FLAG_HIGH_BANDWIDTH3; // 'O' {
} else { if (m_Caps & eExtraBandwidth) caps += CAPS_FLAG_EXTRA_BANDWIDTH1; // 'P'
if (m_Caps & eExtraBandwidth) { caps += (m_Caps & eHighBandwidth) ? CAPS_FLAG_HIGH_BANDWIDTH3 /* 'O' */: CAPS_FLAG_LOW_BANDWIDTH2 /* 'L' */; // bandwidth
caps += CAPS_FLAG_EXTRA_BANDWIDTH1; // 'P'
} else if (m_Caps & eHighBandwidth) {
caps += CAPS_FLAG_HIGH_BANDWIDTH3; // 'O'
} else {
caps += CAPS_FLAG_LOW_BANDWIDTH2; // 'L'
}
} }
if (m_Caps & eHidden) caps += CAPS_FLAG_HIDDEN; // hidden if (m_Caps & eHidden) caps += CAPS_FLAG_HIDDEN; // hidden
if (m_Caps & eReachable) caps += CAPS_FLAG_REACHABLE; // reachable if (m_Caps & eReachable) caps += CAPS_FLAG_REACHABLE; // reachable
@ -545,16 +536,25 @@ namespace data
return true; return true;
} }
size_t RouterInfo::ReadString (char * str, std::istream& s) size_t RouterInfo::ReadString (char * str, size_t len, std::istream& s) const
{ {
uint8_t len; uint8_t l;
s.read ((char *)&len, 1); s.read ((char *)&l, 1);
s.read (str, len); if (l < len)
str[len] = 0; {
return len+1; s.read (str, l);
str[l] = 0;
}
else
{
LogPrint (eLogWarning, "RouterInfo: string length ", (int)l, " exceeds buffer size ", len);
s.seekg (l, std::ios::cur); // skip
str[0] = 0;
}
return l+1;
} }
void RouterInfo::WriteString (const std::string& str, std::ostream& s) void RouterInfo::WriteString (const std::string& str, std::ostream& s) const
{ {
uint8_t len = str.size (); uint8_t len = str.size ();
s.write ((char *)&len, 1); s.write ((char *)&len, 1);

4
RouterInfo.h

@ -188,8 +188,8 @@ namespace data
void ReadFromStream (std::istream& s); void ReadFromStream (std::istream& s);
void ReadFromBuffer (bool verifySignature); void ReadFromBuffer (bool verifySignature);
void WriteToStream (std::ostream& s) const; void WriteToStream (std::ostream& s) const;
static size_t ReadString (char* str, std::istream& s); size_t ReadString (char* str, size_t len, std::istream& s) const;
static void WriteString (const std::string& str, std::ostream& s); void WriteString (const std::string& str, std::ostream& s) const;
void ExtractCaps (const char * value); void ExtractCaps (const char * value);
std::shared_ptr<const Address> GetAddress (TransportStyle s, bool v4only, bool v6only = false) const; std::shared_ptr<const Address> GetAddress (TransportStyle s, bool v4only, bool v6only = false) const;
void UpdateCapsProperty (); void UpdateCapsProperty ();

32
contrib/certificates/reseed/r4sas_at_mail.i2p.crt

@ -0,0 +1,32 @@
-----BEGIN CERTIFICATE-----
MIIFezCCA2OgAwIBAgIEb8xTzzANBgkqhkiG9w0BAQ0FADBuMQswCQYDVQQGEwJY
WDELMAkGA1UECBMCWFgxHjAcBgNVBAcTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEL
MAkGA1UEChMCWFgxDDAKBgNVBAsTA0kyUDEXMBUGA1UEAwwOcjRzYXNAbWFpbC5p
MnAwHhcNMTYwODExMjIyNDM2WhcNMjYwODExMjIyNDM2WjBuMQswCQYDVQQGEwJY
WDELMAkGA1UECBMCWFgxHjAcBgNVBAcTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEL
MAkGA1UEChMCWFgxDDAKBgNV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UpgSidlN+
JkZmgwAcA3/WMlDdNKmKnWLGB2Ea+W6kIx5TDFfjf11rbjuwXhDLyaOK88qlN0W2
hYa31UDSEYYQd3gMG1gjVc+9vZA/Vr0+SF5ULN9QLjB18CVIdPv92mBjJQRmJSVW
b1qwZI0jf/V+1fu9H9r7sE4CId3+WGOek3UNRNZLOVZCSiFq/b9cswcQZGjw6aE+
1FNjw1HW9CLoNcg74Kr98QouOoeRSofQYZiYqaM9Sz/MsinYMIRGRGw3Uq1uNRo0
WgoOngmZSKGaW5PFR19uuuNIVB4fCShqBVyrguW4xIskta1JVFoggFeOeTwk6/kH
S5roMzyB/kzv83A2IB0VxqbiDj8khgdm1Us6HCCmU+iTRVyG28gFklCJ8dQfxgGH
W2gpIwvxYLyNP14/7E1oF7/NfHmyjAVzYnR5Xw2wE4tvSHuIrHhj6Q26VB3vze6j
E/w1AJEepnw/KfHqS3bw
-----END CERTIFICATE-----

11
debian/changelog vendored

@ -1,3 +1,14 @@
i2pd (2.9.0-1) unstable; urgency=low
* updated to version 2.9.0
* updated tune-patch
* removed I2PD_PORT in i2pd.default
* removed all port assigments in services files
* fixed logrotate
* subscriptions.txt and tunnels.conf taken from docs folder
-- orignal <orignal@i2pmail.org> Fri, 12 Aug 2016 14:25:40 +0000
i2pd (2.7.0-1) unstable; urgency=low i2pd (2.7.0-1) unstable; urgency=low
* updated to version 2.7.0/0.9.25 * updated to version 2.7.0/0.9.25

4
debian/i2pd.default vendored

@ -3,10 +3,6 @@
# installed at /etc/default/i2pd by the maintainer scripts # installed at /etc/default/i2pd by the maintainer scripts
I2PD_ENABLED="yes" I2PD_ENABLED="yes"
# port to listen for incoming connections
# uncomment following line if you want to specify it here
# I2PD_PORT="4567"
# Additional options that are passed to the Daemon. # Additional options that are passed to the Daemon.
# see possible switches in /usr/share/doc/i2pd/configuration.md.gz # see possible switches in /usr/share/doc/i2pd/configuration.md.gz
DAEMON_OPTS="" DAEMON_OPTS=""

8
debian/i2pd.init vendored

@ -41,10 +41,6 @@ do_start()
return 2 return 2
fi fi
if [ -n "$I2PD_PORT" ]; then
DAEMON_OPTS="--port $I2PD_PORT $DAEMON_OPTS"
fi
touch "$PIDFILE" touch "$PIDFILE"
chown -f $USER:adm "$PIDFILE" chown -f $USER:adm "$PIDFILE"
@ -103,7 +99,7 @@ case "$1" in
status) status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;; ;;
reload|force-reload) reload)
log_daemon_msg "Reloading $DESC" "$NAME" log_daemon_msg "Reloading $DESC" "$NAME"
do_reload do_reload
log_end_msg $? log_end_msg $?
@ -127,7 +123,7 @@ case "$1" in
esac esac
;; ;;
*) *)
echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 echo "Usage: $0 {start|stop|status|restart|reload}" >&2
exit 3 exit 3
;; ;;
esac esac

4
debian/i2pd.install vendored

@ -1,5 +1,5 @@
i2pd usr/sbin/ i2pd usr/sbin/
docs/i2pd.conf etc/i2pd/ docs/i2pd.conf etc/i2pd/
debian/tunnels.conf etc/i2pd/ docs/tunnels.conf etc/i2pd/
debian/subscriptions.txt etc/i2pd/ docs/subscriptions.txt etc/i2pd/
contrib/certificates/ usr/share/i2pd/ contrib/certificates/ usr/share/i2pd/

4
debian/i2pd.upstart vendored

@ -4,8 +4,6 @@ start on runlevel [2345]
stop on runlevel [016] or unmounting-filesystem stop on runlevel [016] or unmounting-filesystem
# these can be overridden in /etc/init/i2pd.override # these can be overridden in /etc/init/i2pd.override
env I2PD_HOST="1.2.3.4"
env I2PD_PORT="4567"
env LOGFILE="/var/log/i2pd.log" env LOGFILE="/var/log/i2pd.log"
exec /usr/sbin/i2pd --daemon --log=file --logfile=$LOGFILE --service --host=$I2PD_HOST --port=$I2PD_PORT exec /usr/sbin/i2pd --daemon --service --log=file --logfile=$LOGFILE

18
debian/logrotate vendored

@ -1,13 +1,9 @@
/var/log/i2pd.log { /var/log/i2pd.log {
rotate 4 rotate 6
weekly daily
missingok missingok
notifempty notifempty
compress compress
delaycompress delaycompress
copytruncate copytruncate
create 640 i2pd adm
postrotate
/etc/init.d/i2pd restart >/dev/null
endscript
} }

2
docs/build_notes_unix.md

@ -130,7 +130,7 @@ export CXX=/usr/local/bin/g++47
CMake Options CMake Options
------------- -------------
Available CMake options(each option has a for of `<key>=<value>`, for more information see `man 1 cmake`): Available CMake options(each option has a form of `<key>=<value>`, for more information see `man 1 cmake`):
* `CMAKE_BUILD_TYPE` build profile (Debug/Release) * `CMAKE_BUILD_TYPE` build profile (Debug/Release)
* `WITH_BINARY` build i2pd itself * `WITH_BINARY` build i2pd itself

26
docs/i2pd.conf

@ -35,6 +35,9 @@
## Run as a service. Router will use system folders like ‘/var/lib/i2pd’ ## Run as a service. Router will use system folders like ‘/var/lib/i2pd’
# service = true # service = true
## Specify a family, router belongs to (default - none)
# family =
## External IP address to listen for connections ## External IP address to listen for connections
## By default i2pd sets IP automatically ## By default i2pd sets IP automatically
# host = 1.2.3.4 # host = 1.2.3.4
@ -46,10 +49,20 @@
## Enable communication through ipv4 ## Enable communication through ipv4
ipv4 = true ipv4 = true
## Enable communication through ipv6 ## Enable communication through ipv6
ipv6 = false ipv6 = false
## Network interface to bind to
# ifname =
## Enable NTCP transport (default = true)
# ntcp = true
## Enable SSU transport (default = true)
# ssu = true
## Should we assume we are behind NAT? (false only in MeshNet)
# nat = true
## Bandwidth configuration ## Bandwidth configuration
## L limit bandwidth to 32Kbs/sec, O - to 256Kbs/sec, P - to 2048Kbs/sec, ## L limit bandwidth to 32Kbs/sec, O - to 256Kbs/sec, P - to 2048Kbs/sec,
## X - unlimited ## X - unlimited
@ -71,6 +84,17 @@ ipv6 = false
## By default, enabled on i386 hosts ## By default, enabled on i386 hosts
# elgamal = true # elgamal = true
[upnp]
## Enable or disable UPnP: automatic port forwarding (enabled by default in WINDOWS, ANDROID)
# enabled = false
## Name i2pd appears in UPnP forwardings list (default = I2Pd)
# name = I2Pd
[reseed]
## Path to reseed .su3 file (if )
# file =
[http] [http]
## Uncomment and set to 'false' to disable Web Console ## Uncomment and set to 'false' to disable Web Console
# enabled = true # enabled = true

0
debian/subscriptions.txt → docs/subscriptions.txt

0
debian/tunnels.conf → docs/tunnels.conf

4
filelist.mk

@ -5,11 +5,11 @@ LIB_SRC = \
SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \ SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \
Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \ Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \
Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \ Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \
Config.cpp util.cpp api.cpp Config.cpp HTTP.cpp util.cpp api.cpp
LIB_CLIENT_SRC = \ LIB_CLIENT_SRC = \
AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp \ AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp \
SAM.cpp SOCKS.cpp HTTP.cpp HTTPProxy.cpp I2CP.cpp SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp
# also: Daemon{Linux,Win32}.cpp will be added later # also: Daemon{Linux,Win32}.cpp will be added later
DAEMON_SRC = \ DAEMON_SRC = \

Loading…
Cancel
Save