[tor-commits] [metrics-web/master] Update Onionoo specification for version 6.0.

2018-04-23 Thread karsten
commit 1ec5da2243334c27b95cf7011ae428c78c1010e0
Author: Karsten Loesing 
Date:   Tue Apr 17 15:04:58 2018 +0200

Update Onionoo specification for version 6.0.
---
 src/main/resources/web/jsps/onionoo.jsp | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/web/jsps/onionoo.jsp 
b/src/main/resources/web/jsps/onionoo.jsp
index 540ca23..b225732 100644
--- a/src/main/resources/web/jsps/onionoo.jsp
+++ b/src/main/resources/web/jsps/onionoo.jsp
@@ -304,9 +304,8 @@ required fields on March 14, 2018.
 Added "version_status" field to details documents on April 6, 2018.
 #
 6.0
-(scheduled, but not deployed yet!): Include all exit addresses in
-"exit_addresses", regardless of whether they're used as OR addresses or not, to
-be deployed after April 14, 2018.
+Included all exit addresses in "exit_addresses", regardless of whether they are
+used as onion-routing addresses or not on April 17, 2018.
 #
 
 
@@ -1053,7 +1052,7 @@ IPv6 hex characters are all lower-case.
 
 
 
-exit_addresses
+exit_addresses updated
 array of strings
 optional
 #
@@ -1061,9 +1060,9 @@ IPv6 hex characters are all lower-case.
 Array of IPv4 or IPv6 addresses that the
 relay used to exit to the Internet in the past 24 hours.
 IPv6 hex characters are all lower-case.
-Only those addresses are listed that are different from onion-routing
-addresses.
 Omitted if array is empty.
+Changed on April 17, 2018 to include all exit addresses, regardless of whether
+they are used as onion-routing addresses or not.
 
 
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [webwml/master] Update press clips

2018-04-23 Thread hiro
commit f20a59e8c65ed8cf704c39a95666735dc6472842
Author: hiro 
Date:   Mon Apr 23 10:51:23 2018 +0200

Update press clips
---
 press/en/press.wml | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/press/en/press.wml b/press/en/press.wml
index 7954c480..bf789dd9 100644
--- a/press/en/press.wml
+++ b/press/en/press.wml
@@ -50,6 +50,36 @@ some of the significant Tor-related stories that have popped 
up.
 
 
 
+
+2018 Apr 2
+Digital Trends
+https://www.digitaltrends.com/home/alexa-voice-charity-donation/;>Raise 
your voice for a good cause
+
+
+
+2018 Mar 19
+Mozilla
+https://medium.com/read-write-participate/welcoming-11-new-partners-in-the-quest-for-internet-health-843c8d1b2bf9;>11
 New Partners in Quest for Internet Health
+
+
+
+2018 Mar 15
+Tom's Hardware
+https://www.tomshardware.com/news/turkey-blocks-protonmail-encrypted-email,36675.html;>Turkey
 Blocks ProtonMail E2E Encrypted Email Service
+
+
+
+2018 Feb 22
+CyberScoop
+https://www.cyberscoop.com/shari-steele-tor-director-resigns;>Tor 
executive director Shari Steele to step down
+
+
+
+2018 Feb 22
+The Verge
+https://www.theverge.com/2018/2/22/17042544/tor-director-shari-steele-steps-down;>Tor
 director Shari Steele steps down
+
+
 
 2018 Feb 3
 WIRED

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Document default for ControlSocket.

2018-04-23 Thread nickm
commit 8c01aee2e3b8970af96f5b1a662bdf80d0e22489
Author: Nick Mathewson 
Date:   Mon Apr 23 07:47:01 2018 -0400

Document default for ControlSocket.

Closes 25897.
---
 doc/tor.1.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 05a612d6a..594dedf39 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -368,7 +368,8 @@ GENERAL OPTIONS
 
 [[ControlSocket]] **ControlSocket** __Path__::
 Like ControlPort, but listens on a Unix domain socket, rather than a TCP
-socket. '0' disables ControlSocket (Unix and Unix-like systems only.)
+socket. '0' disables ControlSocket. (Unix and Unix-like systems only.)
+(Default: 0)
 
 [[ControlSocketsGroupWritable]] **ControlSocketsGroupWritable** **0**|**1**::
 If this option is set to 0, don't allow the filesystem group to read and

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [torspec/master] Merge remote-tracking branch 'catalyst/spelling'

2018-04-23 Thread dgoulet
commit d88afa188ed10d30e43b3377ff0c8a47ac4916e9
Merge: fb33ac2 913d724
Author: David Goulet 
Date:   Mon Apr 23 08:39:46 2018 -0400

Merge remote-tracking branch 'catalyst/spelling'

 control-spec.txt | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Add GETINFO current-time/{local, utc} regression test

2018-04-23 Thread nickm
commit 3a6e37f57f599fe4c94a17422c8e41a7bbe06616
Author: Neel Chauhan 
Date:   Mon Apr 16 20:35:45 2018 -0400

Add GETINFO current-time/{local,utc} regression test
---
 src/test/test_controller.c | 56 ++
 1 file changed, 56 insertions(+)

diff --git a/src/test/test_controller.c b/src/test/test_controller.c
index 1c285bb3a..3b58a78e1 100644
--- a/src/test/test_controller.c
+++ b/src/test/test_controller.c
@@ -1470,6 +1470,61 @@ test_download_status_bridge(void *arg)
   return;
 }
 
+/** Set timeval to a mock date and time. This is neccessary
+ * to make tor_gettimeofday() mockable. */
+static void
+mock_tor_gettimeofday(struct timeval *timeval)
+{
+  timeval->tv_sec = 1523405073;
+  timeval->tv_usec = 271645;
+}
+
+static void
+test_current_time(void *arg)
+{
+  /* We just need one of these to pass, it doesn't matter what's in it */
+  control_connection_t dummy;
+  /* Get results out */
+  char *answer = NULL;
+  const char *errmsg = NULL;
+
+  (void)arg;
+
+  /* We need these for storing the (mock) time. */
+  MOCK(tor_gettimeofday, mock_tor_gettimeofday);
+  struct timeval now;
+  tor_gettimeofday();
+  char timebuf[ISO_TIME_LEN+1];
+
+  /* Case 1 - local time */
+  format_local_iso_time_nospace(timebuf, (time_t)now.tv_sec);
+  getinfo_helper_current_time(,
+  "current-time/local",
+  , );
+  tt_ptr_op(answer, OP_NE, NULL);
+  tt_ptr_op(errmsg, OP_EQ, NULL);
+  tt_str_op(answer, OP_EQ, timebuf);
+  tor_free(answer);
+  errmsg = NULL;
+
+  /* Case 2 - UTC time */
+  format_iso_time_nospace(timebuf, (time_t)now.tv_sec);
+  getinfo_helper_current_time(,
+  "current-time/utc",
+  , );
+  tt_ptr_op(answer, OP_NE, NULL);
+  tt_ptr_op(errmsg, OP_EQ, NULL);
+  tt_str_op(answer, OP_EQ, timebuf);
+  tor_free(answer);
+  errmsg = NULL;
+
+ done:
+  UNMOCK(tor_gettimeofday);
+  tor_free(answer);
+
+  return;
+}
+
 struct testcase_t controller_tests[] = {
   { "add_onion_helper_keyarg_v2", test_add_onion_helper_keyarg_v2, 0,
 NULL, NULL },
@@ -1486,6 +1541,7 @@ struct testcase_t controller_tests[] = {
 NULL },
   { "download_status_desc", test_download_status_desc, 0, NULL, NULL },
   { "download_status_bridge", test_download_status_bridge, 0, NULL, NULL },
+  { "current_time", test_current_time, 0, NULL, NULL },
   END_OF_TESTCASES
 };
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'neel/b25511-r4'

2018-04-23 Thread nickm
commit cd3fc2aa4867e89877bbfb99f4f767d761b91f25
Merge: 8c01aee2e dca36eff8
Author: Nick Mathewson 
Date:   Mon Apr 23 09:13:24 2018 -0400

Merge remote-tracking branch 'neel/b25511-r4'

 changes/ticket25511|  5 +
 src/common/compat_time.c   |  4 ++--
 src/common/compat_time.h   |  2 +-
 src/common/util.c  |  9 
 src/common/util.h  |  1 +
 src/or/control.c   | 28 +++
 src/or/control.h   |  4 
 src/test/test_controller.c | 56 ++
 8 files changed, 106 insertions(+), 3 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Make tor_gettimeofday() mockable

2018-04-23 Thread nickm
commit ce84de39efc09142d36d5b94963b1aeb2c0a1ae9
Author: Neel Chauhan 
Date:   Mon Apr 16 20:18:40 2018 -0400

Make tor_gettimeofday() mockable
---
 src/common/compat_time.c | 4 ++--
 src/common/compat_time.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/common/compat_time.c b/src/common/compat_time.c
index b940447b6..966216768 100644
--- a/src/common/compat_time.c
+++ b/src/common/compat_time.c
@@ -71,8 +71,8 @@ tor_sleep_msec(int msec)
 /** Set *timeval to the current time of day.  On error, log and terminate.
  * (Same as gettimeofday(timeval,NULL), but never returns -1.)
  */
-void
-tor_gettimeofday(struct timeval *timeval)
+MOCK_IMPL(void,
+tor_gettimeofday, (struct timeval *timeval))
 {
 #ifdef _WIN32
   /* Epoch bias copied from perl: number of units between windows epoch and
diff --git a/src/common/compat_time.h b/src/common/compat_time.h
index 75b57f6f2..09dd6add3 100644
--- a/src/common/compat_time.h
+++ b/src/common/compat_time.h
@@ -173,7 +173,7 @@ void monotime_coarse_add_msec(monotime_coarse_t *out,
 #define monotime_coarse_add_msec monotime_add_msec
 #endif /* defined(MONOTIME_COARSE_TYPE_IS_DIFFERENT) */
 
-void tor_gettimeofday(struct timeval *timeval);
+MOCK_DECL(void, tor_gettimeofday, (struct timeval *timeval));
 
 #ifdef TOR_UNIT_TESTS
 void tor_sleep_msec(int msec);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Add changes file for GETINFO current-time/{local, utc}

2018-04-23 Thread nickm
commit dca36eff8fbe9307aa2f74d26841399537e11406
Author: Neel Chauhan 
Date:   Mon Apr 16 20:36:28 2018 -0400

Add changes file for GETINFO current-time/{local,utc}
---
 changes/ticket25511 | 5 +
 1 file changed, 5 insertions(+)

diff --git a/changes/ticket25511 b/changes/ticket25511
new file mode 100644
index 0..0a24e265c
--- /dev/null
+++ b/changes/ticket25511
@@ -0,0 +1,5 @@
+  o Minor features (control port):
+- Introduce GETINFO "current-time/{local,utc}" to return the local
+  and UTC times respectively in ISO format. This helps a controller
+  like Tor Browser detect a time-related error. Closes ticket 25511.
+  Patch by Neel Chauhan.



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Add format_local_iso_time_nospace()

2018-04-23 Thread nickm
commit 9e3e1b8bfb7739d3add782a9f2fe7242ec9a36ae
Author: Neel Chauhan 
Date:   Mon Apr 16 20:14:49 2018 -0400

Add format_local_iso_time_nospace()
---
 src/common/util.c | 9 +
 src/common/util.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/common/util.c b/src/common/util.c
index 041e7aee3..b7516b8b6 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1821,6 +1821,15 @@ format_iso_time(char *buf, time_t t)
   strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S", tor_gmtime_r(, ));
 }
 
+/** As format_local_iso_time, but use the -mm-ddThh:mm:ss format to avoid
+ * embedding an internal space. */
+void
+format_local_iso_time_nospace(char *buf, time_t t)
+{
+  format_local_iso_time(buf, t);
+  buf[10] = 'T';
+}
+
 /** As format_iso_time, but use the -mm-ddThh:mm:ss format to avoid
  * embedding an internal space. */
 void
diff --git a/src/common/util.h b/src/common/util.h
index ae27e5f01..5708b7fd8 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -269,6 +269,7 @@ int parse_rfc1123_time(const char *buf, time_t *t);
 #define ISO_TIME_USEC_LEN (ISO_TIME_LEN+7)
 void format_local_iso_time(char *buf, time_t t);
 void format_iso_time(char *buf, time_t t);
+void format_local_iso_time_nospace(char *buf, time_t t);
 void format_iso_time_nospace(char *buf, time_t t);
 void format_iso_time_nospace_usec(char *buf, const struct timeval *tv);
 int parse_iso_time_(const char *cp, time_t *t, int strict, int nospace);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Add GETINFO current-time/{local, utc} command to ControlPort

2018-04-23 Thread nickm
commit e72742d693827a747ad405eb81422d6ee9fd691b
Author: Neel Chauhan 
Date:   Mon Apr 16 20:16:37 2018 -0400

Add GETINFO current-time/{local,utc} command to ControlPort
---
 src/or/control.c | 28 
 src/or/control.h |  4 
 2 files changed, 32 insertions(+)

diff --git a/src/or/control.c b/src/or/control.c
index 0539ddaca..72122eaaf 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1931,6 +1931,31 @@ getinfo_helper_listeners(control_connection_t 
*control_conn,
   return 0;
 }
 
+/** Implementation helper for GETINFO: answers requests for information about
+ * the current time in both local and UTF forms. */
+STATIC int
+getinfo_helper_current_time(control_connection_t *control_conn,
+ const char *question,
+ char **answer, const char **errmsg)
+{
+  (void)control_conn;
+  (void)errmsg;
+
+  struct timeval now;
+  tor_gettimeofday();
+  char timebuf[ISO_TIME_LEN+1];
+
+  if (!strcmp(question, "current-time/local"))
+format_local_iso_time_nospace(timebuf, (time_t)now.tv_sec);
+  else if (!strcmp(question, "current-time/utc"))
+format_iso_time_nospace(timebuf, (time_t)now.tv_sec);
+  else
+return 0;
+
+  *answer = tor_strdup(timebuf);
+  return 0;
+}
+
 /** Implementation helper for GETINFO: knows the answers for questions about
  * directory information. */
 STATIC int
