From 29593f0161c57b3722d84f2f198dbfa7fe8e70d0 Mon Sep 17 00:00:00 2001 From: Manas B Date: Fri, 12 Aug 2016 12:43:59 -0400 Subject: [PATCH 01/25] fix a typo --- docs/build_notes_unix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build_notes_unix.md b/docs/build_notes_unix.md index 228333c8..18e51e62 100644 --- a/docs/build_notes_unix.md +++ b/docs/build_notes_unix.md @@ -130,7 +130,7 @@ export CXX=/usr/local/bin/g++47 CMake Options ------------- -Available CMake options(each option has a for of `=`, for more information see `man 1 cmake`): +Available CMake options(each option has a form of `=`, for more information see `man 1 cmake`): * `CMAKE_BUILD_TYPE` build profile (Debug/Release) * `WITH_BINARY` build i2pd itself From aaa52bd767949edb48fbd0feb5c20a483f8c1f82 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:17:25 +0300 Subject: [PATCH 02/25] Update i2pd.default --- debian/i2pd.default | 4 ---- 1 file changed, 4 deletions(-) diff --git a/debian/i2pd.default b/debian/i2pd.default index 495d7a69..1e5d5c2e 100644 --- a/debian/i2pd.default +++ b/debian/i2pd.default @@ -3,10 +3,6 @@ # installed at /etc/default/i2pd by the maintainer scripts 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. # see possible switches in /usr/share/doc/i2pd/configuration.md.gz DAEMON_OPTS="" From d424e1e9ff910044f0cbf0bc6fb4f98221db72ac Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 12 Aug 2016 15:19:45 -0400 Subject: [PATCH 03/25] Update ChangeLog --- ChangeLog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 520978df..77635666 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,13 @@ # for this file format description, # see https://github.com/olivierlacan/keep-a-changelog -## [2.9.0] - UNRELEASED +## [2.9.0] - 2016-08-12 ### Changed - Proxy refactoring & speedup +- Transmission-I2P support +- Graceful shutdown for Windows +- Android without QT +- Reduced number of timers in SSU ## [2.8.0] - 2016-06-20 ### Added From b83ab85fd90df01810becff8d9c91410c8696780 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:21:33 +0300 Subject: [PATCH 04/25] Update i2pd.init --- debian/i2pd.init | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/debian/i2pd.init b/debian/i2pd.init index 02b37546..32c181bb 100644 --- a/debian/i2pd.init +++ b/debian/i2pd.init @@ -41,10 +41,6 @@ do_start() return 2 fi - if [ -n "$I2PD_PORT" ]; then - DAEMON_OPTS="--port $I2PD_PORT $DAEMON_OPTS" - fi - touch "$PIDFILE" chown -f $USER:adm "$PIDFILE" @@ -103,7 +99,7 @@ case "$1" in status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; - reload|force-reload) + reload) log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? @@ -127,7 +123,7 @@ case "$1" in esac ;; *) - echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 + echo "Usage: $0 {start|stop|status|restart|reload}" >&2 exit 3 ;; esac From 37fef7e4f8707a26682432f3a7f33273e000a20f Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 12 Aug 2016 15:21:55 -0400 Subject: [PATCH 05/25] Update ChangeLog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 77635666..2fdc0082 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ - 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 ### Added From 14a2c9d48f981ec9d8cb8673c4bb83223740ee65 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:28:35 +0300 Subject: [PATCH 06/25] Update i2pd.install --- debian/i2pd.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/i2pd.install b/debian/i2pd.install index 2e3c93cd..57036a79 100644 --- a/debian/i2pd.install +++ b/debian/i2pd.install @@ -1,5 +1,5 @@ i2pd usr/sbin/ docs/i2pd.conf etc/i2pd/ -debian/tunnels.conf etc/i2pd/ -debian/subscriptions.txt etc/i2pd/ +docs/tunnels.conf etc/i2pd/ +docs/subscriptions.txt etc/i2pd/ contrib/certificates/ usr/share/i2pd/ From 8a542f2ce806380b72d6171c180bd53b16da2c34 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:29:32 +0300 Subject: [PATCH 07/25] Update i2pd.upstart --- debian/i2pd.upstart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/i2pd.upstart b/debian/i2pd.upstart index 29c6cbdb..fd2b24f0 100644 --- a/debian/i2pd.upstart +++ b/debian/i2pd.upstart @@ -4,8 +4,6 @@ start on runlevel [2345] stop on runlevel [016] or unmounting-filesystem # 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" -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 From a9b289626ea8ac271b05636c29c70cf03a5733a2 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:30:26 +0300 Subject: [PATCH 08/25] Update logrotate --- debian/logrotate | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/debian/logrotate b/debian/logrotate index a3fed79a..3462c696 100644 --- a/debian/logrotate +++ b/debian/logrotate @@ -1,13 +1,9 @@ /var/log/i2pd.log { - rotate 4 - weekly - missingok - notifempty - compress - delaycompress - copytruncate - create 640 i2pd adm - postrotate - /etc/init.d/i2pd restart >/dev/null - endscript + rotate 6 + daily + missingok + notifempty + compress + delaycompress + copytruncate } From d51ad77ab494ed4a3b36b2af556106567c399833 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:34:29 +0300 Subject: [PATCH 09/25] moved subscriptions.txt --- docs/subscriptions.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/subscriptions.txt diff --git a/docs/subscriptions.txt b/docs/subscriptions.txt new file mode 100644 index 00000000..8f4afb03 --- /dev/null +++ b/docs/subscriptions.txt @@ -0,0 +1,3 @@ +http://inr.i2p/export/alive-hosts.txt +http://stats.i2p/cgi-bin/newhosts.txt +http://i2p-projekt.i2p/hosts.txt From ce13de7d6cc911702c1c932a4f163478223038fa Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:35:09 +0300 Subject: [PATCH 10/25] moved subscriptions.txt --- debian/subscriptions.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 debian/subscriptions.txt diff --git a/debian/subscriptions.txt b/debian/subscriptions.txt deleted file mode 100644 index 8f4afb03..00000000 --- a/debian/subscriptions.txt +++ /dev/null @@ -1,3 +0,0 @@ -http://inr.i2p/export/alive-hosts.txt -http://stats.i2p/cgi-bin/newhosts.txt -http://i2p-projekt.i2p/hosts.txt From 2f1971ea8f91934a7ee7bb45d60d348431bb00d1 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:36:17 +0300 Subject: [PATCH 11/25] moved tunnels.conf --- docs/tunnels.conf | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/tunnels.conf diff --git a/docs/tunnels.conf b/docs/tunnels.conf new file mode 100644 index 00000000..fa92a56b --- /dev/null +++ b/docs/tunnels.conf @@ -0,0 +1,33 @@ +[IRC] +type = client +address = 127.0.0.1 +port = 6668 +destination = irc.postman.i2p +destinationport = 6667 +keys = irc-keys.dat + +#[SMTP] +#type = client +#address = 127.0.0.1 +#port = 7659 +#destination = smtp.postman.i2p +#destinationport = 25 +#keys = smtp-keys.dat + +#[POP3] +#type = client +#address = 127.0.0.1 +#port = 7660 +#destination = pop.postman.i2p +#destinationport = 110 +#keys = pop3-keys.dat + +#[MTN] +#type = client +#address = 127.0.0.1 +#port = 8998 +#destination = mtn.i2p-projekt.i2p +#destinationport = 4691 +#keys = mtn-keys.dat + +# see more examples in /usr/share/doc/i2pd/configuration.md.gz From 7a692898e4a509ad99aee5f44e380c05482a995f Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:36:31 +0300 Subject: [PATCH 12/25] moved tunnels.conf --- debian/tunnels.conf | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 debian/tunnels.conf diff --git a/debian/tunnels.conf b/debian/tunnels.conf deleted file mode 100644 index fa92a56b..00000000 --- a/debian/tunnels.conf +++ /dev/null @@ -1,33 +0,0 @@ -[IRC] -type = client -address = 127.0.0.1 -port = 6668 -destination = irc.postman.i2p -destinationport = 6667 -keys = irc-keys.dat - -#[SMTP] -#type = client -#address = 127.0.0.1 -#port = 7659 -#destination = smtp.postman.i2p -#destinationport = 25 -#keys = smtp-keys.dat - -#[POP3] -#type = client -#address = 127.0.0.1 -#port = 7660 -#destination = pop.postman.i2p -#destinationport = 110 -#keys = pop3-keys.dat - -#[MTN] -#type = client -#address = 127.0.0.1 -#port = 8998 -#destination = mtn.i2p-projekt.i2p -#destinationport = 4691 -#keys = mtn-keys.dat - -# see more examples in /usr/share/doc/i2pd/configuration.md.gz From 774c11781d15ac96a3d2e3ae62e1f8255a1a820f Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 22:47:20 +0300 Subject: [PATCH 13/25] Update changelog --- debian/changelog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5ac732e0..f1f9cb41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +i2pd (2.9.0-1) unstable; urgency=low + + ** Changed + * 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 + + -- orignal Fri, 12 Aug 2016 14:25:40 +0000 + i2pd (2.7.0-1) unstable; urgency=low * updated to version 2.7.0/0.9.25 From ca7709a284f718776bfe89a3b5fdab9355ce74be Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Fri, 12 Aug 2016 23:23:10 +0300 Subject: [PATCH 14/25] Update i2pd.conf --- docs/i2pd.conf | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/i2pd.conf b/docs/i2pd.conf index 16314274..94287bd0 100644 --- a/docs/i2pd.conf +++ b/docs/i2pd.conf @@ -35,6 +35,9 @@ ## Run as a service. Router will use system folders like ‘/var/lib/i2pd’ # service = true +## Specify a family, router belongs to (default - none) +# family = + ## External IP address to listen for connections ## By default i2pd sets IP automatically # host = 1.2.3.4 @@ -46,10 +49,20 @@ ## Enable communication through ipv4 ipv4 = true - ## Enable communication through ipv6 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 ## L limit bandwidth to 32Kbs/sec, O - to 256Kbs/sec, P - to 2048Kbs/sec, ## X - unlimited @@ -71,6 +84,17 @@ ipv6 = false ## By default, enabled on i386 hosts # 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] ## Uncomment and set to 'false' to disable Web Console # enabled = true From c86bcb4dd6f571e0a1d58b8a13f488f2c313fdbb Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 13 Aug 2016 08:23:32 -0400 Subject: [PATCH 15/25] r4sas_at_mail.i2p.crt added --- .../certificates/reseed/r4sas_at_mail.i2p.crt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 contrib/certificates/reseed/r4sas_at_mail.i2p.crt diff --git a/contrib/certificates/reseed/r4sas_at_mail.i2p.crt b/contrib/certificates/reseed/r4sas_at_mail.i2p.crt new file mode 100644 index 00000000..b0c8d749 --- /dev/null +++ b/contrib/certificates/reseed/r4sas_at_mail.i2p.crt @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFezCCA2OgAwIBAgIEb8xTzzANBgkqhkiG9w0BAQ0FADBuMQswCQYDVQQGEwJY +WDELMAkGA1UECBMCWFgxHjAcBgNVBAcTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEL +MAkGA1UEChMCWFgxDDAKBgNVBAsTA0kyUDEXMBUGA1UEAwwOcjRzYXNAbWFpbC5p +MnAwHhcNMTYwODExMjIyNDM2WhcNMjYwODExMjIyNDM2WjBuMQswCQYDVQQGEwJY +WDELMAkGA1UECBMCWFgxHjAcBgNVBAcTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEL +MAkGA1UEChMCWFgxDDAKBgNVBAsTA0kyUDEXMBUGA1UEAwwOcjRzYXNAbWFpbC5p +MnAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDjUMy/aYd0i6Oc3rdc +24V/fM2vhviH+cNhAOXsMSrwDSVbFQkuDPIfq4fo1A25rsyULR57vy7XKA51OstX +GvREPDhth4cMZjthq0f8AVzPq2vIk8Po65uvKR190yupPQ4FhvGeRkHkqp+SqoIJ +lClD8xZEHrUHSYZotm5TLWIgSwa4DuO1q3bMRI8oIWzqhv99FtlmHlC8fjVUN4mR +2czhABr0u6RMPOtJwTVxWgT1PKXiLWfmeHb63TcPYGgpJ39iMDOjtgY9jYueoO8J +uGJJtkGRIRjOuhDFE9NUlNnljUxUDWvMU7zCO4ozaKMZgoxr1WoIO6ubI/003I53 +sZ0Q5h8yfz+QreEw3wzjxnQSkejG5c3NIvJSiu0ylOqDWmnj0v1Jv/P0qAMU4bt/ +ZWj0GOrYfPn9STg0VxMOQwQ2o15GAcbr6PFI56U2IJhZAeER3hIe2kOl6591jQ67 +zvOjPRRh2q05Ss8yo7nEpYUiB/FrE6RssJ5tVwX6e6Tq4Z1frINanIkUkToTkypP +Fn2T/KV2lak9rLuxzvhiDobu5iGCR323zFcFEpGq4Wsopx1uRT9+71G/ejw8pKTf +kQ7XiGaaxFyZuMuOz3bFkTuoTmAkUQTlRjGw2DmKZi/apcN+VQgpq9tQpS10pEUy +DCVdtw1AdlOnwb+Hf3X0Uz6OjwIDAQABoyEwHzAdBgNVHQ4EFgQUqLBlSlnqCo25 +sIduMPm4iROMqkAwDQYJKoZIhvcNAQENBQADggIBAGWv8rDTzqhHkjqDOT+Ba2bs +gVddpCNa94RQoOn2DUSu4c+yuWJLSctjpX7gswB6qvWk5Ojfafop8jJW8zuozJrO +76b9345S/VnnbHVSoVfIpF9Fve1Xc8nvU4ylRcAMwhf8N3Md5Yc1kb+P7NtTTwMZ +TBR3xY3fVxv3qTpKApWQKkUiqM7yJKOfS8xcK/pjO/3oRUwfA9DHugCUpgSidlN+ +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----- From 4631123231d57c26053e10626d13e223406416c6 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 13 Aug 2016 09:05:35 -0400 Subject: [PATCH 16/25] reseed-ru.lngserv.ru added --- Reseed.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Reseed.cpp b/Reseed.cpp index bac381b1..48d7a53f 100644 --- a/Reseed.cpp +++ b/Reseed.cpp @@ -30,15 +30,16 @@ namespace data #else // mainline i2p reseeds "https://reseed.i2p-projekt.de/", // Only HTTPS - "https://i2p.mooo.com/netDb/", - "https://netdb.i2p2.no/", // Only SU3 (v3) support, SNI required + "https://i2p.mooo.com/netDb/", + "https://netdb.i2p2.no/", // Only SU3 (v3) support, SNI required "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-0.manas.ca:8443/", - "https://reseed.i2p.vzaws.com:8443/", // Only SU3 (v3) support - "https://user.mx24.eu/", // Only HTTPS and SU3 (v3) support - "https://download.xxlspeed.com/" // Only HTTPS and SU3 (v3) support + "https://reseed.i2p.vzaws.com:8443/", // Only SU3 (v3) support + "https://user.mx24.eu/", // Only HTTPS and SU3 (v3) support + "https://download.xxlspeed.com/", // Only HTTPS and SU3 (v3) support + "https://reseed-ru.lngserv.ru/" #endif }; From 049e1b26799a68cd8bf1ca054adbd44cd52e064c Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Sat, 13 Aug 2016 16:50:08 +0300 Subject: [PATCH 17/25] Update changelog --- debian/changelog | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index f1f9cb41..c308c689 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,11 @@ i2pd (2.9.0-1) unstable; urgency=low - ** Changed - * 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 - + * updated to version 2.9.0 + * 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 Fri, 12 Aug 2016 14:25:40 +0000 i2pd (2.7.0-1) unstable; urgency=low From 73452f758c1b480e4251b8c2c3c4d39831899747 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Sat, 13 Aug 2016 16:52:27 +0300 Subject: [PATCH 18/25] Update changelog --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index c308c689..fe04c1b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ i2pd (2.9.0-1) unstable; urgency=low * updated to version 2.9.0 + * updated tuner-patch * removed I2PD_PORT in i2pd.default * removed all port assigments in services files * fixed logrotate From 72ef621f9d32ab57df76ad7335a6629572a32993 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Sat, 13 Aug 2016 16:52:51 +0300 Subject: [PATCH 19/25] Update changelog --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fe04c1b4..6600f8e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ i2pd (2.9.0-1) unstable; urgency=low * updated to version 2.9.0 - * updated tuner-patch + * updated tune-patch * removed I2PD_PORT in i2pd.default * removed all port assigments in services files * fixed logrotate From bf4f22b203efe88df430720392e40c13972f66c6 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 14 Aug 2016 17:52:11 -0400 Subject: [PATCH 20/25] add 'O' to extra bandwidth --- RouterInfo.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/RouterInfo.cpp b/RouterInfo.cpp index 90cf5e44..b4a10be2 100644 --- a/RouterInfo.cpp +++ b/RouterInfo.cpp @@ -348,19 +348,15 @@ namespace data void RouterInfo::UpdateCapsProperty () { std::string caps; - if (m_Caps & eFloodfill) { + if (m_Caps & eFloodfill) + { caps += CAPS_FLAG_FLOODFILL; // floodfill - caps += (m_Caps & eExtraBandwidth) - ? CAPS_FLAG_EXTRA_BANDWIDTH1 // 'P' - : CAPS_FLAG_HIGH_BANDWIDTH3; // 'O' - } else { - if (m_Caps & eExtraBandwidth) { - caps += CAPS_FLAG_EXTRA_BANDWIDTH1; // 'P' - } else if (m_Caps & eHighBandwidth) { - caps += CAPS_FLAG_HIGH_BANDWIDTH3; // 'O' - } else { - caps += CAPS_FLAG_LOW_BANDWIDTH2; // 'L' - } + caps += (m_Caps & eExtraBandwidth)? CAPS_FLAG_EXTRA_BANDWIDTH1 /* 'P' */ : CAPS_FLAG_HIGH_BANDWIDTH3 /* 'O' */; + } + else + { + if (m_Caps & eExtraBandwidth) caps += CAPS_FLAG_EXTRA_BANDWIDTH1; // 'P' + caps += (m_Caps & eHighBandwidth) ? CAPS_FLAG_HIGH_BANDWIDTH3 /* 'O' */: CAPS_FLAG_LOW_BANDWIDTH2 /* 'L' */; // bandwidth } if (m_Caps & eHidden) caps += CAPS_FLAG_HIDDEN; // hidden if (m_Caps & eReachable) caps += CAPS_FLAG_REACHABLE; // reachable From cb7efcb1884fe0a74e505b78651310f0e0dd5e9c Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 14 Aug 2016 17:58:50 -0400 Subject: [PATCH 21/25] add 'O' to extra bandwidth for flooadfill --- RouterInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RouterInfo.cpp b/RouterInfo.cpp index b4a10be2..625db5cb 100644 --- a/RouterInfo.cpp +++ b/RouterInfo.cpp @@ -350,8 +350,9 @@ namespace data std::string caps; 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 += (m_Caps & eExtraBandwidth)? CAPS_FLAG_EXTRA_BANDWIDTH1 /* 'P' */ : CAPS_FLAG_HIGH_BANDWIDTH3 /* 'O' */; } else { From de29abb05cf1be0ad09d5c277e4aa701761fb16d Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 15 Aug 2016 13:12:56 -0400 Subject: [PATCH 22/25] check string buffer size --- RouterInfo.cpp | 43 +++++++++++++++++++++++-------------------- RouterInfo.h | 4 ++-- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/RouterInfo.cpp b/RouterInfo.cpp index 625db5cb..130355b8 100644 --- a/RouterInfo.cpp +++ b/RouterInfo.cpp @@ -163,7 +163,7 @@ namespace data s.read ((char *)&address.cost, sizeof (address.cost)); s.read ((char *)&address.date, sizeof (address.date)); char transportStyle[5]; - ReadString (transportStyle, s); + ReadString (transportStyle, 5, s); if (!strcmp (transportStyle, "NTCP")) address.transportStyle = eTransportNTCP; else if (!strcmp (transportStyle, "SSU")) @@ -177,10 +177,10 @@ namespace data size = be16toh (size); while (r < size) { - char key[500], value[500]; - r += ReadString (key, s); + char key[255], value[255]; + r += ReadString (key, 255, s); 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++; // ; if (!strcmp (key, "host")) { @@ -257,16 +257,10 @@ namespace data size = be16toh (size); while (r < size) { -#ifdef _WIN32 - char key[500], value[500]; - // 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); + char key[255], value[255]; + r += ReadString (key, 255, s); 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++; // ; m_Properties[key] = value; @@ -542,16 +536,25 @@ namespace data 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; - s.read ((char *)&len, 1); - s.read (str, len); - str[len] = 0; - return len+1; + uint8_t l; + s.read ((char *)&l, 1); + if (l < len) + { + 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 (); s.write ((char *)&len, 1); diff --git a/RouterInfo.h b/RouterInfo.h index 16937b5b..f4c077ef 100644 --- a/RouterInfo.h +++ b/RouterInfo.h @@ -188,8 +188,8 @@ namespace data void ReadFromStream (std::istream& s); void ReadFromBuffer (bool verifySignature); void WriteToStream (std::ostream& s) const; - static size_t ReadString (char* str, std::istream& s); - static void WriteString (const std::string& str, std::ostream& s); + size_t ReadString (char* str, size_t len, std::istream& s) const; + void WriteString (const std::string& str, std::ostream& s) const; void ExtractCaps (const char * value); std::shared_ptr GetAddress (TransportStyle s, bool v4only, bool v6only = false) const; void UpdateCapsProperty (); From a527dcd95b9aa5e9cc9ba5c705611fdb984d36ac Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 15 Aug 2016 14:01:57 -0400 Subject: [PATCH 23/25] moved HTTP to libi2pd --- filelist.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filelist.mk b/filelist.mk index f2f4937e..db243866 100644 --- a/filelist.mk +++ b/filelist.mk @@ -5,11 +5,11 @@ LIB_SRC = \ SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \ Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.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 = \ 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 DAEMON_SRC = \ From 03f0ca965ea804216bdc681f9093d1df2a0f76ed Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 15 Aug 2016 22:36:58 -0400 Subject: [PATCH 24/25] fixed race condition --- NetDbRequests.cpp | 25 ++++++++++++++++--------- NetDbRequests.h | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/NetDbRequests.cpp b/NetDbRequests.cpp index c3966597..474d3693 100644 --- a/NetDbRequests.cpp +++ b/NetDbRequests.cpp @@ -68,8 +68,7 @@ namespace data dest->SetRequestComplete (requestComplete); { std::unique_lock l(m_RequestedDestinationsMutex); - if (!m_RequestedDestinations.insert (std::make_pair (destination, - std::shared_ptr (dest))).second) // not inserted + if (!m_RequestedDestinations.insert (std::make_pair (destination, dest)).second) // not inserted return nullptr; } return dest; @@ -77,20 +76,28 @@ namespace data void NetDbRequests::RequestComplete (const IdentHash& ident, std::shared_ptr r) { - auto it = m_RequestedDestinations.find (ident); - if (it != m_RequestedDestinations.end ()) - { + std::shared_ptr request; + { + std::unique_lock 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) - it->second->Success (r); + request->Success (r); else - it->second->Fail (); - std::unique_lock l(m_RequestedDestinationsMutex); - m_RequestedDestinations.erase (it); + request->Fail (); } } std::shared_ptr NetDbRequests::FindRequest (const IdentHash& ident) const { + std::unique_lock l(m_RequestedDestinationsMutex); auto it = m_RequestedDestinations.find (ident); if (it != m_RequestedDestinations.end ()) return it->second; diff --git a/NetDbRequests.h b/NetDbRequests.h index 0bab7080..debf1273 100644 --- a/NetDbRequests.h +++ b/NetDbRequests.h @@ -59,7 +59,7 @@ namespace data private: - std::mutex m_RequestedDestinationsMutex; + mutable std::mutex m_RequestedDestinationsMutex; std::map > m_RequestedDestinations; }; } From 2e74d91ddc1a776692dd7398e0126a6bd1f2a92a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 16 Aug 2016 10:25:56 -0400 Subject: [PATCH 25/25] try fixing https://github.com/PurpleI2P/i2pd/issues/612 --- build/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 7f9b8c66..99d6a5ad 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -369,7 +369,10 @@ if (WITH_BINARY) if (MSYS OR MINGW) set (MINGW_EXTRA -lws2_32 -lmswsock -liphlpapi ) endif () - target_link_libraries( "${PROJECT_NAME}" libi2pd i2pdclient ${DL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MINGW_EXTRA} ) + if (WITH_STATIC) + set(DL_LIB ${CMAKE_DL_LIBS}) + endif() + target_link_libraries( "${PROJECT_NAME}" libi2pd i2pdclient ${DL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MINGW_EXTRA} ${DL_LIB}) install(TARGETS "${PROJECT_NAME}" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime) set (APPS "\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")