@@ -3073,6 +3098,9 @@ static const getinfo_item_t getinfo_items[] = {
   DOC("config/defaults",
   "List of default values for configuration options. "
   "See also config/names"),
+  PREFIX("current-time/", current_time, "Current time."),
+  DOC("current-time/local", "Current time on the local system."),
+  DOC("current-time/utc", "Current UTC time."),
   PREFIX("downloads/networkstatus/", downloads,
  "Download statuses for networkstatus objects"),
   DOC("downloads/networkstatus/ns",
diff --git a/src/or/control.h b/src/or/control.h
index 2fd3c553f..2f312a663 100644
--- a/src/or/control.h
+++ b/src/or/control.h
@@ -311,6 +311,10 @@ STATIC int getinfo_helper_dir(
 control_connection_t *control_conn,
 const char *question, char **answer,
 const char **errmsg);
+STATIC int getinfo_helper_current_time(
+control_connection_t *control_conn,
+const char *question, char **answer,
+const char **errmsg);
 
 #endif /* defined(CONTROL_PRIVATE) */
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge branch 'maint-0.3.1' into maint-0.3.2

2018-04-23 Thread nickm
commit 1438c6c7134c53b2aa3b5e9abf94fe12a4d9bd5e
Merge: f0230ee38 5c3639923
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.2.9] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.1] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.1] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2018-04-23 Thread nickm
commit ecb51bf9f347ac7c1cf5b716543e0f79f0c50100
Merge: 65fd97375 1438c6c71
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.3'

2018-04-23 Thread nickm
commit c5ffcbb43f3e444a3e7f7f22057a5fee8958e569
Merge: cd3fc2aa4 beb321d8c
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.3'

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-04-23 Thread nickm
commit e8683bcbb19318fcd9df04464296d6581adc959d
Merge: cb813a352 1438c6c71
Author: Nick Mathewson 
Date:   Mon Apr 23 09:24:33 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'maint-0.3.1' into maint-0.3.2

2018-04-23 Thread nickm
commit 1438c6c7134c53b2aa3b5e9abf94fe12a4d9bd5e
Merge: f0230ee38 5c3639923
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-04-23 Thread nickm
commit e8683bcbb19318fcd9df04464296d6581adc959d
Merge: cb813a352 1438c6c71
Author: Nick Mathewson 
Date:   Mon Apr 23 09:24:33 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.3.1' into maint-0.3.2

2018-04-23 Thread nickm
commit 1438c6c7134c53b2aa3b5e9abf94fe12a4d9bd5e
Merge: f0230ee38 5c3639923
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.1' into maint-0.3.2

2018-04-23 Thread nickm
commit 1438c6c7134c53b2aa3b5e9abf94fe12a4d9bd5e
Merge: f0230ee38 5c3639923
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-04-23 Thread nickm
commit beb321d8cdd6e7a2f0b9a0a4758cd71768531959
Merge: 44aa586de 1438c6c71
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.3.1' into release-0.3.1

2018-04-23 Thread nickm
commit 28dc7a519c712913b8ad0581ac9ee5f875ad27b3
Merge: 02ac1822a 5c3639923
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.1' into release-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.1] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.2.9] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge branch 'maint-0.2.9' into maint-0.3.1

2018-04-23 Thread nickm
commit 5c3639923fb3d7a1bfc7b38248001e67333fa35e
Merge: ce8e7427b 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Permit the nanosleep system call in the seccomp2 callbox

2018-04-23 Thread nickm
commit c4be6dfeabc8d42ecb6ccea8ca44d1ff0835071a
Author: Nick Mathewson 
Date:   Wed Apr 18 10:25:42 2018 -0400

Permit the nanosleep system call in the seccomp2 callbox

Fixes bug 24969; bugfix on 0.2.5.1-alpha when the sandbox was introduced.
---
 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug24969 b/changes/bug24969
new file mode 100644
index 0..46b2bae6f
--- /dev/null
+++ b/changes/bug24969
@@ -0,0 +1,3 @@
+  o Minor bugfixes (Linux seccomp2 sandbox):
+- Allow the nanosleep() system call, which glibc uses to implement
+  sleep() and usleep(). Fixes bug 24969; bugfix on 0.2.5.1-alpha.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 87fe08e88..3d27ea66b 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -185,6 +185,9 @@ static int filter_nopar_gen[] = {
 SCMP_SYS(mmap),
 #endif
 SCMP_SYS(munmap),
+#ifdef __NR_nanosleep
+SCMP_SYS(nanosleep),
+#endif
 #ifdef __NR_prlimit
 SCMP_SYS(prlimit),
 #endif



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Merge branch 'maint-0.2.9' into release-0.2.9

2018-04-23 Thread nickm
commit 2fd489d61605197d5cc0e1c16d1d05a2da2fc73d
Merge: d5000fc67 9727b4c5d
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.2.9' into release-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.1' into maint-0.3.2

2018-04-23 Thread nickm
commit 1438c6c7134c53b2aa3b5e9abf94fe12a4d9bd5e
Merge: f0230ee38 5c3639923
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:31 2018 -0400

Merge branch 'maint-0.3.1' into maint-0.3.2

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.1] Merge branch 'bug24969_029_v2' into maint-0.2.9

2018-04-23 Thread nickm
commit 9727b4c5d683173888b5a49e8b24c3faa9045521
Merge: d3ff12630 c4be6dfea
Author: Nick Mathewson 
Date:   Mon Apr 23 09:23:25 2018 -0400

Merge branch 'bug24969_029_v2' into maint-0.2.9

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-04-23 Thread nickm
commit e8683bcbb19318fcd9df04464296d6581adc959d
Merge: cb813a352 1438c6c71
Author: Nick Mathewson 
Date:   Mon Apr 23 09:24:33 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.3.3' into release-0.3.3

2018-04-23 Thread nickm
commit 5807656f8f0f0d39e712b104d80790570dee87fa
Merge: 84ff77689 e8683bcbb
Author: Nick Mathewson 
Date:   Mon Apr 23 09:24:33 2018 -0400

Merge branch 'maint-0.3.3' into release-0.3.3

 changes/bug24969 | 3 +++
 src/common/sandbox.c | 3 +++
 2 files changed, 6 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.3'

2018-04-23 Thread nickm
commit 1b40e9986bba3667b8dd22af22c2e2f495c1eb6b
Merge: c5ffcbb43 e8683bcbb
Author: Nick Mathewson 
Date:   Mon Apr 23 09:24:33 2018 -0400

Merge branch 'maint-0.3.3'

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [metrics-web/master] Update to latest metrics-lib.

2018-04-23 Thread karsten
commit 6e681a231ef35247a3df920e87eedaeef5f155b1
Author: Karsten Loesing 
Date:   Mon Apr 23 12:26:05 2018 +0200

Update to latest metrics-lib.
---
 src/submods/metrics-lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/submods/metrics-lib b/src/submods/metrics-lib
index f826234..77bbd74 16
--- a/src/submods/metrics-lib
+++ b/src/submods/metrics-lib
@@ -1 +1 @@
-Subproject commit f826234e8064014487d871838e8074e83a142e42
+Subproject commit 77bbd742b63fd9708694d7d8623d82a9654b770e



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [metrics-web/master] Update news.json to version 256 of doc/MetricsTimeline.

2018-04-23 Thread karsten
commit b0506154323fa2c73152afb147976e5e7611a853
Author: Karsten Loesing 
Date:   Mon Apr 23 12:27:19 2018 +0200

Update news.json to version 256 of doc/MetricsTimeline.
---
 src/main/resources/web/json/news.json | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/src/main/resources/web/json/news.json 
b/src/main/resources/web/json/news.json
index 8385b6e..32b0630 100644
--- a/src/main/resources/web/json/news.json
+++ b/src/main/resources/web/json/news.json
@@ -4597,6 +4597,21 @@
 ]
   },
   {
+"start": "2018-04-16",
+"ongoing": true,
+"places": [
+  "ru"
+],
+"shortDescription": "Russia tries to block Telegram; disrupts many 
services on Amazon and Google cloud services.",
+"description": "Russia tries to block Telegram; disrupts many services on 
Amazon and Google cloud services.",
+"links": [
+  {
+"label": "article",
+"target": 
"https://www.bleepingcomputer.com/news/government/russia-bans-18-million-amazon-and-google-ips-in-attempt-to-block-telegram/;
+  }
+]
+  },
+  {
 "start": "2016-02-24",
 "places": [
   "tm"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [metrics-web/master] Move connbidirect graph to Traffic category.

2018-04-23 Thread karsten
commit 3ef4b4b43a700814388e2230dd1ff8e015891a1f
Author: Karsten Loesing 
Date:   Mon Apr 23 12:06:51 2018 +0200

Move connbidirect graph to Traffic category.

Implements #25896.
---
 src/main/resources/web/json/categories.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/web/json/categories.json 
b/src/main/resources/web/json/categories.json
index 82cf1f4..06efe8f 100644
--- a/src/main/resources/web/json/categories.json
+++ b/src/main/resources/web/json/categories.json
@@ -49,6 +49,7 @@
   "advbwdist-relay",
   "bwhist-flags",
   "dirbytes",
+  "connbidirect",
   "uncharted-data-flow"
 ]
   },
@@ -60,8 +61,7 @@
 "description": "We use https://gitweb.torproject.org/torperf.git\;>Torperf and https://github.com/robgjansen/onionperf\;>OnionPerf to run 
performance measurements. Both work by fetching files of different sizes over 
Tor and measuring how long that takes.",
 "metrics": [
   "torperf",
-  "torperf-failures",
-  "connbidirect"
+  "torperf-failures"
 ]
   },
   {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-misc] Update translations for tails-misc

2018-04-23 Thread translation
commit 0ef8de24a0f092cd5fcc0d00956c3c3d72582ffe
Author: Translation commit bot 
Date:   Mon Apr 23 12:46:39 2018 +

Update translations for tails-misc
---
 uk.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/uk.po b/uk.po
index 856759b25..209d10e79 100644
--- a/uk.po
+++ b/uk.po
@@ -19,8 +19,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-03-12 19:03+0100\n"
-"PO-Revision-Date: 2018-04-12 19:07+\n"
-"Last-Translator: IDRASSI Mounir \n"
+"PO-Revision-Date: 2018-04-23 12:35+\n"
+"Last-Translator: O Herenko \n"
 "Language-Team: Ukrainian 
(http://www.transifex.com/otf/torproject/language/uk/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed

2018-04-23 Thread translation
commit a43082d8ebde7e9c479229433758928708c3e825
Author: Translation commit bot 
Date:   Mon Apr 23 12:46:44 2018 +

Update translations for tails-misc_completed
---
 uk.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/uk.po b/uk.po
index 856759b25..209d10e79 100644
--- a/uk.po
+++ b/uk.po
@@ -19,8 +19,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-03-12 19:03+0100\n"
-"PO-Revision-Date: 2018-04-12 19:07+\n"
-"Last-Translator: IDRASSI Mounir \n"
+"PO-Revision-Date: 2018-04-23 12:35+\n"
+"Last-Translator: O Herenko \n"
 "Language-Team: Ukrainian 
(http://www.transifex.com/otf/torproject/language/uk/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [torspec/master] Fix spelling errors in control-spec.txt

2018-04-23 Thread dgoulet
commit 913d724e9f2af1351500dc68cec4d4cf54e20019
Author: Taylor Yu 
Date:   Fri Apr 20 14:35:29 2018 -0500

Fix spelling errors in control-spec.txt
---
 control-spec.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/control-spec.txt b/control-spec.txt
index 6d7f91a..e2f749e 100644
--- a/control-spec.txt
+++ b/control-spec.txt
@@ -207,7 +207,7 @@
 
   ; For tors older than 0.3.1.3-alpha, LongName may have included an equal
   ; sign ("=") in lieu of a tilde ("~").  The presence of an equal sign
-  ; denoted that the OR posessed the "Named" flag:
+  ; denoted that the OR possessed the "Named" flag:
 
   LongName   = Fingerprint [ ( "=" / "~" ) Nickname ]
 
@@ -1072,7 +1072,7 @@
   format.  (Introduced in 0.3.4.1-alpha.)
 
 "config-can-saveconf"
-  0 or 1, depending on whether it is possile to use SAVECONF without the
+  0 or 1, depending on whether it is possible to use SAVECONF without the
   FORCE flag. (Introduced in 0.3.1.1-alpha.)
 
   Examples:
@@ -2796,7 +2796,7 @@
  Total = Integer count of timeouts stored
  Timeout = Integer timeout in milliseconds
  Xm = Estimated integer Pareto parameter Xm in milliseconds
- Alpha = Estimated floating point Paredo paremter alpha
+ Alpha = Estimated floating point Paredo parameter alpha
  Quantile = Floating point CDF quantile cutoff point for this timeout
  TimeoutRate = Floating point ratio of circuits that timeout
  CloseTimeout = How long to keep measurement circs in milliseconds
@@ -3084,7 +3084,7 @@
 will be ignored and a "HS_DESC" event with "IGNORE" action will be
 generated.
 
-For HsDir, LongName is always prefered. If HsDir cannot be found in node
+For HsDir, LongName is always preferred. If HsDir cannot be found in node
 list at the time event is sent, Fingerprint will be used instead.
 
 If Action is "FAILED", Tor SHOULD send Reason field as well. Possible



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [torspec/master] Note release introduced for current-time/*

2018-04-23 Thread dgoulet
commit c2abb79dc1acc480adf467351466a4978800976f
Author: Taylor Yu 
Date:   Fri Apr 20 14:25:41 2018 -0500

Note release introduced for current-time/*
---
 control-spec.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/control-spec.txt b/control-spec.txt
index 80ff5a1..6d7f91a 100644
--- a/control-spec.txt
+++ b/control-spec.txt
@@ -1069,7 +1069,7 @@
 "current-time/local"
 "current-time/utc"
   The current system or UTC time, as returned by the system, in ISOTime2
-  format.
+  format.  (Introduced in 0.3.4.1-alpha.)
 
 "config-can-saveconf"
   0 or 1, depending on whether it is possile to use SAVECONF without the



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Remove the periodic refill event entirely.

2018-04-23 Thread nickm
commit 47df912f1c5a8783fb6edafc72b044ec0ae774ec
Author: Nick Mathewson 
Date:   Tue Apr 17 18:20:03 2018 -0400

Remove the periodic refill event entirely.

Now that we update our buckets on demand before reading or writing,
we no longer need to update them all every TokenBucketRefillInterval
msec.

When a connection runs out of bandwidth, we do need a way to
reenable it, however.  We do this by scheduling a timer to reenable
all blocked connections for TokenBucketRefillInterval msec after a
connection becomes blocked.

(If we were using PerConnBWRate more, it might make sense to have a
per-connection timer, rather than a single timeout. But since
PerConnBWRate is currently (mostly) unused, I'm going to go for the
simpler approach here, since usually whenever one connection has
become blocked on bandwidth, most connections are blocked on
bandwidth.)

Implements ticket 25373.
---
 changes/bug25373|   7 
 doc/tor.1.txt   |   8 ++--
 src/or/connection.c | 116 +---
 src/or/main.c   |  53 
 4 files changed, 86 insertions(+), 98 deletions(-)

diff --git a/changes/bug25373 b/changes/bug25373
new file mode 100644
index 0..03e870e69
--- /dev/null
+++ b/changes/bug25373
@@ -0,0 +1,7 @@
+  o Major features (main loop, CPU wakeup):
+- The bandwidth-limitation logic has been refactored so that
+  bandwidth calculations are performed on-demand, rather than
+  every TokenBucketRefillInterval milliseconds.
+  This change should improve the granularity of our bandwidth
+  calculations, and limit the number of times that the Tor process needs
+  to wake up when it is idle. Closes ticket 25373.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 95620a334..1be9f7091 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -1285,9 +1285,11 @@ The following options are useful only for clients (that 
is, if
 2 minutes)
 
 [[TokenBucketRefillInterval]] **TokenBucketRefillInterval** __NUM__ 
[**msec**|**second**]::
-Set the refill interval of Tor's token bucket to NUM milliseconds.
-NUM must be between 1 and 1000, inclusive.  Note that the configured
-bandwidth limits are still expressed in bytes per second: this
+Set the refill delay interval of Tor's token bucket to NUM milliseconds.
+NUM must be between 1 and 1000, inclusive.  When Tor is out of bandwidth,
+on a connection or globally, it will wait up to this long before it tries
+to use that connection again.
+Note that bandwidth limits are still expressed in bytes per second: this
 option only affects the frequency with which Tor checks to see whether
 previously exhausted connections may read again.
 Can not be changed while tor is running. (Default: 100 msec)
diff --git a/src/or/connection.c b/src/or/connection.c
index d80c68046..444294ee7 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -138,6 +138,8 @@ static const char *proxy_type_to_string(int proxy_type);
 static int get_proxy_type(void);
 const tor_addr_t *conn_get_outbound_address(sa_family_t family,
   const or_options_t *options, unsigned int conn_type);
+static void blocked_connection_reenable_init(const or_options_t *options);
+static void schedule_blocked_connection_reenable(void);
 
 /** The last addresses that our network interface seemed to have been
  * binding to.  We use this as one way to detect when our IP changes.
@@ -3091,6 +3093,7 @@ connection_read_bw_exhausted(connection_t *conn, bool 
is_global_bw)
   (void)is_global_bw;
   conn->read_blocked_on_bw = 1;
   connection_stop_reading(conn);
+  schedule_blocked_connection_reenable();
 }
 
 /**
@@ -3105,6 +3108,7 @@ connection_write_bw_exhausted(connection_t *conn, bool 
is_global_bw)
   (void)is_global_bw;
   conn->write_blocked_on_bw = 1;
   connection_stop_reading(conn);
+  schedule_blocked_connection_reenable();
 }
 
 /** If we have exhausted our global buckets, or the buckets for conn,
@@ -3117,7 +3121,8 @@ connection_consider_empty_read_buckets(connection_t *conn)
   if (!connection_is_rate_limited(conn))
 return; /* Always okay. */
 
-  bool is_global = true;
+  int is_global = 1;
+
   if (token_bucket_rw_get_read(_bucket) <= 0) {
 reason = "global read bucket exhausted. Pausing.";
   } else if (connection_counts_as_relayed_traffic(conn, approx_time()) &&
@@ -3185,6 +3190,8 @@ connection_bucket_init(void)
   (int32_t)options->BandwidthBurst,
   now_ts);
   }
+
+  blocked_connection_reenable_init(options);
 }
 
 /** Update the global connection bucket settings to a new value. */
@@ -3233,55 +3240,76 @@ connection_bucket_refill_single(connection_t *conn, 
uint32_t now_ts)
   }
 }
 
-/** Time has passed; increment buckets appropriately and re-enable formerly
- * blocked connections. */
-void

[tor-commits] [tor/master] Merge remote-tracking branch 'github/lazy_bucket_refill'

2018-04-23 Thread nickm
commit 3527f4b8a4f002e7b910eacd4ead6e9044cb4003
Merge: 1b40e9986 bd3f8260a
Author: Nick Mathewson 
Date:   Mon Apr 23 09:47:05 2018 -0400

Merge remote-tracking branch 'github/lazy_bucket_refill'

 changes/bug25373  |   7 ++
 changes/bug25828  |   7 ++
 doc/tor.1.txt |   8 +-
 src/common/token_bucket.c |  13 ++-
 src/common/token_bucket.h |   4 +-
 src/or/connection.c   | 251 ++
 src/or/connection.h   |   8 +-
 src/or/hibernate.c|   2 +-
 src/or/main.c | 120 ++
 src/or/main.h |   1 +
 src/or/or.h   |   1 +
 11 files changed, 252 insertions(+), 170 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-and-https] Update translations for tor-and-https

2018-04-23 Thread translation
commit cd6b1dac321c356a570bee1ff519dee507572f4e
Author: Translation commit bot 
Date:   Mon Apr 23 14:17:45 2018 +

Update translations for tor-and-https
---
 ru.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ru.po b/ru.po
index 88ba571c9..2b9e9bfac 100644
--- a/ru.po
+++ b/ru.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-04-12 19:08+\n"
-"Last-Translator: Andrey\n"
+"PO-Revision-Date: 2018-04-23 14:10+\n"
+"Last-Translator: e Translators \n"
 "Language-Team: Russian 
(http://www.transifex.com/otf/torproject/language/ru/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-and-https_completed] Update translations for tor-and-https_completed

2018-04-23 Thread translation
commit 5e4a92e12e5fd25f87d115e164b0c86498d7a485
Author: Translation commit bot 
Date:   Mon Apr 23 14:17:50 2018 +

Update translations for tor-and-https_completed
---
 ru.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ru.po b/ru.po
index 88ba571c9..2b9e9bfac 100644
--- a/ru.po
+++ b/ru.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-04-12 19:08+\n"
-"Last-Translator: Andrey\n"
+"PO-Revision-Date: 2018-04-23 14:10+\n"
+"Last-Translator: e Translators \n"
 "Language-Team: Russian 
(http://www.transifex.com/otf/torproject/language/ru/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'dgoulet/ticket25762_034_05'

2018-04-23 Thread nickm
commit 192c7c8bf9a3c53d32e83557ebc62cf7cfa3b1ca
Merge: 3527f4b8a 665e23c59
Author: Nick Mathewson 
Date:   Mon Apr 23 11:02:05 2018 -0400

Merge remote-tracking branch 'dgoulet/ticket25762_034_05'

 src/or/config.c|   7 +-
 src/or/main.c  | 192 ++-
 src/or/main.h  |   7 ++
 src/or/networkstatus.c |   2 +-
 src/or/networkstatus.h |   2 +
 src/or/periodic.c  |  51 +++-
 src/or/periodic.h  |  42 ++-
 src/test/include.am|   1 +
 src/test/test.c|   1 +
 src/test/test.h|   1 +
 src/test/test_periodic_event.c | 256 +
 11 files changed, 502 insertions(+), 60 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] test: Add periodic events unit tests

2018-04-23 Thread nickm
commit 665e23c59a370157c5e3526e29590798b1933ed5
Author: David Goulet 
Date:   Wed Apr 18 14:50:07 2018 -0400

test: Add periodic events unit tests

Signed-off-by: David Goulet 
---
 src/or/main.c  |   4 +-
 src/or/main.h  |   5 +
 src/test/include.am|   1 +
 src/test/test.c|   1 +
 src/test/test.h|   1 +
 src/test/test_periodic_event.c | 256 +
 6 files changed, 266 insertions(+), 2 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 0a796c0fa..595246bfc 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1351,7 +1351,7 @@ CALLBACK(write_stats_file);
 /* Now we declare an array of periodic_event_item_t for each periodic event */
 #define CALLBACK(name, r) PERIODIC_EVENT(name, r)
 
-static periodic_event_item_t periodic_events[] = {
+STATIC periodic_event_item_t periodic_events[] = {
   /* Everyone needs to run those. */
   CALLBACK(add_entropy, PERIODIC_EVENT_ROLE_ALL),
   CALLBACK(check_expired_networkstatus, PERIODIC_EVENT_ROLE_ALL),
@@ -1440,7 +1440,7 @@ find_periodic_event(const char *name)
 
 /** Return a bitmask of the roles this tor instance is configured for using
  * the given options. */
-static int
+STATIC int
 get_my_roles(const or_options_t *options)
 {
   tor_assert(options);
diff --git a/src/or/main.h b/src/or/main.h
index 5220b1321..57ac8573a 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -98,8 +98,13 @@ STATIC void init_connection_lists(void);
 STATIC void close_closeable_connections(void);
 STATIC void initialize_periodic_events(void);
 STATIC void teardown_periodic_events(void);
+STATIC int get_my_roles(const or_options_t *options);
 #ifdef TOR_UNIT_TESTS
 extern smartlist_t *connection_array;
+
+/* We need the periodic_event_item_t definition. */
+#include "periodic.h"
+extern periodic_event_item_t periodic_events[];
 #endif
 #endif /* defined(MAIN_PRIVATE) */
 
diff --git a/src/test/include.am b/src/test/include.am
index 474da3f88..b59517a13 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -144,6 +144,7 @@ src_test_test_SOURCES = \
src/test/test_oom.c \
src/test/test_oos.c \
src/test/test_options.c \
+   src/test/test_periodic_event.c \
src/test/test_policy.c \
src/test/test_procmon.c \
src/test/test_proto_http.c \
diff --git a/src/test/test.c b/src/test/test.c
index 422e181b9..2963f169c 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -863,6 +863,7 @@ struct testgroup_t testgroups[] = {
   { "oom/", oom_tests },
   { "oos/", oos_tests },
   { "options/", options_tests },
+  { "periodic-event/" , periodic_event_tests },
   { "policy/" , policy_tests },
   { "procmon/", procmon_tests },
   { "proto/http/", proto_http_tests },
diff --git a/src/test/test.h b/src/test/test.h
index 1728831ed..15965ccaf 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -239,6 +239,7 @@ extern struct testcase_t nodelist_tests[];
 extern struct testcase_t oom_tests[];
 extern struct testcase_t oos_tests[];
 extern struct testcase_t options_tests[];
+extern struct testcase_t periodic_event_tests[];
 extern struct testcase_t policy_tests[];
 extern struct testcase_t procmon_tests[];
 extern struct testcase_t proto_http_tests[];
diff --git a/src/test/test_periodic_event.c b/src/test/test_periodic_event.c
new file mode 100644
index 0..1a9f4351e
--- /dev/null
+++ b/src/test/test_periodic_event.c
@@ -0,0 +1,256 @@
+/* Copyright (c) 2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file test_periodic_event.c
+ * \brief Test the periodic events that Tor uses for different roles. They are
+ *part of the libevent mainloop
+ */
+
+#define CONFIG_PRIVATE
+#define HS_SERVICE_PRIVATE
+#define MAIN_PRIVATE
+
+#include "test.h"
+#include "test_helpers.h"
+
+#include "or.h"
+#include "config.h"
+#include "hs_service.h"
+#include "main.h"
+#include "periodic.h"
+
+/** Helper function: This is replaced in some tests for the event callbacks so
+ * we don't actually go into the code path of those callbacks. */
+static int
+dumb_event_fn(time_t now, const or_options_t *options)
+{
+  (void) now;
+  (void) options;
+
+  /* Will get rescheduled in 300 seconds. It just can't be 0. */
+  return 300;
+}
+
+static void
+register_dummy_hidden_service(hs_service_t *service)
+{
+  memset(service, 0, sizeof(hs_service_t));
+  memset(>keys.identity_pk, 'A', sizeof(service->keys.identity_pk));
+  (void) register_service(get_hs_service_map(), service);
+}
+
+static void
+test_pe_initialize(void *arg)
+{
+  (void) arg;
+
+  /* Initialize the events but the callback won't get called since we would
+   * need to run the main loop and then wait for a second delaying the unit
+   * tests. Instead, we'll test the callback work indepedently elsewhere. */
+  initialize_periodic_events();
+
+  /* Validate that all events have been set up. */

[tor-commits] [tor/master] main: Sort alphabetically periodic event callbacks

2018-04-23 Thread nickm
commit 269cd5dba705e0a8ce30f473128779f34caf4da6
Author: David Goulet 
Date:   Mon Apr 16 15:26:49 2018 -0400

main: Sort alphabetically periodic event callbacks

No behavior change, just to make it easier to find callbacks and for the 
sake
of our human brain to parse the list properly.

Signed-off-by: David Goulet 
---
 src/or/main.c | 80 +--
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index a852d3273..5d64eb69b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1316,34 +1316,34 @@ static int periodic_events_initialized = 0;
 #undef CALLBACK
 #define CALLBACK(name) \
   static int name ## _callback(time_t, const or_options_t *)
-CALLBACK(rotate_onion_key);
-CALLBACK(check_onion_keys_expiry_time);
-CALLBACK(check_ed_keys);
-CALLBACK(launch_descriptor_fetches);
-CALLBACK(rotate_x509_certificate);
 CALLBACK(add_entropy);
-CALLBACK(launch_reachability_tests);
-CALLBACK(downrate_stability);
-CALLBACK(save_stability);
 CALLBACK(check_authority_cert);
+CALLBACK(check_canonical_channels);
+CALLBACK(check_descriptor);
+CALLBACK(check_dns_honesty);
+CALLBACK(check_ed_keys);
 CALLBACK(check_expired_networkstatus);
-CALLBACK(write_stats_file);
-CALLBACK(record_bridge_stats);
+CALLBACK(check_for_reachability_bw);
+CALLBACK(check_onion_keys_expiry_time);
 CALLBACK(clean_caches);
+CALLBACK(clean_consdiffmgr);
+CALLBACK(downrate_stability);
+CALLBACK(expire_old_ciruits_serverside);
+CALLBACK(fetch_networkstatus);
+CALLBACK(heartbeat);
+CALLBACK(hs_service);
+CALLBACK(launch_descriptor_fetches);
+CALLBACK(launch_reachability_tests);
+CALLBACK(record_bridge_stats);
 CALLBACK(rend_cache_failure_clean);
+CALLBACK(reset_padding_counts);
 CALLBACK(retry_dns);
-CALLBACK(check_descriptor);
-CALLBACK(check_for_reachability_bw);
-CALLBACK(fetch_networkstatus);
 CALLBACK(retry_listeners);
-CALLBACK(expire_old_ciruits_serverside);
-CALLBACK(check_dns_honesty);
+CALLBACK(rotate_onion_key);
+CALLBACK(rotate_x509_certificate);
+CALLBACK(save_stability);
 CALLBACK(write_bridge_ns);
-CALLBACK(heartbeat);
-CALLBACK(clean_consdiffmgr);
-CALLBACK(reset_padding_counts);
-CALLBACK(check_canonical_channels);
-CALLBACK(hs_service);
+CALLBACK(write_stats_file);
 
 #undef CALLBACK
 
@@ -1351,34 +1351,34 @@ CALLBACK(hs_service);
 #define CALLBACK(name) PERIODIC_EVENT(name)
 
 static periodic_event_item_t periodic_events[] = {
-  CALLBACK(rotate_onion_key),
-  CALLBACK(check_onion_keys_expiry_time),
-  CALLBACK(check_ed_keys),
-  CALLBACK(launch_descriptor_fetches),
-  CALLBACK(rotate_x509_certificate),
   CALLBACK(add_entropy),
-  CALLBACK(launch_reachability_tests),
-  CALLBACK(downrate_stability),
-  CALLBACK(save_stability),
   CALLBACK(check_authority_cert),
+  CALLBACK(check_canonical_channels),
+  CALLBACK(check_descriptor),
+  CALLBACK(check_dns_honesty),
+  CALLBACK(check_ed_keys),
   CALLBACK(check_expired_networkstatus),
-  CALLBACK(write_stats_file),
-  CALLBACK(record_bridge_stats),
+  CALLBACK(check_for_reachability_bw),
+  CALLBACK(check_onion_keys_expiry_time),
   CALLBACK(clean_caches),
+  CALLBACK(clean_consdiffmgr),
+  CALLBACK(downrate_stability),
+  CALLBACK(expire_old_ciruits_serverside),
+  CALLBACK(fetch_networkstatus),
+  CALLBACK(heartbeat),
+  CALLBACK(hs_service),
+  CALLBACK(launch_descriptor_fetches),
+  CALLBACK(launch_reachability_tests),
+  CALLBACK(record_bridge_stats),
   CALLBACK(rend_cache_failure_clean),
+  CALLBACK(reset_padding_counts),
   CALLBACK(retry_dns),
-  CALLBACK(check_descriptor),
-  CALLBACK(check_for_reachability_bw),
-  CALLBACK(fetch_networkstatus),
   CALLBACK(retry_listeners),
-  CALLBACK(expire_old_ciruits_serverside),
-  CALLBACK(check_dns_honesty),
+  CALLBACK(rotate_onion_key),
+  CALLBACK(rotate_x509_certificate),
+  CALLBACK(save_stability),
   CALLBACK(write_bridge_ns),
-  CALLBACK(heartbeat),
-  CALLBACK(clean_consdiffmgr),
-  CALLBACK(reset_padding_counts),
-  CALLBACK(check_canonical_channels),
-  CALLBACK(hs_service),
+  CALLBACK(write_stats_file),
   END_OF_PERIODIC_EVENTS
 };
 #undef CALLBACK



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] main: Update periodic events comment based on latest code

2018-04-23 Thread nickm
commit 87cb9ce90088bbe3e677804eca7c1ffa4f63a1cb
Author: David Goulet 
Date:   Wed Apr 18 10:25:39 2018 -0400

main: Update periodic events comment based on latest code

Signed-off-by: David Goulet 
---
 src/or/main.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 565131cb3..0a796c0fa 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1523,8 +1523,8 @@ teardown_periodic_events(void)
   periodic_events_initialized = 0;
 }
 
-/** Do a pass at all our periodic events, destroy those we don't need anymore
- * and enabled those we need now using the given options. */
+/** Do a pass at all our periodic events, disable those we don't need anymore
+ * and enable those we need now using the given options. */
 static void
 rescan_periodic_events(const or_options_t *options)
 {
@@ -1547,15 +1547,15 @@ rescan_periodic_events(const or_options_t *options)
   }
 }
 
-/* We just got new options globally set, see if we need to destroy or setup
+/* We just got new options globally set, see if we need to enabled or disable
  * periodic events. */
 void
 periodic_events_on_new_options(const or_options_t *options)
 {
-  /* Only if we've already initialized once the events, teardown them all and
-   * reinitialize. It is just simpler that way instead of going through all
-   * currently enabled events and trying to destroy only the one that could be
-   * affected. */
+  /* Only if we've already initialized the events, rescan the list which will
+   * enable or disable events depending on our roles. This will be called at
+   * bootup and we don't want this function to initialize the events because
+   * they aren't set up at this stage. */
   if (periodic_events_initialized) {
 rescan_periodic_events(options);
   }



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] periodic: Add an enable and disable function

2018-04-23 Thread nickm
commit 4e85f17eec06fc963c33cc3f637876e7f1627a57
Author: David Goulet 
Date:   Tue Apr 17 09:57:09 2018 -0400

periodic: Add an enable and disable function

Two helper functions to enable an event and disable an event which wraps the
launch and destroy of an event but takes care of the enabled flag.

They are also idempotent that is can be called multiple time on the same 
event
without effect if the event was already enabled or disabled.

Signed-off-by: David Goulet 
---
 src/or/main.c | 22 +-
 src/or/periodic.c | 41 -
 src/or/periodic.h |  2 ++
 3 files changed, 51 insertions(+), 14 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index eb8835198..1c5ac198b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1484,8 +1484,9 @@ initialize_periodic_events_cb(evutil_socket_t fd, short 
events, void *data)
 
   for (int i = 0; periodic_events[i].name; ++i) {
 periodic_event_item_t *item = _events[i];
-if (item->roles & roles && !periodic_event_is_enabled(item)) {
-  periodic_event_launch(item);
+if (item->roles & roles) {
+  /* This is safe to be called on an already enabled event. */
+  periodic_event_enable(item);
   log_debug(LD_GENERAL, "Launching periodic event %s", item->name);
 }
   }
@@ -1541,18 +1542,13 @@ rescan_periodic_events(const or_options_t *options)
 
   for (int i = 0; periodic_events[i].name; ++i) {
 periodic_event_item_t *item = _events[i];
-int is_enabled = periodic_event_is_enabled(item);
-int need_item = (item->roles & roles);
 
-/* We need this event but it is *not* enabled. */
-if (need_item && !is_enabled) {
-  periodic_event_launch(item);
-  continue;
-}
-/* We do *not* need this event but it is enabled. */
-if (!need_item && is_enabled) {
-  periodic_event_destroy(item);
-  continue;
+/* Enable the event if needed. It is safe to enable an event that was
+ * already enabled. Same goes for disabling it. */
+if (item->roles & roles) {
+  periodic_event_enable(item);
+} else {
+  periodic_event_disable(item);
 }
   }
 }
diff --git a/src/or/periodic.c b/src/or/periodic.c
index 42bea3ae6..76aa418b3 100644
--- a/src/or/periodic.c
+++ b/src/or/periodic.c
@@ -43,12 +43,22 @@ periodic_event_dispatch(mainloop_event_t *ev, void *data)
   periodic_event_item_t *event = data;
   tor_assert(ev == event->ev);
 
+  if (BUG(!periodic_event_is_enabled(event))) {
+return;
+  }
+
   time_t now = time(NULL);
   const or_options_t *options = get_options();
 //  log_debug(LD_GENERAL, "Dispatching %s", event->name);
   int r = event->fn(now, options);
   int next_interval = 0;
 
+  if (!periodic_event_is_enabled(event)) {
+/* The event got disabled from inside its callback; no need to
+ * reschedule. */
+return;
+  }
+
   /* update the last run time if action was taken */
   if (r==0) {
 log_err(LD_BUG, "Invalid return value for periodic event from %s.",
@@ -114,8 +124,8 @@ periodic_event_launch(periodic_event_item_t *event)
   }
 
   // Initial dispatch
-  periodic_event_dispatch(event->ev, event);
   event->enabled = 1;
+  periodic_event_dispatch(event->ev, event);
 }
 
 /** Release all storage associated with event */
@@ -126,6 +136,35 @@ periodic_event_destroy(periodic_event_item_t *event)
 return;
   mainloop_event_free(event->ev);
   event->last_action_time = 0;
+}
+
+/** Enable the given event which means the event is launched and then the
+ * event's enabled flag is set. This can be called for an event that is
+ * already enabled. */
+void
+periodic_event_enable(periodic_event_item_t *event)
+{
+  tor_assert(event);
+  /* Safely and silently ignore if this event is already enabled. */
+  if (periodic_event_is_enabled(event)) {
+return;
+  }
+
+  periodic_event_launch(event);
+}
+
+/** Disable the given event which means the event is destroyed and then the
+ * event's enabled flag is unset. This can be called for an event that is
+ * already disabled. */
+void
+periodic_event_disable(periodic_event_item_t *event)
+{
+  tor_assert(event);
+  /* Safely and silently ignore if this event is already disabled. */
+  if (!periodic_event_is_enabled(event)) {
+return;
+  }
+  mainloop_event_cancel(event->ev);
   event->enabled = 0;
 }
 
diff --git a/src/or/periodic.h b/src/or/periodic.h
index 1b346a1cc..dde27db5a 100644
--- a/src/or/periodic.h
+++ b/src/or/periodic.h
@@ -69,6 +69,8 @@ void periodic_event_launch(periodic_event_item_t *event);
 void periodic_event_setup(periodic_event_item_t *event);
 void periodic_event_destroy(periodic_event_item_t *event);
 void periodic_event_reschedule(periodic_event_item_t *event);
+void periodic_event_enable(periodic_event_item_t *event);
+void periodic_event_disable(periodic_event_item_t *event);
 
 #endif /* !defined(TOR_PERIODIC_H) */
 




[tor-commits] [tor/master] main: Launch periodic events by roles

2018-04-23 Thread nickm
commit a4fcdc5decfe60bbd95aee2e5586e90c40b73225
Author: David Goulet 
Date:   Tue Apr 17 09:31:50 2018 -0400

main: Launch periodic events by roles

Signed-off-by: David Goulet 
---
 src/or/main.c  | 40 +---
 src/or/networkstatus.c |  2 +-
 src/or/networkstatus.h |  2 ++
 src/or/periodic.c  | 12 +++-
 src/or/periodic.h  | 14 --
 5 files changed, 63 insertions(+), 7 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 5ca6277c1..52e83822e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1437,6 +1437,32 @@ find_periodic_event(const char *name)
   return NULL;
 }
 
+/** Return a bitmask of the roles this tor instance is configured for using
+ * the given options. */
+static int
+get_my_roles(const or_options_t *options)
+{
+  tor_assert(options);
+
+  int roles = 0;
+  int is_bridge = options->BridgeRelay;
+  int is_client = any_client_port_set(options);
+  int is_relay = server_mode(options);
+  int is_dirauth = authdir_mode_v3(options);
+  int is_bridgeauth = authdir_mode_bridge(options);
+  int is_hidden_service = !!hs_service_get_num_services() ||
+  !!rend_num_services();
+
+  if (is_bridge) roles |= PERIODIC_EVENT_ROLE_BRIDGE;
+  if (is_client) roles |= PERIODIC_EVENT_ROLE_CLIENT;
+  if (is_relay) roles |= PERIODIC_EVENT_ROLE_RELAY;
+  if (is_dirauth) roles |= PERIODIC_EVENT_ROLE_DIRAUTH;
+  if (is_bridgeauth) roles |= PERIODIC_EVENT_ROLE_BRIDGEAUTH;
+  if (is_hidden_service) roles |= PERIODIC_EVENT_ROLE_HS_SERVICE;
+
+  return roles;
+}
+
 /** Event to run initialize_periodic_events_cb */
 static struct event *initialize_periodic_events_event = NULL;
 
@@ -1451,10 +1477,17 @@ initialize_periodic_events_cb(evutil_socket_t fd, short 
events, void *data)
   (void) fd;
   (void) events;
   (void) data;
+
+  int roles = get_my_roles(get_options());
+
   tor_event_free(initialize_periodic_events_event);
-  int i;
-  for (i = 0; periodic_events[i].name; ++i) {
-periodic_event_launch(_events[i]);
+
+  for (int i = 0; periodic_events[i].name; ++i) {
+periodic_event_item_t *item = _events[i];
+if (item->roles & roles && !periodic_event_is_enabled(item)) {
+  periodic_event_launch(item);
+  log_debug(LD_GENERAL, "Launching periodic event %s", item->name);
+}
   }
 }
 
@@ -1466,6 +1499,7 @@ initialize_periodic_events(void)
   tor_assert(periodic_events_initialized == 0);
   periodic_events_initialized = 1;
 
+  /* Set up all periodic events. We'll launch them by roles. */
   int i;
   for (i = 0; periodic_events[i].name; ++i) {
 periodic_event_setup(_events[i]);
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 5f19792c7..b0db0cecb 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1680,7 +1680,7 @@ 
networkstatus_set_current_consensus_from_ns(networkstatus_t *c,
  *  If we need this elsewhere at any point, we should make it nonstatic
  *  and move it into another file.
  */
-static int
+int
 any_client_port_set(const or_options_t *options)
 {
   return (options->SocksPort_set ||
diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h
index 1851a55e8..04cf277d2 100644
--- a/src/or/networkstatus.h
+++ b/src/or/networkstatus.h
@@ -140,6 +140,8 @@ void vote_routerstatus_free_(vote_routerstatus_t *rs);
 #define vote_routerstatus_free(rs) \
   FREE_AND_NULL(vote_routerstatus_t, vote_routerstatus_free_, (rs))
 
+int any_client_port_set(const or_options_t *options);
+
 #ifdef NETWORKSTATUS_PRIVATE
 #ifdef TOR_UNIT_TESTS
 STATIC int networkstatus_set_current_consensus_from_ns(networkstatus_t *c,
diff --git a/src/or/periodic.c b/src/or/periodic.c
index fa40965de..42bea3ae6 100644
--- a/src/or/periodic.c
+++ b/src/or/periodic.c
@@ -78,7 +78,10 @@ periodic_event_dispatch(mainloop_event_t *ev, void *data)
 void
 periodic_event_reschedule(periodic_event_item_t *event)
 {
-  periodic_event_set_interval(event, 1);
+  /* Don't reschedule a disabled event. */
+  if (periodic_event_is_enabled(event)) {
+periodic_event_set_interval(event, 1);
+  }
 }
 
 /** Initializes the libevent backend for a periodic event. */
@@ -104,9 +107,15 @@ periodic_event_launch(periodic_event_item_t *event)
 log_err(LD_BUG, "periodic_event_launch without periodic_event_setup");
 tor_assert(0);
   }
+  /* Event already enabled? This is a bug */
+  if (periodic_event_is_enabled(event)) {
+log_err(LD_BUG, "periodic_event_launch on an already enabled event");
+tor_assert(0);
+  }
 
   // Initial dispatch
   periodic_event_dispatch(event->ev, event);
+  event->enabled = 1;
 }
 
 /** Release all storage associated with event */
@@ -117,5 +126,6 @@ periodic_event_destroy(periodic_event_item_t *event)
 return;
   mainloop_event_free(event->ev);
   event->last_action_time = 0;
+  event->enabled = 0;
 }
 
diff --git a/src/or/periodic.h b/src/or/periodic.h
index 4544ae276..1b346a1cc 100644
--- 

[tor-commits] [tor/master] config: Set up periodic events when options changes

2018-04-23 Thread nickm
commit 1d864987cbdab4286eed8f3a86a488759dc322ae
Author: David Goulet 
Date:   Tue Apr 17 09:44:01 2018 -0400

config: Set up periodic events when options changes

In case we transitionned to a new role in Tor, we need to launch and/or
destroy some periodic events.

Signed-off-by: David Goulet 
---
 src/or/config.c |  7 ++-
 src/or/main.c   | 41 +
 src/or/main.h   |  2 ++
 3 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/src/or/config.c b/src/or/config.c
index 9c0b321b5..1923afe7d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -903,8 +903,13 @@ set_options(or_options_t *new_val, char **msg)
 smartlist_free(elements);
   }
 
-  if (old_options != global_options)
+  if (old_options != global_options) {
 or_options_free(old_options);
+/* If we are here it means we've successfully applied the new options and
+ * that the global options have been changed to the new values. We'll
+ * check if we need to remove or add periodic events. */
+periodic_events_on_new_options(global_options);
+  }
 
   return 0;
 }
diff --git a/src/or/main.c b/src/or/main.c
index 52e83822e..eb8835198 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1530,6 +1530,47 @@ teardown_periodic_events(void)
   periodic_events_initialized = 0;
 }
 
+/** Do a pass at all our periodic events, destroy those we don't need anymore
+ * and enabled those we need now using the given options. */
+static void
+rescan_periodic_events(const or_options_t *options)
+{
+  tor_assert(options);
+
+  int roles = get_my_roles(options);
+
+  for (int i = 0; periodic_events[i].name; ++i) {
+periodic_event_item_t *item = _events[i];
+int is_enabled = periodic_event_is_enabled(item);
+int need_item = (item->roles & roles);
+
+/* We need this event but it is *not* enabled. */
+if (need_item && !is_enabled) {
+  periodic_event_launch(item);
+  continue;
+}
+/* We do *not* need this event but it is enabled. */
+if (!need_item && is_enabled) {
+  periodic_event_destroy(item);
+  continue;
+}
+  }
+}
+
+/* We just got new options globally set, see if we need to destroy or setup
+ * periodic events. */
+void
+periodic_events_on_new_options(const or_options_t *options)
+{
+  /* Only if we've already initialized once the events, teardown them all and
+   * reinitialize. It is just simpler that way instead of going through all
+   * currently enabled events and trying to destroy only the one that could be
+   * affected. */
+  if (periodic_events_initialized) {
+rescan_periodic_events(options);
+  }
+}
+
 /**
  * Update our schedule so that we'll check whether we need to update our
  * descriptor immediately, rather than after up to CHECK_DESCRIPTOR_INTERVAL
diff --git a/src/or/main.h b/src/or/main.h
index e50d14d4d..5220b1321 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -86,6 +86,8 @@ uint64_t get_main_loop_success_count(void);
 uint64_t get_main_loop_error_count(void);
 uint64_t get_main_loop_idle_count(void);
 
+void periodic_events_on_new_options(const or_options_t *options);
+
 extern time_t time_of_process_start;
 extern int quiet_level;
 extern token_bucket_rw_t global_bucket;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] main: Specialize the periodic events on a per-role basis

2018-04-23 Thread nickm
commit ed89bb32535fbf354b406a36f3176380a4e226bf
Author: David Goulet 
Date:   Mon Apr 16 15:50:50 2018 -0400

main: Specialize the periodic events on a per-role basis

In tor, we have a series of possible "roles" that the tor daemon can be
enabled for. They are:

  Client, Bridge, Relay, Authority (directory or bridge) and Onion service.

They can be combined sometimes. For instance, a Directory Authority is also 
a
Relay. This adds a "roles" field to a periodic event item object which is 
used
to know for which roles the event is for.

The next step is to enable the event only if the roles apply. No behavior
change at this commit.

Pars of #25762

Signed-off-by: David Goulet 
---
 src/or/main.c | 75 ++-
 src/or/periodic.h | 30 --
 2 files changed, 74 insertions(+), 31 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 5d64eb69b..5ca6277c1 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1348,37 +1348,54 @@ CALLBACK(write_stats_file);
 #undef CALLBACK
 
 /* Now we declare an array of periodic_event_item_t for each periodic event */
-#define CALLBACK(name) PERIODIC_EVENT(name)
+#define CALLBACK(name, r) PERIODIC_EVENT(name, r)
 
 static periodic_event_item_t periodic_events[] = {
-  CALLBACK(add_entropy),
-  CALLBACK(check_authority_cert),
-  CALLBACK(check_canonical_channels),
-  CALLBACK(check_descriptor),
-  CALLBACK(check_dns_honesty),
-  CALLBACK(check_ed_keys),
-  CALLBACK(check_expired_networkstatus),
-  CALLBACK(check_for_reachability_bw),
-  CALLBACK(check_onion_keys_expiry_time),
-  CALLBACK(clean_caches),
-  CALLBACK(clean_consdiffmgr),
-  CALLBACK(downrate_stability),
-  CALLBACK(expire_old_ciruits_serverside),
-  CALLBACK(fetch_networkstatus),
-  CALLBACK(heartbeat),
-  CALLBACK(hs_service),
-  CALLBACK(launch_descriptor_fetches),
-  CALLBACK(launch_reachability_tests),
-  CALLBACK(record_bridge_stats),
-  CALLBACK(rend_cache_failure_clean),
-  CALLBACK(reset_padding_counts),
-  CALLBACK(retry_dns),
-  CALLBACK(retry_listeners),
-  CALLBACK(rotate_onion_key),
-  CALLBACK(rotate_x509_certificate),
-  CALLBACK(save_stability),
-  CALLBACK(write_bridge_ns),
-  CALLBACK(write_stats_file),
+  /* Everyone needs to run those. */
+  CALLBACK(add_entropy, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(check_expired_networkstatus, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(clean_caches, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(fetch_networkstatus, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(heartbeat, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(launch_descriptor_fetches, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(reset_padding_counts, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(retry_listeners, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(rotate_x509_certificate, PERIODIC_EVENT_ROLE_ALL),
+  CALLBACK(write_stats_file, PERIODIC_EVENT_ROLE_ALL),
+
+  /* Routers (bridge and relay) only. */
+  CALLBACK(check_descriptor, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(check_ed_keys, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(check_for_reachability_bw, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(check_onion_keys_expiry_time, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(clean_consdiffmgr, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(expire_old_ciruits_serverside, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(retry_dns, PERIODIC_EVENT_ROLE_ROUTER),
+  CALLBACK(rotate_onion_key, PERIODIC_EVENT_ROLE_ROUTER),
+
+  /* Authorities (bridge and directory) only. */
+  CALLBACK(downrate_stability, PERIODIC_EVENT_ROLE_AUTHORITIES),
+  CALLBACK(launch_reachability_tests, PERIODIC_EVENT_ROLE_AUTHORITIES),
+  CALLBACK(save_stability, PERIODIC_EVENT_ROLE_AUTHORITIES),
+
+  /* Directory authority only. */
+  CALLBACK(check_authority_cert, PERIODIC_EVENT_ROLE_DIRAUTH),
+
+  /* Relay only. */
+  CALLBACK(check_canonical_channels, PERIODIC_EVENT_ROLE_RELAY),
+  CALLBACK(check_dns_honesty, PERIODIC_EVENT_ROLE_RELAY),
+
+  /* Hidden Service service only. */
+  CALLBACK(hs_service, PERIODIC_EVENT_ROLE_HS_SERVICE),
+
+  /* Bridge only. */
+  CALLBACK(record_bridge_stats, PERIODIC_EVENT_ROLE_BRIDGE),
+
+  /* Client only. */
+  CALLBACK(rend_cache_failure_clean, PERIODIC_EVENT_ROLE_CLIENT),
+
+  /* Bridge Authority only. */
+  CALLBACK(write_bridge_ns, PERIODIC_EVENT_ROLE_BRIDGEAUTH),
   END_OF_PERIODIC_EVENTS
 };
 #undef CALLBACK
diff --git a/src/or/periodic.h b/src/or/periodic.h
index 285400b8b..4544ae276 100644
--- a/src/or/periodic.h
+++ b/src/or/periodic.h
@@ -6,6 +6,29 @@
 
 #define PERIODIC_EVENT_NO_UPDATE (-1)
 
+/* Tor roles for which a periodic event item is for. An event can be for
+ * multiple roles, they can be combined. */
+#define PERIODIC_EVENT_ROLE_CLIENT  (1U << 0)
+#define PERIODIC_EVENT_ROLE_RELAY   (1U << 1)
+#define PERIODIC_EVENT_ROLE_BRIDGE  (1U << 2)
+#define PERIODIC_EVENT_ROLE_DIRAUTH (1U << 3)
+#define PERIODIC_EVENT_ROLE_BRIDGEAUTH  (1U << 4)
+#define 

[tor-commits] [tor/master] main: Use rescan_periodic_events in initialize_periodic_events_cb

2018-04-23 Thread nickm
commit f70fa67da6d22d7351bd8f50db0804c239ffa5d6
Author: Nick Mathewson 
Date:   Tue Apr 17 18:55:28 2018 -0400

main: Use rescan_periodic_events in initialize_periodic_events_cb
---
 src/or/main.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 1c5ac198b..565131cb3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -150,6 +150,7 @@ static int run_main_loop_until_done(void);
 static void process_signal(int sig);
 static void shutdown_did_not_work_callback(evutil_socket_t fd, short event,
void *arg) ATTR_NORETURN;
+static void rescan_periodic_events(const or_options_t *options);
 
 /* START VARIABLES **/
 
@@ -1478,18 +1479,9 @@ initialize_periodic_events_cb(evutil_socket_t fd, short 
events, void *data)
   (void) events;
   (void) data;
 
-  int roles = get_my_roles(get_options());
-
   tor_event_free(initialize_periodic_events_event);
 
-  for (int i = 0; periodic_events[i].name; ++i) {
-periodic_event_item_t *item = _events[i];
-if (item->roles & roles) {
-  /* This is safe to be called on an already enabled event. */
-  periodic_event_enable(item);
-  log_debug(LD_GENERAL, "Launching periodic event %s", item->name);
-}
-  }
+  rescan_periodic_events(get_options());
 }
 
 /** Set up all the members of periodic_events[], and configure them all to be
@@ -1546,8 +1538,10 @@ rescan_periodic_events(const or_options_t *options)
 /* Enable the event if needed. It is safe to enable an event that was
  * already enabled. Same goes for disabling it. */
 if (item->roles & roles) {
+  log_debug(LD_GENERAL, "Launching periodic event %s", item->name);
   periodic_event_enable(item);
 } else {
+  log_debug(LD_GENERAL, "Disabling periodic event %s", item->name);
   periodic_event_disable(item);
 }
   }



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Rename some functions to start with a uniform prefix

2018-04-23 Thread nickm
commit bd3f8260a342b9eefc6fc164dc945605cf1ab0d1
Author: Nick Mathewson 
Date:   Wed Apr 18 11:45:44 2018 -0400

Rename some functions to start with a uniform prefix
---
 src/or/connection.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index b1a825f80..addf29ac5 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1,4 +1,4 @@
- /* Copyright (c) 2001 Matej Pfajfar.
+/* Copyright (c) 2001 Matej Pfajfar.
  * Copyright (c) 2001-2004, Roger Dingledine.
  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  * Copyright (c) 2007-2017, The Tor Project, Inc. */
@@ -138,8 +138,8 @@ static const char *proxy_type_to_string(int proxy_type);
 static int get_proxy_type(void);
 const tor_addr_t *conn_get_outbound_address(sa_family_t family,
   const or_options_t *options, unsigned int conn_type);
-static void blocked_connection_reenable_init(const or_options_t *options);
-static void schedule_blocked_connection_reenable(void);
+static void reenable_blocked_connection_init(const or_options_t *options);
+static void reenable_blocked_connection_schedule(void);
 
 /** The last addresses that our network interface seemed to have been
  * binding to.  We use this as one way to detect when our IP changes.
@@ -3093,7 +3093,7 @@ connection_read_bw_exhausted(connection_t *conn, bool 
is_global_bw)
   (void)is_global_bw;
   conn->read_blocked_on_bw = 1;
   connection_stop_reading(conn);
-  schedule_blocked_connection_reenable();
+  reenable_blocked_connection_schedule();
 }
 
 /**
@@ -3108,7 +3108,7 @@ connection_write_bw_exhausted(connection_t *conn, bool 
is_global_bw)
   (void)is_global_bw;
   conn->write_blocked_on_bw = 1;
   connection_stop_reading(conn);
-  schedule_blocked_connection_reenable();
+  reenable_blocked_connection_schedule();
 }
 
 /** If we have exhausted our global buckets, or the buckets for conn,
@@ -3191,7 +3191,7 @@ connection_bucket_init(void)
   now_ts);
   }
 
-  blocked_connection_reenable_init(options);
+  reenable_blocked_connection_init(options);
 }
 
 /** Update the global connection bucket settings to a new value. */
@@ -3281,7 +3281,7 @@ reenable_blocked_connections_cb(mainloop_event_t *ev, 
void *arg)
  * find themselves blocked on bandwidth.
  */
 static void
-blocked_connection_reenable_init(const or_options_t *options)
+reenable_blocked_connection_init(const or_options_t *options)
 {
   if (! reenable_blocked_connections_ev) {
 reenable_blocked_connections_ev =
@@ -3300,12 +3300,12 @@ blocked_connection_reenable_init(const or_options_t 
*options)
  * scheduled.
  */
 static void
-schedule_blocked_connection_reenable(void)
+reenable_blocked_connection_schedule(void)
 {
   if (reenable_blocked_connections_is_scheduled)
 return;
   if (BUG(reenable_blocked_connections_ev == NULL)) {
-blocked_connection_reenable_init(get_options());
+reenable_blocked_connection_init(get_options());
   }
   mainloop_event_schedule(reenable_blocked_connections_ev,
   _blocked_connections_delay);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Refill each token bucket at the last instant before reading/writing.

2018-04-23 Thread nickm
commit a2acb9b9e9f1a6e21625b2d77c2e7df4e35f3599
Author: Nick Mathewson 
Date:   Tue Apr 17 12:20:06 2018 -0400

Refill each token bucket at the last instant before reading/writing.

(This patch does not yet eliminate the global refill callback;
fortunately, bucket refilling is idempotent.)
---
 src/or/connection.c | 33 +
 1 file changed, 33 insertions(+)

diff --git a/src/or/connection.c b/src/or/connection.c
index 062c85c7f..7dc4ecf5c 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3186,6 +3186,34 @@ connection_bucket_adjust(const or_options_t *options)
   }
 }
 
+/**
+ * Cached value of the last coarse-timestamp when we refilled the
+ * global buckets.
+ */
+static uint32_t last_refilled_global_buckets_ts=0;
+/**
+ * Refill the token buckets for a single connection conn, and the
+ * global token buckets as appropriate.  Requires that now_ts is
+ * the time in coarse timestamp units.
+ */
+static void
+connection_bucket_refill_single(connection_t *conn, uint32_t now_ts)
+{
+  /* Note that we only check for equality here: the underlying
+   * token bucket functions can handle moving backwards in time if they
+   * need to. */
+  if (now_ts != last_refilled_global_buckets_ts) {
+token_bucket_rw_refill(_bucket, now_ts);
+token_bucket_rw_refill(_relayed_bucket, now_ts);
+last_refilled_global_buckets_ts = now_ts;
+  }
+
+  if (connection_speaks_cells(conn) && conn->state == OR_CONN_STATE_OPEN) {
+or_connection_t *or_conn = TO_OR_CONN(conn);
+token_bucket_rw_refill(_conn->bucket, now_ts);
+  }
+}
+
 /** Time has passed; increment buckets appropriately and re-enable formerly
  * blocked connections. */
 void
@@ -3196,6 +3224,7 @@ connection_bucket_refill_all(time_t now, uint32_t now_ts)
   /* refill the global buckets */
   token_bucket_rw_refill(_bucket, now_ts);
   token_bucket_rw_refill(_relayed_bucket, now_ts);
+  last_refilled_global_buckets_ts = now_ts;
 
   /* refill the per-connection buckets */
   SMARTLIST_FOREACH_BEGIN(conns, connection_t *, conn) {
@@ -3256,6 +3285,8 @@ connection_handle_read_impl(connection_t *conn)
 
   conn->timestamp_last_read_allowed = approx_time();
 
+  connection_bucket_refill_single(conn, monotime_coarse_get_stamp());
+
   switch (conn->type) {
 case CONN_TYPE_OR_LISTENER:
   return connection_handle_listener_read(conn, CONN_TYPE_OR);
@@ -3690,6 +3721,8 @@ connection_handle_write_impl(connection_t *conn, int 
force)
 
   conn->timestamp_last_write_allowed = now;
 
+  connection_bucket_refill_single(conn, monotime_coarse_get_stamp());
+
   /* Sometimes, "writable" means "connected". */
   if (connection_state_is_connecting(conn)) {
 if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*), ) < 0) {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Move responsibility for recording read/written bytes

2018-04-23 Thread nickm
commit 780d1b44cf24ad8ef321b99d8fc591f110456f98
Author: Nick Mathewson 
Date:   Tue Apr 17 16:19:45 2018 -0400

Move responsibility for recording read/written bytes

Previously this was done as part of the refill callback, but there's
no real reason to do it like that.  Since we're trying to remove the
refill callback completely, we can do this work as part of
record_num_bytes_transferred_impl(), which already does quite a lot
of this.
---
 src/or/connection.c | 20 
 src/or/hibernate.c  |  2 +-
 src/or/main.c   | 52 +++-
 src/or/main.h   |  1 +
 4 files changed, 41 insertions(+), 34 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 7dc4ecf5c..d80c68046 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -85,6 +85,7 @@
 #include "ext_orport.h"
 #include "geoip.h"
 #include "main.h"
+#include "hibernate.h"
 #include "hs_common.h"
 #include "hs_ident.h"
 #include "nodelist.h"
@@ -2989,6 +2990,10 @@ global_write_bucket_low(connection_t *conn, size_t 
attempt, int priority)
   return 0;
 }
 
+/** When did we last tell the accounting subsystem about transmitted
+ * bandwidth? */
+static time_t last_recorded_accounting_at = 0;
+
 /** Helper: adjusts our bandwidth history and informs the controller as
  * appropriate, given that we have just read num_read bytes and written
  * num_written bytes on conn. */
@@ -3019,6 +3024,20 @@ record_num_bytes_transferred_impl(connection_t *conn,
   }
   if (conn->type == CONN_TYPE_EXIT)
 rep_hist_note_exit_bytes(conn->port, num_written, num_read);
+
+  /* Remember these bytes towards statistics. */
+  stats_increment_bytes_read_and_written(num_read, num_written);
+
+  /* Remember these bytes towards accounting. */
+  if (accounting_is_enabled(get_options())) {
+if (now > last_recorded_accounting_at && last_recorded_accounting_at) {
+  accounting_add_bytes(num_read, num_written,
+   now - last_recorded_accounting_at);
+} else {
+  accounting_add_bytes(num_read, num_written, 0);
+}
+last_recorded_accounting_at = now;
+  }
 }
 
 /** We just read num_read and wrote num_written bytes
@@ -5196,6 +5215,7 @@ connection_free_all(void)
 
   tor_free(last_interface_ipv4);
   tor_free(last_interface_ipv6);
+  last_recorded_accounting_at = 0;
 }
 
 /** Log a warning, and possibly emit a control event, that received came
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 7261cf800..9fed33855 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -297,7 +297,7 @@ accounting_get_end_time,(void))
   return interval_end_time;
 }
 
-/** Called from main.c to tell us that seconds seconds have
+/** Called from connection.c to tell us that seconds seconds have
  * passed, n_read bytes have been read, and n_written
  * bytes have been written. */
 void
diff --git a/src/or/main.c b/src/or/main.c
index 3217e2d9b..66c90d9a0 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -159,13 +159,6 @@ token_bucket_rw_t global_bucket;
 /* Token bucket for relayed traffic. */
 token_bucket_rw_t global_relayed_bucket;
 
-/** What was the read/write bucket before the last second_elapsed_callback()
- * call?  (used to determine how many bytes we've read). */
-static size_t stats_prev_global_read_bucket;
-/** What was the write bucket before the last second_elapsed_callback() call?
- * (used to determine how many bytes we've written). */
-static size_t stats_prev_global_write_bucket;
-
 /* DOCDOC stats_prev_n_read */
 static uint64_t stats_prev_n_read = 0;
 /* DOCDOC stats_prev_n_written */
@@ -479,21 +472,37 @@ get_connection_array, (void))
   return connection_array;
 }
 
-/** Provides the traffic read and written over the life of the process. */
-
+/**
+ * Return the amount of network traffic read, in bytes, over the life of this
+ * process.
+ */
 MOCK_IMPL(uint64_t,
 get_bytes_read,(void))
 {
   return stats_n_bytes_read;
 }
 
-/* DOCDOC get_bytes_written */
+/**
+ * Return the amount of network traffic read, in bytes, over the life of this
+ * process.
+ */
 MOCK_IMPL(uint64_t,
 get_bytes_written,(void))
 {
   return stats_n_bytes_written;
 }
 
+/**
+ * Increment the amount of network traffic read and written, over the life of
+ * this process.
+ */
+void
+stats_increment_bytes_read_and_written(uint64_t r, uint64_t w)
+{
+  stats_n_bytes_read += r;
+  stats_n_bytes_written += w;
+}
+
 /** Set the event mask on conn to events.  (The event
  * mask is a bitmask whose bits are READ_EVENT and WRITE_EVENT)
  */
@@ -2374,12 +2383,7 @@ refill_callback(periodic_timer_t *timer, void *arg)
 {
   struct timeval now;
 
-  size_t bytes_written;
-  size_t bytes_read;
   int milliseconds_elapsed = 0;
-  int seconds_rolled_over = 0;
-
-  const or_options_t *options = get_options();
 
   (void)timer;
   (void)arg;
@@ -2392,28 +2396,13 @@ refill_callback(periodic_timer_t *timer, void *arg)
 if (mdiff > 

[tor-commits] [tor/master] Rename connection_bucket_refill to connection_bucket_refill_all

2018-04-23 Thread nickm
commit 1356d51af62f839bb29eb150e6cb37edcef24d4f
Author: Nick Mathewson 
Date:   Tue Apr 17 11:46:23 2018 -0400

Rename connection_bucket_refill to connection_bucket_refill_all

Also document its actual behavior
---
 src/or/connection.c | 5 +++--
 src/or/connection.h | 4 ++--
 src/or/main.c   | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 1e308e9b4..631d665af 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3178,9 +3178,10 @@ connection_bucket_adjust(const or_options_t *options)
   }
 }
 
-/** Time has passed; increment buckets appropriately. */
+/** Time has passed; increment buckets appropriately and re-enable formerly
+ * blocked connections. */
 void
-connection_bucket_refill(time_t now, uint32_t now_ts)
+connection_bucket_refill_all(time_t now, uint32_t now_ts)
 {
   smartlist_t *conns = get_connection_array();
 
diff --git a/src/or/connection.h b/src/or/connection.h
index 83e2bd543..a2dce2435 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -123,8 +123,8 @@ ssize_t connection_bucket_write_limit(connection_t *conn, 
time_t now);
 int global_write_bucket_low(connection_t *conn, size_t attempt, int priority);
 void connection_bucket_init(void);
 void connection_bucket_adjust(const or_options_t *options);
-void connection_bucket_refill(time_t now,
-  uint32_t now_ts);
+void connection_bucket_refill_all(time_t now,
+  uint32_t now_ts);
 void connection_read_bw_exhausted(connection_t *conn, bool is_global_bw);
 void connection_write_bw_exhausted(connection_t *conn, bool is_global_bw);
 void connection_consider_empty_read_buckets(connection_t *conn);
diff --git a/src/or/main.c b/src/or/main.c
index e21ef24f8..3217e2d9b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2407,8 +2407,8 @@ refill_callback(periodic_timer_t *timer, void *arg)
 accounting_add_bytes(bytes_read, bytes_written, seconds_rolled_over);
 
   if (milliseconds_elapsed > 0) {
-connection_bucket_refill((time_t)now.tv_sec,
- monotime_coarse_get_stamp());
+connection_bucket_refill_all((time_t)now.tv_sec,
+ monotime_coarse_get_stamp());
   }
 
   stats_prev_global_read_bucket = token_bucket_rw_get_read(_bucket);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Rename connection_bucket_round_robin -> get_share

2018-04-23 Thread nickm
commit 993f5d284d3a61b7bc397ad3671dc0ebd44b891b
Author: Nick Mathewson 
Date:   Tue Apr 17 11:42:14 2018 -0400

Rename connection_bucket_round_robin -> get_share

There was nothing round_robinish about this function.
---
 src/or/connection.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 78befee0c..1e308e9b4 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2845,14 +2845,14 @@ connection_counts_as_relayed_traffic(connection_t 
*conn, time_t now)
  * write many of them or just a few; and conn_bucket (if
  * non-negative) provides an upper limit for our answer. */
 static ssize_t
-connection_bucket_round_robin(int base, int priority,
-  ssize_t global_bucket_val, ssize_t conn_bucket)
+connection_bucket_get_share(int base, int priority,
+ssize_t global_bucket_val, ssize_t conn_bucket)
 {
   ssize_t at_most;
   ssize_t num_bytes_high = (priority ? 32 : 16) * base;
   ssize_t num_bytes_low = (priority ? 4 : 2) * base;
 
-  /* Do a rudimentary round-robin so one circuit can't hog a connection.
+  /* Do a rudimentary limiting so one circuit can't hog a connection.
* Pick at most 32 cells, at least 4 cells if possible, and if we're in
* the middle pick 1/8 of the available bandwidth. */
   at_most = global_bucket_val / 8;
@@ -2899,8 +2899,8 @@ connection_bucket_read_limit(connection_t *conn, time_t 
now)
 global_bucket_val = MIN(global_bucket_val, relayed);
   }
 
-  return connection_bucket_round_robin(base, priority,
-   global_bucket_val, conn_bucket);
+  return connection_bucket_get_share(base, priority,
+ global_bucket_val, conn_bucket);
 }
 
 /** How many bytes at most can we write onto this connection? */
@@ -2931,8 +2931,8 @@ connection_bucket_write_limit(connection_t *conn, time_t 
now)
 global_bucket_val = MIN(global_bucket_val, relayed);
   }
 
-  return connection_bucket_round_robin(base, priority,
-   global_bucket_val, conn_bucket);
+  return connection_bucket_get_share(base, priority,
+ global_bucket_val, conn_bucket);
 }
 
 /** Return 1 if the global write buckets are low enough that we



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Refactor the "block the connection on bandwidth" logic

2018-04-23 Thread nickm
commit 488e2b00bf881b97bcc8e4bbe304845ff1d79a03
Author: Nick Mathewson 
Date:   Tue Apr 17 11:39:16 2018 -0400

Refactor the "block the connection on bandwidth" logic

Right now, this patch just introduces and exposes some new
functions. Later, these functions will get a little more complexity.
---
 src/or/connection.c | 49 +++--
 src/or/connection.h |  4 
 src/or/main.c   | 15 +--
 src/or/or.h |  1 +
 4 files changed, 53 insertions(+), 16 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 957398985..78befee0c 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -772,8 +772,8 @@ connection_close_immediate(connection_t *conn)
   connection_unregister_events(conn);
 
   /* Prevent the event from getting unblocked. */
-  conn->read_blocked_on_bw =
-conn->write_blocked_on_bw = 0;
+  conn->read_blocked_on_bw = 0;
+  conn->write_blocked_on_bw = 0;
 
   if (SOCKET_OK(conn->s))
 tor_close_socket(conn->s);
@@ -3052,9 +3052,37 @@ connection_buckets_decrement(connection_t *conn, time_t 
now,
   }
 }
 
+/**
+ * Mark conn as needing to stop reading because bandwidth has been
+ * exhausted.  If is_global_bw, it is closing because global bandwidth
+ * limit has been exhausted.  Otherwise, it is closing because its own
+ * bandwidth limit has been exhausted.
+ */
+void
+connection_read_bw_exhausted(connection_t *conn, bool is_global_bw)
+{
+  (void)is_global_bw;
+  conn->read_blocked_on_bw = 1;
+  connection_stop_reading(conn);
+}
+
+/**
+ * Mark conn as needing to stop reading because write bandwidth has
+ * been exhausted.  If is_global_bw, it is closing because global
+ * bandwidth limit has been exhausted.  Otherwise, it is closing because its
+ * own bandwidth limit has been exhausted.
+*/
+void
+connection_write_bw_exhausted(connection_t *conn, bool is_global_bw)
+{
+  (void)is_global_bw;
+  conn->write_blocked_on_bw = 1;
+  connection_stop_reading(conn);
+}
+
 /** If we have exhausted our global buckets, or the buckets for conn,
  * stop reading. */
-static void
+void
 connection_consider_empty_read_buckets(connection_t *conn)
 {
   const char *reason;
@@ -3062,6 +3090,7 @@ connection_consider_empty_read_buckets(connection_t *conn)
   if (!connection_is_rate_limited(conn))
 return; /* Always okay. */
 
+  bool is_global = true;
   if (token_bucket_rw_get_read(_bucket) <= 0) {
 reason = "global read bucket exhausted. Pausing.";
   } else if (connection_counts_as_relayed_traffic(conn, approx_time()) &&
@@ -3071,17 +3100,17 @@ connection_consider_empty_read_buckets(connection_t 
*conn)
  conn->state == OR_CONN_STATE_OPEN &&
  token_bucket_rw_get_read(_OR_CONN(conn)->bucket) <= 0) {
 reason = "connection read bucket exhausted. Pausing.";
+is_global = false;
   } else
 return; /* all good, no need to stop it */
 
   LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason));
-  conn->read_blocked_on_bw = 1;
-  connection_stop_reading(conn);
+  connection_read_bw_exhausted(conn, is_global);
 }
 
 /** If we have exhausted our global buckets, or the buckets for conn,
  * stop writing. */
-static void
+void
 connection_consider_empty_write_buckets(connection_t *conn)
 {
   const char *reason;
@@ -3089,6 +3118,7 @@ connection_consider_empty_write_buckets(connection_t 
*conn)
   if (!connection_is_rate_limited(conn))
 return; /* Always okay. */
 
+  bool is_global = true;
   if (token_bucket_rw_get_write(_bucket) <= 0) {
 reason = "global write bucket exhausted. Pausing.";
   } else if (connection_counts_as_relayed_traffic(conn, approx_time()) &&
@@ -3098,12 +3128,12 @@ connection_consider_empty_write_buckets(connection_t 
*conn)
  conn->state == OR_CONN_STATE_OPEN &&
  token_bucket_rw_get_write(_OR_CONN(conn)->bucket) <= 0) {
 reason = "connection write bucket exhausted. Pausing.";
+is_global = false;
   } else
 return; /* all good, no need to stop it */
 
   LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason));
-  conn->write_blocked_on_bw = 1;
-  connection_stop_writing(conn);
+  connection_write_bw_exhausted(conn, is_global);
 }
 
 /** Initialize the global buckets to the values configured in the
@@ -3768,8 +3798,7 @@ connection_handle_write_impl(connection_t *conn, int 
force)
 /* Make sure to avoid a loop if the receive buckets are empty. */
 log_debug(LD_NET,"wanted read.");
 if (!connection_is_reading(conn)) {
-  connection_stop_writing(conn);
-  conn->write_blocked_on_bw = 1;
+  connection_write_bw_exhausted(conn, true);
   /* we'll start reading again when we get more tokens in our
* read bucket; then we'll start writing again too.
*/
diff --git a/src/or/connection.h b/src/or/connection.h
index cfe31c372..83e2bd543 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -125,6 +125,10 @@ void 

[tor-commits] [tor/master] Amend token_bucket_rw_dec to indicate which buckets became empty.

2018-04-23 Thread nickm
commit b36c450b572b561c615f0c6501664be17290318a
Author: Nick Mathewson 
Date:   Tue Apr 17 12:02:49 2018 -0400

Amend token_bucket_rw_dec to indicate which buckets became empty.
---
 src/common/token_bucket.c | 13 +
 src/common/token_bucket.h |  4 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/common/token_bucket.c b/src/common/token_bucket.c
index 747189e75..f2396ec58 100644
--- a/src/common/token_bucket.c
+++ b/src/common/token_bucket.c
@@ -238,13 +238,18 @@ token_bucket_rw_dec_write(token_bucket_rw_t *bucket,
 
 /**
  * As token_bucket_rw_dec_read and token_bucket_rw_dec_write, in a single
- * operation.
+ * operation.  Return a bitmask of TB_READ and TB_WRITE to indicate
+ * which buckets became empty.
  */
-void
+int
 token_bucket_rw_dec(token_bucket_rw_t *bucket,
 ssize_t n_read, ssize_t n_written)
 {
-  token_bucket_rw_dec_read(bucket, n_read);
-  token_bucket_rw_dec_write(bucket, n_written);
+  int flags = 0;
+  if (token_bucket_rw_dec_read(bucket, n_read))
+flags |= TB_READ;
+  if (token_bucket_rw_dec_write(bucket, n_written))
+flags |= TB_WRITE;
+  return flags;
 }
 
diff --git a/src/common/token_bucket.h b/src/common/token_bucket.h
index fb5d9fc60..0e7832e83 100644
--- a/src/common/token_bucket.h
+++ b/src/common/token_bucket.h
@@ -85,8 +85,8 @@ int token_bucket_rw_dec_read(token_bucket_rw_t *bucket,
 int token_bucket_rw_dec_write(token_bucket_rw_t *bucket,
   ssize_t n);
 
-void token_bucket_rw_dec(token_bucket_rw_t *bucket,
- ssize_t n_read, ssize_t n_written);
+int token_bucket_rw_dec(token_bucket_rw_t *bucket,
+ssize_t n_read, ssize_t n_written);
 
 static inline size_t token_bucket_rw_get_read(const token_bucket_rw_t *bucket);
 static inline size_t



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Refactor responsibility for checking global write bucket emptiness

2018-04-23 Thread nickm
commit 9af4cd6f31dd9cbfaee526f2042aa7fa501338ef
Author: Nick Mathewson 
Date:   Tue Apr 17 12:05:39 2018 -0400

Refactor responsibility for checking global write bucket emptiness

We used to do this 10x per second in connection_buckets_refill();
instead, we now do it when the bucket becomes empty. This change is
part of the work of making connection_buckets_refill() obsolete.

Closes ticket 25828; bugfix on 0.2.3.5-alpha.
---
 changes/bug25828|  7 +++
 src/or/connection.c | 28 
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/changes/bug25828 b/changes/bug25828
new file mode 100644
index 0..45cd1f4ae
--- /dev/null
+++ b/changes/bug25828
@@ -0,0 +1,7 @@
+  o Minor bugfixes (bandwidth management):
+- Consider ourselves "low on write bandwidth" if we have exhausted our
+  write bandwidth some time in the last second. This was the
+  documented behavior before, but the actual behavior was to change
+  this value every TokenBucketRefillInterval. Fixes bug 25828; bugfix on
+  0.2.3.5-alpha.
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 631d665af..062c85c7f 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2814,10 +2814,10 @@ connection_is_rate_limited(connection_t *conn)
 return 1;
 }
 
-/** Did either global write bucket run dry last second? If so,
- * we are likely to run dry again this second, so be stingy with the
- * tokens we just put in. */
-static int write_buckets_empty_last_second = 0;
+/** When was either global write bucket last empty? If this was recent, then
+ * we're probably low on bandwidth, and we should be stingy with our bandwidth
+ * usage. */
+static time_t write_buckets_last_empty_at = -100;
 
 /** How many seconds of no active local circuits will make the
  * connection revert to the "relayed" bandwidth class? */
@@ -2969,8 +2969,11 @@ global_write_bucket_low(connection_t *conn, size_t 
attempt, int priority)
   if (smaller_bucket < attempt)
 return 1; /* not enough space no matter the priority */
 
-  if (write_buckets_empty_last_second)
-return 1; /* we're already hitting our limits, no more please */
+  {
+const time_t diff = approx_time() - write_buckets_last_empty_at;
+if (diff <= 1)
+  return 1; /* we're already hitting our limits, no more please */
+  }
 
   if (priority == 1) { /* old-style v1 query */
 /* Could we handle *two* of these requests within the next two seconds? */
@@ -3042,10 +3045,15 @@ connection_buckets_decrement(connection_t *conn, time_t 
now,
   if (!connection_is_rate_limited(conn))
 return; /* local IPs are free */
 
+  unsigned flags = 0;
   if (connection_counts_as_relayed_traffic(conn, now)) {
-token_bucket_rw_dec(_relayed_bucket, num_read, num_written);
+flags = token_bucket_rw_dec(_relayed_bucket, num_read, num_written);
+  }
+  flags |= token_bucket_rw_dec(_bucket, num_read, num_written);
+
+  if (flags & TB_WRITE) {
+write_buckets_last_empty_at = now;
   }
-  token_bucket_rw_dec(_bucket, num_read, num_written);
   if (connection_speaks_cells(conn) && conn->state == OR_CONN_STATE_OPEN) {
 or_connection_t *or_conn = TO_OR_CONN(conn);
 token_bucket_rw_dec(_conn->bucket, num_read, num_written);
@@ -3185,10 +3193,6 @@ connection_bucket_refill_all(time_t now, uint32_t now_ts)
 {
   smartlist_t *conns = get_connection_array();
 
-  write_buckets_empty_last_second =
-token_bucket_rw_get_write(_bucket) <= 0 ||
-token_bucket_rw_get_write(_relayed_bucket) <= 0;
-
   /* refill the global buckets */
   token_bucket_rw_refill(_bucket, now_ts);
   token_bucket_rw_refill(_relayed_bucket, now_ts);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Fix a compilation warning on clang

2018-04-23 Thread nickm
commit 087ace7009feff4259c5a150a38734c0ded90e80
Author: Nick Mathewson 
Date:   Tue Apr 17 18:41:39 2018 -0400

Fix a compilation warning on clang
---
 src/or/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 444294ee7..b1a825f80 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3034,7 +3034,7 @@ record_num_bytes_transferred_impl(connection_t *conn,
   if (accounting_is_enabled(get_options())) {
 if (now > last_recorded_accounting_at && last_recorded_accounting_at) {
   accounting_add_bytes(num_read, num_written,
-   now - last_recorded_accounting_at);
+   (int)(now - last_recorded_accounting_at));
 } else {
   accounting_add_bytes(num_read, num_written, 0);
 }



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed

2018-04-23 Thread translation
commit 6d124491afc37ee4d66548fd762c08b07d487023
Author: Translation commit bot 
Date:   Mon Apr 23 16:15:11 2018 +

Update translations for bridgedb_completed
---
 pt_BR/LC_MESSAGES/bridgedb.po | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po
index 589710e9c..4aa4a8c87 100644
--- a/pt_BR/LC_MESSAGES/bridgedb.po
+++ b/pt_BR/LC_MESSAGES/bridgedb.po
@@ -22,7 +22,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB=bridgedb-reported,msgid=isis,sysrqb=isis'\n"
 "POT-Creation-Date: 2015-07-25 03:40+\n"
-"PO-Revision-Date: 2018-04-23 15:38+\n"
+"PO-Revision-Date: 2018-04-23 15:59+\n"
 "Last-Translator: Cláudio Carvalho \n"
 "Language-Team: Portuguese (Brazil) 
(http://www.transifex.com/otf/torproject/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
@@ -73,7 +73,7 @@ msgstr "Mostrar Código QR"
 
 #: bridgedb/https/templates/bridges.html:52
 msgid "QRCode for your bridge lines"
-msgstr "Código QR para sua ponte de conexão"
+msgstr "Código QR para suas pontes de conexão"
 
 #. TRANSLATORS: Please translate this into some silly way to say
 #. "There was a problem!" in your language. For example,
@@ -92,7 +92,7 @@ msgstr "Parece que houve um erro ao obter seu Código QR."
 msgid ""
 "This QRCode contains your bridge lines. Scan it with a QRCode reader to copy"
 " your bridge lines onto mobile and other devices."
-msgstr "Este Código QR contém suas pontes de conexão. Escaneie-o com um 
leitor de Código QR para copiar as pontes de conexão para dispositivos 
móveis e outros."
+msgstr "O Código QR contém suas pontes de conexão. Escaneie com um leitor 
de Código QR para copiar as pontes de conexão para dispositivos móveis e 
outros."
 
 #: bridgedb/https/templates/bridges.html:131
 msgid "There currently aren't any bridges available..."
@@ -142,7 +142,7 @@ msgstr "Agora, %s inserir as pontes no Navegador Tor %s"
 #: bridgedb/https/templates/options.html:38
 #, python-format
 msgid "%sJ%sust give me bridges!"
-msgstr "%sS%só me dê pontes!"
+msgstr "%sA%spenas pontes"
 
 #: bridgedb/https/templates/options.html:51
 msgid "Advanced Options"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/bridgedb] Update translations for bridgedb

2018-04-23 Thread translation
commit dea1ca76458ecffabbb24481b678ed8350a77793
Author: Translation commit bot 
Date:   Mon Apr 23 16:15:04 2018 +

Update translations for bridgedb
---
 pt_BR/LC_MESSAGES/bridgedb.po | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po
index 589710e9c..4aa4a8c87 100644
--- a/pt_BR/LC_MESSAGES/bridgedb.po
+++ b/pt_BR/LC_MESSAGES/bridgedb.po
@@ -22,7 +22,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB=bridgedb-reported,msgid=isis,sysrqb=isis'\n"
 "POT-Creation-Date: 2015-07-25 03:40+\n"
-"PO-Revision-Date: 2018-04-23 15:38+\n"
+"PO-Revision-Date: 2018-04-23 15:59+\n"
 "Last-Translator: Cláudio Carvalho \n"
 "Language-Team: Portuguese (Brazil) 
(http://www.transifex.com/otf/torproject/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
@@ -73,7 +73,7 @@ msgstr "Mostrar Código QR"
 
 #: bridgedb/https/templates/bridges.html:52
 msgid "QRCode for your bridge lines"
-msgstr "Código QR para sua ponte de conexão"
+msgstr "Código QR para suas pontes de conexão"
 
 #. TRANSLATORS: Please translate this into some silly way to say
 #. "There was a problem!" in your language. For example,
@@ -92,7 +92,7 @@ msgstr "Parece que houve um erro ao obter seu Código QR."
 msgid ""
 "This QRCode contains your bridge lines. Scan it with a QRCode reader to copy"
 " your bridge lines onto mobile and other devices."
-msgstr "Este Código QR contém suas pontes de conexão. Escaneie-o com um 
leitor de Código QR para copiar as pontes de conexão para dispositivos 
móveis e outros."
+msgstr "O Código QR contém suas pontes de conexão. Escaneie com um leitor 
de Código QR para copiar as pontes de conexão para dispositivos móveis e 
outros."
 
 #: bridgedb/https/templates/bridges.html:131
 msgid "There currently aren't any bridges available..."
@@ -142,7 +142,7 @@ msgstr "Agora, %s inserir as pontes no Navegador Tor %s"
 #: bridgedb/https/templates/options.html:38
 #, python-format
 msgid "%sJ%sust give me bridges!"
-msgstr "%sS%só me dê pontes!"
+msgstr "%sA%spenas pontes"
 
 #: bridgedb/https/templates/options.html:51
 msgid "Advanced Options"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [webwml/master] Change isa profile picture

2018-04-23 Thread hiro
commit f52353349b2faedd19dbcdda7a761a0f0804d204
Author: hiro 
Date:   Mon Apr 23 18:17:02 2018 +0200

Change isa profile picture
---
 images/people/orig/isabela.jpg | Bin 16817 -> 896719 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/images/people/orig/isabela.jpg b/images/people/orig/isabela.jpg
index 4d0b1fc2..65cf9af1 100644
Binary files a/images/people/orig/isabela.jpg and 
b/images/people/orig/isabela.jpg differ

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-and-https] Update translations for tor-and-https

2018-04-23 Thread translation
commit 83c0deed935ef07b408c62af14a2092b343c1043
Author: Translation commit bot 
Date:   Mon Apr 23 16:47:39 2018 +

Update translations for tor-and-https
---
 ru.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ru.po b/ru.po
index 2b9e9bfac..725db43ea 100644
--- a/ru.po
+++ b/ru.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-04-23 14:10+\n"
+"PO-Revision-Date: 2018-04-23 16:31+\n"
 "Last-Translator: e Translators \n"
 "Language-Team: Russian 
(http://www.transifex.com/otf/torproject/language/ru/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed

2018-04-23 Thread translation
commit 046cd354077985cbb0a1ff3d31888d5614f89b52
Author: Translation commit bot 
Date:   Mon Apr 23 15:45:11 2018 +

Update translations for bridgedb_completed
---
 pt_BR/LC_MESSAGES/bridgedb.po | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po
index 53e4b9329..589710e9c 100644
--- a/pt_BR/LC_MESSAGES/bridgedb.po
+++ b/pt_BR/LC_MESSAGES/bridgedb.po
@@ -5,6 +5,7 @@
 # Translators:
 # Communia , 2013-2017
 # anominino anomino , 2018
+# Cláudio Carvalho , 2018
 # Danton Medrado, 2015
 # Eduardo Bonsi, 2015
 # Eduardo Loeffel Noce Gobi , 2016-2017
@@ -21,8 +22,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB=bridgedb-reported,msgid=isis,sysrqb=isis'\n"
 "POT-Creation-Date: 2015-07-25 03:40+\n"
-"PO-Revision-Date: 2018-04-12 18:54+\n"
-"Last-Translator: Joeffison Silvério de Andrade \n"
+"PO-Revision-Date: 2018-04-23 15:38+\n"
+"Last-Translator: Cláudio Carvalho \n"
 "Language-Team: Portuguese (Brazil) 
(http://www.transifex.com/otf/torproject/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -72,7 +73,7 @@ msgstr "Mostrar Código QR"
 
 #: bridgedb/https/templates/bridges.html:52
 msgid "QRCode for your bridge lines"
-msgstr "Código QR para suas pontes de conexão"
+msgstr "Código QR para sua ponte de conexão"
 
 #. TRANSLATORS: Please translate this into some silly way to say
 #. "There was a problem!" in your language. For example,

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/bridgedb] Update translations for bridgedb

2018-04-23 Thread translation
commit c6404bc75f68c95ea6329a335acbedb44bed0504
Author: Translation commit bot 
Date:   Mon Apr 23 15:45:04 2018 +

Update translations for bridgedb
---
 pt_BR/LC_MESSAGES/bridgedb.po | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po
index 53e4b9329..589710e9c 100644
--- a/pt_BR/LC_MESSAGES/bridgedb.po
+++ b/pt_BR/LC_MESSAGES/bridgedb.po
@@ -5,6 +5,7 @@
 # Translators:
 # Communia , 2013-2017
 # anominino anomino , 2018
+# Cláudio Carvalho , 2018
 # Danton Medrado, 2015
 # Eduardo Bonsi, 2015
 # Eduardo Loeffel Noce Gobi , 2016-2017
@@ -21,8 +22,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB=bridgedb-reported,msgid=isis,sysrqb=isis'\n"
 "POT-Creation-Date: 2015-07-25 03:40+\n"
-"PO-Revision-Date: 2018-04-12 18:54+\n"
-"Last-Translator: Joeffison Silvério de Andrade \n"
+"PO-Revision-Date: 2018-04-23 15:38+\n"
+"Last-Translator: Cláudio Carvalho \n"
 "Language-Team: Portuguese (Brazil) 
(http://www.transifex.com/otf/torproject/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -72,7 +73,7 @@ msgstr "Mostrar Código QR"
 
 #: bridgedb/https/templates/bridges.html:52
 msgid "QRCode for your bridge lines"
-msgstr "Código QR para suas pontes de conexão"
+msgstr "Código QR para sua ponte de conexão"
 
 #. TRANSLATORS: Please translate this into some silly way to say
 #. "There was a problem!" in your language. For example,

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [webwml/master] Add juga to the people page

2018-04-23 Thread atagar
commit f62cfe83d7589d7b454edf4ca928f89c9e45f421
Author: Damian Johnson 
Date:   Mon Apr 23 09:34:05 2018 -0700

Add juga to the people page
---
 about/en/corepeople.wml | 101 
 images/people/juga.png  | Bin 0 -> 14026 bytes
 images/people/orig/juga.png | Bin 0 -> 97645 bytes
 3 files changed, 55 insertions(+), 46 deletions(-)

diff --git a/about/en/corepeople.wml b/about/en/corepeople.wml
index 0a3076ae..6afc78b8 100644
--- a/about/en/corepeople.wml
+++ b/about/en/corepeople.wml
@@ -376,6 +376,17 @@
 
 
 
+  
+  
+  https://juga.space/files/juga.asc;>
+  juga
+  IRC: juga
+  Contributed to OONI, bug tracker features, 
wrote tordyguards. Currently working on bandwidth scanner.
+
+  
+
+  
+
   
   
   https://twitter.com/mittenzwei;>
@@ -383,9 +394,7 @@
   Julius Mittenzwei
   Germany-based lawyer and Internet 
activist.
 
-  
 
-  
 
   
   
@@ -394,7 +403,9 @@
   IRC: juris
   Board member of torservers.net.
 
+  
 
+  
 
   
   
@@ -403,9 +414,7 @@
   IRC: karsten
   Primary researcher and developer into https://metrics.torproject.org/;>anonymous metrics which started as a 
National Science Foundation grant.
 
-  
 
-  
 
   
   
@@ -414,7 +423,9 @@
   IRC: kat5
   Volunteer on the Community Team. Helps with 
t-shirts for relay operators and other odds and ends.
 
+  
 
+  
 
   
   
@@ -424,16 +435,16 @@
   IRC: ailanthus
   Writes about Tor in mainstream and technical 
publications and conducts community workshops to teach people about Tor.
 
-  
 
-  
 
   
   
   Leif Ryge
   Works on security analysis, designer of 
bananaphone transport.
 
+  
 
+  
 
   
   
@@ -442,9 +453,7 @@
   IRC: linda
   Former UX team lead.
 
-  
 
-  
 
   
   
@@ -453,7 +462,9 @@
   IRC: ln5
   Swedish advocate and Tor Board member. Works on 
implementing IPv6 in Tor, build automation, and runs a directory 
authority.
 
+  
 
+  
 
   
   
@@ -463,9 +474,7 @@
   IRC: agrabeli
   Maria manages OONI's Partnership Program and 
writes research reports on internet censorship around the world.
 
-  
 
-  
 
   
   
@@ -474,7 +483,9 @@
   IRC: mcs
   Developer on the Tor Browser team.
 
+  
 
+  
 
   
   
@@ -482,9 +493,7 @@
   Matt Blaze
   Chairs the Tor Board of Directors. Professor at 
the University of Pennsylvania where he researches security, privacy, and 
anonymity.
 
-  
 
-  
 
   
   
@@ -493,7 +502,9 @@
   IRC: pastly
   http://mattssi4lhud.onion/;>Implemented the http://www.robgjansen.com/publications/kist-sec2014.pdf;>KIST 
scheduler into Tor. Helps safely measure Tor. Says helpful things on 
IRC.
 
+  
 
+  
 
   
   
@@ -503,9 +514,7 @@
   IRC: sysrqb
   Worked on tor, torsocks, and many other 
projects. Helped maintain and develop BridgeDB.
 
-  
 
-  
 
   
   
@@ -515,7 +524,9 @@
   IRC: meejah
   https://meejah.ca;>Author of https://github.com/meejah/txtorcon;>txtorcon, https://github.com/meejah/carml;>carml and other Tor Python tools 
including some for bad-relay hunting.
 
+  
 
+  
 
   
   
@@ -525,9 +536,7 @@
   IRC: mtigas
   Works on https://mike.tig.as/onionbrowser/;>Onion Browser, iOS, and 
hacker-journalist at https://www.propublica.org/;>ProPublica 
running their https://www.propub3r6espa33w.onion/;>onion 
service.
 
-  
 
-  
 
   
   
@@ -536,7 +545,9 @@
   Moritz Bartl
   Co-founder of https://www.torservers.net/;>torservers.net, a network of non-profit 
organizations that run Tor exit relays.
 
+  
 
+  
 
   
   
@@ -545,9 +556,7 @@
   IRC: n8fr8
   Founder of the https://guardianproject.info/;>Guardian Project. Orbot lead developer 
and contributor to Orfox, Onion Browser and NetCipher SDK. Director of 
Technology at Tibet Action Institute.
 
-  
 
-  
 
   
   
@@ -555,7 +564,9 @@
   IRC: nickhopper
   https://www-users.cs.umn.edu/~hopper/;>Researcher interested in 
improving Tor's performance and resistance to traffic analysis. Some of my work 
is described https://www-users.cs.umn.edu/~hopper/research.html;>here.
 
+  
 
+  
 
   
   
@@ -565,9 +576,7 @@
   IRC: nickm
   One of the three original designers of Tor - 
does a lot of the ongoing design work, and coordinates and leads ongoing 
development.
 
-  
 
-  
 
   
   
@@ -576,7 +585,9 @@
   IRC: boklm
   Works on Tor Browser.
 
+  
 
+  
 
   
   
@@ -586,9 +597,7 @@
   IRC: mrphs
   His main area of interests are End-users 
Accessibility/Security, UX, Censorship, Advocacy and Onion Services.
 
-  
 
-  
 
   

[tor-commits] [webwml/master] Pgp key link for Gus

2018-04-23 Thread atagar
commit 50d3e6d0601ab31ec85da936d0dd452dd8dce29a
Author: Damian Johnson 
Date:   Mon Apr 23 09:21:40 2018 -0700

Pgp key link for Gus

I struggled to find Gus' key when first writing their entry. Link provided 
by
Gus.
---
 about/en/corepeople.wml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/about/en/corepeople.wml b/about/en/corepeople.wml
index 6d249088..0a3076ae 100644
--- a/about/en/corepeople.wml
+++ b/about/en/corepeople.wml
@@ -267,6 +267,7 @@
 
   
   
+  https://pgp.mit.edu/pks/lookup?op=vindex=0x8BDC87FB7215E189;>
   Gustavo Gus
   IRC: ggus
   Volunteer on the Community Team, Tor advocate, 
trainer and relay operator in Latin America. CryptoRave organizer.



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tor-and-https_completed] Update translations for tor-and-https_completed

2018-04-23 Thread translation
commit c76c1b613766ed021cb0e46a361f1d2a426a63c5
Author: Translation commit bot 
Date:   Mon Apr 23 16:47:45 2018 +

Update translations for tor-and-https_completed
---
 ru.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ru.po b/ru.po
index 2b9e9bfac..725db43ea 100644
--- a/ru.po
+++ b/ru.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-04-23 14:10+\n"
+"PO-Revision-Date: 2018-04-23 16:31+\n"
 "Last-Translator: e Translators \n"
 "Language-Team: Russian 
(http://www.transifex.com/otf/torproject/language/ru/)\n"
 "MIME-Version: 1.0\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits