[tor-commits] [translation/torbutton-abouttorproperties] Update translations for torbutton-abouttorproperties

2016-11-03 Thread translation
commit 9ad2b0f97922d71796f80f1fe726f10668b9e722
Author: Translation commit bot 
Date:   Fri Nov 4 02:47:09 2016 +

Update translations for torbutton-abouttorproperties
---
 zh_CN/abouttor.properties | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/zh_CN/abouttor.properties b/zh_CN/abouttor.properties
index 261c745..4d017c3 100644
--- a/zh_CN/abouttor.properties
+++ b/zh_CN/abouttor.properties
@@ -20,9 +20,9 @@ aboutTor.searchDC.privacy.link=https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
 
-aboutTor.donationBanner.donate=Donate Now!
-aboutTor.donationBanner.heart=Tor is at the heart of Internet freedom
-aboutTor.donationBanner.tagline1=Millions of People Depend on Tor for Online 
Security & Privacy
+aboutTor.donationBanner.donate=立即捐助!
+aboutTor.donationBanner.heart=Tor 是互联网自由的核心
+aboutTor.donationBanner.tagline1=数百万人依靠 Tor 安å…
¨ã€ç§å¯†åœ°ä¸Šç½‘
 aboutTor.donationBanner.tagline2=A Network of People Protecting People
 aboutTor.donationBanner.tagline3=Surveillance = Oppression
 aboutTor.donationBanner.tagline4=Protecting Journalists, Activists & 
Whistleblowers Since 2006

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


[tor-commits] [stem/master] Test that we install all modules

2016-11-03 Thread atagar
commit ff6afbc7732ef321b261d649c470838d472a1e8f
Author: Damian Johnson 
Date:   Thu Nov 3 19:11:20 2016 -0700

Test that we install all modules

I've screwed up on this enough times that we might as well have a test
for it. :P
---
 test/integ/installation.py | 15 +++
 test/settings.cfg  |  1 +
 test/unit/installation.py  | 47 ++
 3 files changed, 55 insertions(+), 8 deletions(-)

diff --git a/test/integ/installation.py b/test/integ/installation.py
index 50c0339..007b911 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -8,8 +8,7 @@ import stem
 import stem.util.system
 
 import test.runner
-
-BASE_DIRECTORY = os.path.sep.join(__file__.split(os.path.sep)[:-3])
+import test.util
 
 
 class TestInstallation(unittest.TestCase):
@@ -22,13 +21,13 @@ class TestInstallation(unittest.TestCase):
 self.skip_reason = None
 self.installation_error = None
 
-if not os.path.exists(os.path.join(BASE_DIRECTORY, 'setup.py')):
+if not os.path.exists(os.path.join(test.util.STEM_BASE, 'setup.py')):
   self.skip_reason = '(only for git checkout)'
 
 original_cwd = os.getcwd()
 
 try:
-  os.chdir(BASE_DIRECTORY)
+  os.chdir(test.util.STEM_BASE)
   stem.util.system.call(sys.executable + ' setup.py install --prefix 
/tmp/stem_test')
   stem.util.system.call(sys.executable + ' setup.py clean --all')  # tidy 
up the build directory
   site_packages_paths = glob.glob('/tmp/stem_test/lib*/*/site-packages')
@@ -79,12 +78,12 @@ class TestInstallation(unittest.TestCase):
 
 expected, installed = set(), set()
 
-for root, dirnames, filenames in os.walk(os.path.join(BASE_DIRECTORY, 
'stem')):
+for root, dirnames, filenames in os.walk(os.path.join(test.util.STEM_BASE, 
'stem')):
   for filename in filenames:
-  file_format = filename.split('.')[-1]
+file_format = filename.split('.')[-1]
 
-  if file_format not in ('pyc', 'swp', 'swo'):
-expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 
1:])
+if file_format not in ('pyc', 'swp', 'swo'):
+  expected.add(os.path.join(root, filename)[len(test.util.STEM_BASE) + 
1:])
 
 for root, dirnames, filenames in os.walk(self.site_packages_path):
   for filename in filenames:
diff --git a/test/settings.cfg b/test/settings.cfg
index 4579f09..e5174d2 100644
--- a/test/settings.cfg
+++ b/test/settings.cfg
@@ -170,6 +170,7 @@ test.unit_tests
 |test.unit.util.term.TestTerminal
 |test.unit.util.tor_tools.TestTorTools
 |test.unit.util.__init__.TestBaseUtil
+|test.unit.installation.TestInstallation
 |test.unit.descriptor.export.TestExport
 |test.unit.descriptor.reader.TestDescriptorReader
 |test.unit.descriptor.remote.TestDescriptorDownloader
diff --git a/test/unit/installation.py b/test/unit/installation.py
new file mode 100644
index 000..6d36b7e
--- /dev/null
+++ b/test/unit/installation.py
@@ -0,0 +1,47 @@
+import os
+import re
+import unittest
+
+import test.runner
+import test.util
+
+
+class TestInstallation(unittest.TestCase):
+  # TODO: remove when dropping support for python 2.6
+  skip_reason = 'setUpClass() unsupported in python 2.6'
+
+  @classmethod
+  def setUpClass(self):
+setup_path = os.path.join(test.util.STEM_BASE, 'setup.py')
+self.skip_reason = None
+self.setup_contents = False
+
+if os.path.exists(setup_path):
+  with open(setup_path) as setup_file:
+self.setup_contents = setup_file.read()
+else:
+  self.skip_reason = '(only for git checkout)'
+
+  def test_installation_has_all_modules(self):
+if self.skip_reason:
+  test.runner.skip(self, self.skip_reason)
+  return True
+
+# Modules cited my our setup.py looks like...
+#
+#   packages = ['stem', 'stem.descriptor', 'stem.util'],
+
+modules = re.search('packages = \[(.*)\]', 
self.setup_contents).group(1).replace("'", '').replace(',', '').split()
+module_paths = dict([(m, os.path.join(test.util.STEM_BASE, m.replace('.', 
os.path.sep))) for m in modules])
+
+for module, path in module_paths.items():
+  if not os.path.exists(path):
+self.fail("module %s from our setup.py doesn't exit at %s" % (module, 
path))
+
+for entry in os.walk(os.path.join(test.util.STEM_BASE, 'stem')):
+  path = entry[0]
+
+  if path.endswith('__pycache__'):
+continue
+  elif path not in module_paths.values():
+self.fail("%s isn't installed by our setup.py" % path)



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


[tor-commits] [stem/master] Test that we install all non-source files

2016-11-03 Thread atagar
commit f7be7a8236217fcc57e1a7829ca2affa12d7df8d
Author: Damian Johnson 
Date:   Thu Nov 3 19:32:22 2016 -0700

Test that we install all non-source files

Another easy gotcha that's bitten me before. Like modules, non-source files
need to be explicitely listed.
---
 test/unit/installation.py | 49 ---
 1 file changed, 42 insertions(+), 7 deletions(-)

diff --git a/test/unit/installation.py b/test/unit/installation.py
index 6d36b7e..6bd8f63 100644
--- a/test/unit/installation.py
+++ b/test/unit/installation.py
@@ -1,3 +1,4 @@
+import json
 import os
 import re
 import unittest
@@ -22,7 +23,7 @@ class TestInstallation(unittest.TestCase):
 else:
   self.skip_reason = '(only for git checkout)'
 
-  def test_installation_has_all_modules(self):
+  def test_installs_all_modules(self):
 if self.skip_reason:
   test.runner.skip(self, self.skip_reason)
   return True
@@ -31,17 +32,51 @@ class TestInstallation(unittest.TestCase):
 #
 #   packages = ['stem', 'stem.descriptor', 'stem.util'],
 
-modules = re.search('packages = \[(.*)\]', 
self.setup_contents).group(1).replace("'", '').replace(',', '').split()
+modules = json.loads(re.search('packages = (\[.*\])', 
self.setup_contents).group(1).replace("'", '"'))
 module_paths = dict([(m, os.path.join(test.util.STEM_BASE, m.replace('.', 
os.path.sep))) for m in modules])
 
 for module, path in module_paths.items():
   if not os.path.exists(path):
-self.fail("module %s from our setup.py doesn't exit at %s" % (module, 
path))
+self.fail("setup.py's module %s doesn't exist at %s" % (module, path))
 
 for entry in os.walk(os.path.join(test.util.STEM_BASE, 'stem')):
-  path = entry[0]
+  directory = entry[0]
 
-  if path.endswith('__pycache__'):
+  if directory.endswith('__pycache__'):
 continue
-  elif path not in module_paths.values():
-self.fail("%s isn't installed by our setup.py" % path)
+  elif directory not in module_paths.values():
+self.fail("setup.py doesn't install %s" % directory)
+
+  def test_installs_all_data_files(self):
+if self.skip_reason:
+  test.runner.skip(self, self.skip_reason)
+  return True
+
+# Checking that we have all non-source files. Data looks like...
+#
+#   package_data = {'stem': ['cached_tor_manual.cfg', 'settings.cfg']},
+
+package_data = json.loads(re.search('package_data = (\{.*\})', 
self.setup_contents).group(1).replace("'", '"'))
+data_files = []
+
+for module, files in package_data.items():
+  for module_file in files:
+data_files.append(os.path.join(test.util.STEM_BASE, 
module.replace('.', os.path.sep), module_file))
+
+for path in data_files:
+  if not os.path.exists(path):
+self.fail("setup.py installs a data file that doesn't exist: %s" % 
path)
+
+for entry in os.walk(os.path.join(test.util.STEM_BASE, 'stem')):
+  directory = entry[0]
+
+  if directory.endswith('__pycache__'):
+continue
+
+  for filename in entry[2]:
+path = os.path.join(directory, filename)
+
+if path.endswith('.py') or path.endswith('.pyc'):
+  continue
+elif path not in data_files:
+  self.fail("setup.py doesn't install %s" % path)



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


[tor-commits] [stem/master] Missed pep8 renaming

2016-11-03 Thread atagar
commit 8eafe277269aede1595f9193c552702adb23beca
Author: Damian Johnson 
Date:   Thu Nov 3 18:23:17 2016 -0700

Missed pep8 renaming

Oops, missed a couple spots where we still call it pep8.
---
 docs/faq.rst | 19 +--
 requirements.txt |  2 +-
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/docs/faq.rst b/docs/faq.rst
index 582dfbf..2e022e6 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -35,9 +35,15 @@ General Information
 What is Stem?
 -
 
-Stem is a Python controller library that you can use to interact with `Tor 
`_. With it you can write scripts and applications 
with capabilities similar `arm `_.
+Stem is a Python controller library that you can use to interact with `Tor
+`_. With it you can write scripts and applications
+with capabilities similar `arm `_.
 
-From a technical standpoint, Stem is a Python implementation of Tor's 
`directory `_ and 
`control specifications 
`_. `To get 
started see our tutorials! `_
+From a technical standpoint, Stem is a Python implementation of Tor's
+`directory `_ and
+`control specifications
+`_. `To get
+started see our tutorials! `_
 
 .. _does_stem_have_any_dependencies:
 
@@ -457,7 +463,7 @@ To start hacking on Stem please do the following and don't 
hesitate to let me
 know if you get stuck or would like to discuss anything!
 
 #. Clone our `git `_ repository: **git clone 
https://git.torproject.org/stem.git**
-#. Get our test depdendencies: **sudo pip install mock pep8 pyflakes**.
+#. Get our test depdendencies: **sudo pip install mock pycodestyle pyflakes**.
 #. Find a `bug or feature 
`_ that sounds 
interesting.
 #. When you have something that you would like to contribute back do the 
following...
 
@@ -501,9 +507,10 @@ can exercise alternate Tor configurations with the 
``--target`` argument (see
   ~/stem$ ./run_tests.py --integ --target RUN_COOKIE
 
 **Static** tests use `pyflakes `_ to do static
-error checking and `pep8 `_ for style
-checking. If you have them installed then they automatically take place as part
-of all test runs.
+error checking and `pycodestyle
+`_ for style checking. If you
+have them installed then they automatically take place as part of all test
+runs.
 
 See ``run_tests.py --help`` for more usage information.
 
diff --git a/requirements.txt b/requirements.txt
index 85d85f1..ce5d201 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 mock
 pyflakes
-pep8
+pycodestyle
 pycrypto
 tox



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


[tor-commits] [stem/master] Duplicate key in test_cwd_lsof()

2016-11-03 Thread atagar
commit 139e598af7529b270eaf279ed4d89d47bfdcba56
Author: Damian Johnson 
Date:   Thu Nov 3 19:33:38 2016 -0700

Duplicate key in test_cwd_lsof()

Oops, good catch on...

  https://trac.torproject.org/projects/tor/ticket/20477#comment:5
---
 test/unit/util/system.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/unit/util/system.py b/test/unit/util/system.py
index 509b9cb..e519aec 100644
--- a/test/unit/util/system.py
+++ b/test/unit/util/system.py
@@ -362,7 +362,7 @@ class TestSystem(unittest.TestCase):
 
 responses = {
   '75717': ['p75717', 'n/Users/atagar/tor/src/or'],
-  '75717': ['p75717', 'fcwd', 'n/Users/atagar/tor/src/or'],
+  '75718': ['p75718', 'fcwd', 'n/Users/atagar/tor/src/or'],
   '1234': ['malformed output'],
   '7878': [],
 }
@@ -370,7 +370,7 @@ class TestSystem(unittest.TestCase):
 call_mock.side_effect = mock_call(system.GET_CWD_LSOF, responses)
 
 for test_input in responses:
-  expected_response = '/Users/atagar/tor/src/or' if test_input == '75717' 
else None
+  expected_response = '/Users/atagar/tor/src/or' if test_input in 
('75717', '75718') else None
   self.assertEqual(expected_response, system.cwd(test_input))
 
   def test_tail(self):

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


[tor-commits] [translation/torbutton-abouttorproperties] Update translations for torbutton-abouttorproperties

2016-11-03 Thread translation
commit 6ce4b41f35edb33b0d200ec74266e58770c6cf46
Author: Translation commit bot 
Date:   Fri Nov 4 01:47:16 2016 +

Update translations for torbutton-abouttorproperties
---
 vi/abouttor.properties | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/vi/abouttor.properties b/vi/abouttor.properties
index de7f01a..7984d21 100644
--- a/vi/abouttor.properties
+++ b/vi/abouttor.properties
@@ -20,9 +20,9 @@ aboutTor.searchDC.privacy.link=https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
 
-aboutTor.donationBanner.donate=Donate Now!
-aboutTor.donationBanner.heart=Tor is at the heart of Internet freedom
-aboutTor.donationBanner.tagline1=Millions of People Depend on Tor for Online 
Security & Privacy
-aboutTor.donationBanner.tagline2=A Network of People Protecting People
-aboutTor.donationBanner.tagline3=Surveillance = Oppression
-aboutTor.donationBanner.tagline4=Protecting Journalists, Activists & 
Whistleblowers Since 2006
+aboutTor.donationBanner.donate=Tài trợ ngay bây giờ!
+aboutTor.donationBanner.heart=Tor đang ở trái tim của sự tự do trên 
Internet
+aboutTor.donationBanner.tagline1=Hàng triệu người tin vào Tor vì an 
ninh trực tuyến và sự riêng tư
+aboutTor.donationBanner.tagline2=Một mạng lưới của những người 
đang bảo vệ người
+aboutTor.donationBanner.tagline3=Sự giám sát  = Sự đàn áp
+aboutTor.donationBanner.tagline4=Đang bảo vệ các nhà báo, nhà hoạt 
động & những người thổi còi từ năm 2006

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


[tor-commits] [translation/torbutton-abouttorproperties_completed] Update translations for torbutton-abouttorproperties_completed

2016-11-03 Thread translation
commit 3d1995a3f827bd10d53253e1b4aced9687e2d5c4
Author: Translation commit bot 
Date:   Fri Nov 4 01:47:20 2016 +

Update translations for torbutton-abouttorproperties_completed
---
 vi/abouttor.properties | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/vi/abouttor.properties b/vi/abouttor.properties
index b8a93ad..7984d21 100644
--- a/vi/abouttor.properties
+++ b/vi/abouttor.properties
@@ -19,3 +19,10 @@ aboutTor.searchDC.privacy=Tìm kiếm một 
cách an toànv
 aboutTor.searchDC.privacy.link=https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
+
+aboutTor.donationBanner.donate=Tài trợ ngay bây giờ!
+aboutTor.donationBanner.heart=Tor đang ở trái tim của sự tự do trên 
Internet
+aboutTor.donationBanner.tagline1=Hàng triệu người tin vào Tor vì an 
ninh trực tuyến và sự riêng tư
+aboutTor.donationBanner.tagline2=Một mạng lưới của những người 
đang bảo vệ người
+aboutTor.donationBanner.tagline3=Sự giám sát  = Sự đàn áp
+aboutTor.donationBanner.tagline4=Đang bảo vệ các nhà báo, nhà hoạt 
động & những người thổi còi từ năm 2006

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


[tor-commits] [tor-messenger-build/master] Use the more general input file name

2016-11-03 Thread arlo
commit 6c4c6eb095a1e562db6647b93262e80858a360fd
Author: Arlo Breault 
Date:   Thu Nov 3 16:11:22 2016 -0700

Use the more general input file name
---
 projects/tor-messenger/build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/projects/tor-messenger/build b/projects/tor-messenger/build
index c855675..821cd4e 100755
--- a/projects/tor-messenger/build
+++ b/projects/tor-messenger/build
@@ -93,12 +93,12 @@ mv bundle tor-messenger
 makensis tor-messenger.nsi
 
 tar xf $rootdir/[% c('input_files_by_name/python-future') %]
-cd future-0.16.0/
+cd $(echo [% c('input_files_by_name/python-future') %] | sed s/\.tar\.gz$//)
 python setup.py install --user
 cd ..
 
 tar xf $rootdir/[% c('input_files_by_name/python-pefile') %]
-cd pefile-2016.3.28/
+cd $(echo [% c('input_files_by_name/python-pefile') %] | sed s/\.tar\.gz$//)
 python setup.py install --user
 cd ..
 

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


[tor-commits] [tor/master] Split a wide line

2016-11-03 Thread nickm
commit bd6aa4f3d19a571adeaa956728f7e842d847c4ee
Author: Nick Mathewson 
Date:   Thu Nov 3 19:12:18 2016 -0400

Split a wide line
---
 src/or/rendservice.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index d31081a..7083051 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -281,7 +281,8 @@ rend_add_service(rend_service_t *service)
  * lock file.  But this is enough to detect a simple mistake that
  * at least one person has actually made.
  */
-if (!rend_service_is_ephemeral(service)) { /* Skip dupe for ephemeral 
services. */
+if (!rend_service_is_ephemeral(service)) {
+  /* Skip dupe for ephemeral services. */
   SMARTLIST_FOREACH(rend_service_list, rend_service_t*, ptr,
 dupe = dupe ||
!strcmp(ptr->directory, service->directory));

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


[tor-commits] [tor/master] changes file for 20526

2016-11-03 Thread nickm
commit 91053a072c09cb0bbb60fbb334656b05be87da81
Author: Nick Mathewson 
Date:   Thu Nov 3 19:10:02 2016 -0400

changes file for 20526
---
 changes/20526 | 5 +
 1 file changed, 5 insertions(+)

diff --git a/changes/20526 b/changes/20526
new file mode 100644
index 000..0924daf
--- /dev/null
+++ b/changes/20526
@@ -0,0 +1,5 @@
+   o Refactoring (onion services):
+ - Introduce rend_service_is_ephemeral() that tells if given onion
+   service is ephemeral. Replace unclear NULL-checkings for service
+   directory with this function.
+   Closes ticket 20526.

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


[tor-commits] [tor/master] hs: Added rend_service_is_ephemeral() and made related code use it

2016-11-03 Thread nickm
commit 922bc45a5646a45096ee7370409b405ce71a77f5
Author: Ivan Markin 
Date:   Tue Nov 1 18:40:41 2016 -0100

hs: Added rend_service_is_ephemeral() and made related code use it

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

diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index ab7ec3f..4902580 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -116,12 +116,20 @@ static const char *hostname_fname = "hostname";
 static const char *client_keys_fname = "client_keys";
 static const char *sos_poison_fname = "onion_service_non_anonymous";
 
+/** Tells if onion service s is ephemeral.
+*/
+static unsigned int
+rend_service_is_ephemeral(const struct rend_service_t *s)
+{
+  return (s->directory == NULL);
+}
+
 /** Returns a escaped string representation of the service, s.
  */
 static const char *
 rend_service_escaped_dir(const struct rend_service_t *s)
 {
-  return (s->directory) ? escaped(s->directory) : "[EPHEMERAL]";
+  return rend_service_is_ephemeral(s) ? "[EPHEMERAL]" : escaped(s->directory);
 }
 
 /** A list of rend_service_t's for services run on this OP.
@@ -273,7 +281,7 @@ rend_add_service(rend_service_t *service)
  * lock file.  But this is enough to detect a simple mistake that
  * at least one person has actually made.
  */
-if (service->directory != NULL) { /* Skip dupe for ephemeral services. */
+if (!rend_service_is_ephemeral(service)) { /* Skip dupe for ephemeral 
services. */
   SMARTLIST_FOREACH(rend_service_list, rend_service_t*, ptr,
 dupe = dupe ||
!strcmp(ptr->directory, service->directory));
@@ -868,7 +876,7 @@ rend_service_del_ephemeral(const char *service_id)
  "removal.");
 return -1;
   }
-  if (s->directory) {
+  if (!rend_service_is_ephemeral(s)) {
 log_warn(LD_CONFIG, "Requested non-ephemeral Onion Service for removal.");
 return -1;
   }
@@ -992,7 +1000,7 @@ service_is_single_onion_poisoned(const rend_service_t 
*service)
   char *poison_fname = NULL;
   file_status_t fstatus;
 
-  if (!service->directory) {
+  if (rend_service_is_ephemeral(service)) {
 return 0;
   }
 
@@ -1078,7 +1086,7 @@ poison_new_single_onion_hidden_service_dir(const 
rend_service_t *service)
   int retval = -1;
   char *poison_fname = NULL;
 
-  if (!service->directory) {
+  if (rend_service_is_ephemeral(service)) {
 log_info(LD_REND, "Ephemeral HS started in non-anonymous mode.");
 return 0;
   }
@@ -1220,7 +1228,7 @@ rend_services_add_filenames_to_lists(smartlist_t 
*open_lst,
   if (!rend_service_list)
 return;
   SMARTLIST_FOREACH_BEGIN(rend_service_list, rend_service_t *, s) {
-if (s->directory) {
+if (!rend_service_is_ephemeral(s)) {
   rend_service_add_filenames_to_list(open_lst, s);
   smartlist_add_strdup(stat_lst, s->directory);
 }



___
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/bug20526_030_01'

2016-11-03 Thread nickm
commit e8624b72a83074e00859581c34c23d4779f00010
Merge: b96bb82 922bc45
Author: Nick Mathewson 
Date:   Thu Nov 3 19:09:42 2016 -0400

Merge remote-tracking branch 'dgoulet/bug20526_030_01'

 src/or/rendservice.c | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)




___
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 'mintytoast/bug_19563'

2016-11-03 Thread nickm
commit 80a5091e4f823a5e5d641cffd4ae460380e2ce12
Merge: f9b650f dce4603
Author: Nick Mathewson 
Date:   Thu Nov 3 18:40:41 2016 -0400

Merge remote-tracking branch 'mintytoast/bug_19563'

 src/test/test_util.c| 28 
 src/test/test_util_format.c | 17 +++--
 2 files changed, 31 insertions(+), 14 deletions(-)



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


[tor-commits] [tor/master] changes file for 19563

2016-11-03 Thread nickm
commit b96bb82a2a66cf1d593c7ceabc193e36cbf60774
Author: Nick Mathewson 
Date:   Thu Nov 3 18:41:40 2016 -0400

changes file for 19563
---
 changes/bug19563 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/changes/bug19563 b/changes/bug19563
new file mode 100644
index 000..dbf3859
--- /dev/null
+++ b/changes/bug19563
@@ -0,0 +1,3 @@
+  o Testing:
+- New unit tests for tor_htonll(). Closes ticket 19563. Patch from
+  "overcaffeinated".

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


[tor-commits] [tor/master] Use tor_htonll in test_util_format_unaligned_accessors

2016-11-03 Thread nickm
commit dce4603d9b55a51d8894972e443b4244fd5ae962
Author: overcaffeinated 
Date:   Thu Nov 3 21:18:02 2016 +

Use tor_htonll in test_util_format_unaligned_accessors

Remove the inline htonll, switch to tor_htonll for
test_util_format_unaligned_accessors.
---
 src/test/test_util_format.c | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/test/test_util_format.c b/src/test/test_util_format.c
index 63a6682..1d58ba2 100644
--- a/src/test/test_util_format.c
+++ b/src/test/test_util_format.c
@@ -11,25 +11,14 @@
 
 #define NS_MODULE util_format
 
-#if !defined(HAVE_HTONLL) && !defined(htonll)
-#ifdef WORDS_BIGENDIAN
-#define htonll(x) (x)
-#else
-static uint64_t
-htonll(uint64_t a)
-{
-  return htonl((uint32_t)(a>>32)) | (((uint64_t)htonl((uint32_t)a))<<32);
-}
-#endif
-#endif
-
 static void
 test_util_format_unaligned_accessors(void *ignored)
 {
   (void)ignored;
   char buf[9] = "onionsoup"; // 6f6e696f6e736f7570
 
-  tt_u64_op(get_uint64(buf+1), OP_EQ, htonll(U64_LITERAL(0x6e696f6e736f7570)));
+  tt_u64_op(get_uint64(buf+1), OP_EQ,
+  tor_htonll(U64_LITERAL(0x6e696f6e736f7570)));
   tt_uint_op(get_uint32(buf+1), OP_EQ, htonl(0x6e696f6e));
   tt_uint_op(get_uint16(buf+1), OP_EQ, htons(0x6e69));
   tt_uint_op(get_uint8(buf+1), OP_EQ, 0x6e);
@@ -43,7 +32,7 @@ test_util_format_unaligned_accessors(void *ignored)
   set_uint32(buf+1, htonl(0x78696465));
   tt_mem_op(buf, OP_EQ, "oxidestop", 9);
 
-  set_uint64(buf+1, htonll(U64_LITERAL(0x6266757363617465)));
+  set_uint64(buf+1, tor_htonll(U64_LITERAL(0x6266757363617465)));
   tt_mem_op(buf, OP_EQ, "obfuscate", 9);
  done:
   ;



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


[tor-commits] [tor/master] Refactor tests for tor_htonll and tor_ntohll

2016-11-03 Thread nickm
commit c613446ca2fa0d81fcf1f3169a2a6caa8e7a8ba3
Author: overcaffeinated 
Date:   Thu Nov 3 20:52:11 2016 +

Refactor tests for tor_htonll and tor_ntohll

Following kind feedback from dgoulet: add tests for min (0) and
max (UINT64_MAX) values. Rename expected results to something more
sensible than 'n'.
---
 src/test/test_util.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/test/test_util.c b/src/test/test_util.c
index ea6e946..b74f658 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -5616,14 +5616,23 @@ static void
 test_util_htonll(void *arg)
 {
   (void)arg;
-  const uint64_t n = 0x1122334455667788;
+#ifdef WORDS_BIGENDIAN
+  const uint64_t res_be = 0x8877665544332211;
+#else
+  const uint64_t res_le = 0x1122334455667788;
+#endif
+
+  tt_u64_op(0, OP_EQ, tor_htonll(0));
+  tt_u64_op(0, OP_EQ, tor_ntohll(0));
+  tt_u64_op(UINT64_MAX, OP_EQ, tor_htonll(UINT64_MAX));
+  tt_u64_op(UINT64_MAX, OP_EQ, tor_ntohll(UINT64_MAX));
 
 #ifdef WORDS_BIGENDIAN
-  tt_u64_op(tor_htonll(n), OP_EQ, n);
-  tt_u64_op(tor_ntohll(0x8877665544332211), OP_EQ, 0x8877665544332211);
+  tt_u64_op(res_be, OP_EQ, tor_htonll(0x8877665544332211));
+  tt_u64_op(res_be, OP_EQ, tor_ntohll(0x8877665544332211));
 #else
-  tt_u64_op(tor_htonll(n), OP_EQ, 0x8877665544332211);
-  tt_u64_op(tor_ntohll(0x8877665544332211), OP_EQ, n);
+  tt_u64_op(res_le, OP_EQ, tor_htonll(0x8877665544332211));
+  tt_u64_op(res_le, OP_EQ, tor_ntohll(0x8877665544332211));
 #endif
 
  done:



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


[tor-commits] [tor/master] Add unit test for tor_htonll and tor_ntohll

2016-11-03 Thread nickm
commit c4603233db965262721a1481bb55f1cc508b48d5
Author: overcaffeinated 
Date:   Thu Nov 3 19:37:59 2016 +

Add unit test for tor_htonll and tor_ntohll

Add tests for tor_htonll and tor_ntohll - fixes bug 19563.
---
 src/test/test_util.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/src/test/test_util.c b/src/test/test_util.c
index 7276c0c..ea6e946 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -5612,6 +5612,24 @@ test_util_monotonic_time_ratchet(void *arg)
   ;
 }
 
+static void
+test_util_htonll(void *arg)
+{
+  (void)arg;
+  const uint64_t n = 0x1122334455667788;
+
+#ifdef WORDS_BIGENDIAN
+  tt_u64_op(tor_htonll(n), OP_EQ, n);
+  tt_u64_op(tor_ntohll(0x8877665544332211), OP_EQ, 0x8877665544332211);
+#else
+  tt_u64_op(tor_htonll(n), OP_EQ, 0x8877665544332211);
+  tt_u64_op(tor_ntohll(0x8877665544332211), OP_EQ, n);
+#endif
+
+ done:
+  ;
+}
+
 #define UTIL_LEGACY(name)   \
   { #name, test_util_ ## name , 0, NULL, NULL }
 
@@ -5705,6 +5723,7 @@ struct testcase_t util_tests[] = {
   UTIL_TEST(calloc_check, 0),
   UTIL_TEST(monotonic_time, 0),
   UTIL_TEST(monotonic_time_ratchet, TT_FORK),
+  UTIL_TEST(htonll, 0),
   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 branch 'bug20551_028' into maint-0.2.8

2016-11-03 Thread nickm
commit 61bdc452b098acf681466204e51d49199067ff33
Merge: 7a45ef5 464783a
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:25 2016 -0400

Merge branch 'bug20551_028' into maint-0.2.8

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)



___
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'

2016-11-03 Thread nickm
commit f9b650fca6babce75db081ebf6a21bb79aea15cb
Merge: 63c9495 59f4cae
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:55 2016 -0400

Merge branch 'maint-0.2.9'

___
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.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 59f4cae68c00e6b894e68d8cfefae295a8b9eb89
Merge: 3cd520a 61bdc45
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:43 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

___
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.8] Merge branch 'bug20551_028' into maint-0.2.8

2016-11-03 Thread nickm
commit 61bdc452b098acf681466204e51d49199067ff33
Merge: 7a45ef5 464783a
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:25 2016 -0400

Merge branch 'bug20551_028' into maint-0.2.8

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)



___
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.8] Use explicit casts to avoid warnings when building with openssl 1.1

2016-11-03 Thread nickm
commit 464783a8dcc337c103801b8c551d1331baec1e9c
Author: Nick Mathewson 
Date:   Thu Nov 3 09:35:41 2016 -0400

Use explicit casts to avoid warnings when building with openssl 1.1

fixes bug 20551; bugfix on 0.2.1.1-alpha
---
 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/changes/bug20551 b/changes/bug20551
new file mode 100644
index 000..1e0746b
--- /dev/null
+++ b/changes/bug20551
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation);
+- Fix implicit conversion warnings under OpenSSL 1.1.
+  Fixes bug 20551; bugfix on 0.2.1.1-alpha.
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 9507bb7..89ad6af 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1656,8 +1656,8 @@ tor_tls_new(int sock, int isServer)
   result->state = TOR_TLS_ST_HANDSHAKE;
   result->isServer = isServer;
   result->wantwrite_n = 0;
-  result->last_write_count = BIO_number_written(bio);
-  result->last_read_count = BIO_number_read(bio);
+  result->last_write_count = (unsigned long) BIO_number_written(bio);
+  result->last_read_count = (unsigned long) BIO_number_read(bio);
   if (result->last_write_count || result->last_read_count) {
 log_warn(LD_NET, "Newly created BIO has read count %lu, write count %lu",
  result->last_read_count, result->last_write_count);
@@ -2271,7 +2271,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
 {
   BIO *wbio, *tmpbio;
   unsigned long r, w;
-  r = BIO_number_read(SSL_get_rbio(tls->ssl));
+  r = (unsigned long) BIO_number_read(SSL_get_rbio(tls->ssl));
   /* We want the number of bytes actually for real written.  Unfortunately,
* sometimes OpenSSL replaces the wbio on tls->ssl with a buffering bio,
* which makes the answer turn out wrong.  Let's cope with that.  Note
@@ -2292,7 +2292,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
   if (wbio->method == BIO_f_buffer() && (tmpbio = BIO_next(wbio)) != NULL)
 wbio = tmpbio;
 #endif
-  w = BIO_number_written(wbio);
+  w = (unsigned long) BIO_number_written(wbio);
 
   /* We are ok with letting these unsigned ints go "negative" here:
* If we wrapped around, this should still give us the right answer, unless



___
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] Use explicit casts to avoid warnings when building with openssl 1.1

2016-11-03 Thread nickm
commit 464783a8dcc337c103801b8c551d1331baec1e9c
Author: Nick Mathewson 
Date:   Thu Nov 3 09:35:41 2016 -0400

Use explicit casts to avoid warnings when building with openssl 1.1

fixes bug 20551; bugfix on 0.2.1.1-alpha
---
 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/changes/bug20551 b/changes/bug20551
new file mode 100644
index 000..1e0746b
--- /dev/null
+++ b/changes/bug20551
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation);
+- Fix implicit conversion warnings under OpenSSL 1.1.
+  Fixes bug 20551; bugfix on 0.2.1.1-alpha.
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 9507bb7..89ad6af 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1656,8 +1656,8 @@ tor_tls_new(int sock, int isServer)
   result->state = TOR_TLS_ST_HANDSHAKE;
   result->isServer = isServer;
   result->wantwrite_n = 0;
-  result->last_write_count = BIO_number_written(bio);
-  result->last_read_count = BIO_number_read(bio);
+  result->last_write_count = (unsigned long) BIO_number_written(bio);
+  result->last_read_count = (unsigned long) BIO_number_read(bio);
   if (result->last_write_count || result->last_read_count) {
 log_warn(LD_NET, "Newly created BIO has read count %lu, write count %lu",
  result->last_read_count, result->last_write_count);
@@ -2271,7 +2271,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
 {
   BIO *wbio, *tmpbio;
   unsigned long r, w;
-  r = BIO_number_read(SSL_get_rbio(tls->ssl));
+  r = (unsigned long) BIO_number_read(SSL_get_rbio(tls->ssl));
   /* We want the number of bytes actually for real written.  Unfortunately,
* sometimes OpenSSL replaces the wbio on tls->ssl with a buffering bio,
* which makes the answer turn out wrong.  Let's cope with that.  Note
@@ -2292,7 +2292,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
   if (wbio->method == BIO_f_buffer() && (tmpbio = BIO_next(wbio)) != NULL)
 wbio = tmpbio;
 #endif
-  w = BIO_number_written(wbio);
+  w = (unsigned long) BIO_number_written(wbio);
 
   /* We are ok with letting these unsigned ints go "negative" here:
* If we wrapped around, this should still give us the right answer, unless



___
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] Use explicit casts to avoid warnings when building with openssl 1.1

2016-11-03 Thread nickm
commit 464783a8dcc337c103801b8c551d1331baec1e9c
Author: Nick Mathewson 
Date:   Thu Nov 3 09:35:41 2016 -0400

Use explicit casts to avoid warnings when building with openssl 1.1

fixes bug 20551; bugfix on 0.2.1.1-alpha
---
 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/changes/bug20551 b/changes/bug20551
new file mode 100644
index 000..1e0746b
--- /dev/null
+++ b/changes/bug20551
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation);
+- Fix implicit conversion warnings under OpenSSL 1.1.
+  Fixes bug 20551; bugfix on 0.2.1.1-alpha.
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 9507bb7..89ad6af 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1656,8 +1656,8 @@ tor_tls_new(int sock, int isServer)
   result->state = TOR_TLS_ST_HANDSHAKE;
   result->isServer = isServer;
   result->wantwrite_n = 0;
-  result->last_write_count = BIO_number_written(bio);
-  result->last_read_count = BIO_number_read(bio);
+  result->last_write_count = (unsigned long) BIO_number_written(bio);
+  result->last_read_count = (unsigned long) BIO_number_read(bio);
   if (result->last_write_count || result->last_read_count) {
 log_warn(LD_NET, "Newly created BIO has read count %lu, write count %lu",
  result->last_read_count, result->last_write_count);
@@ -2271,7 +2271,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
 {
   BIO *wbio, *tmpbio;
   unsigned long r, w;
-  r = BIO_number_read(SSL_get_rbio(tls->ssl));
+  r = (unsigned long) BIO_number_read(SSL_get_rbio(tls->ssl));
   /* We want the number of bytes actually for real written.  Unfortunately,
* sometimes OpenSSL replaces the wbio on tls->ssl with a buffering bio,
* which makes the answer turn out wrong.  Let's cope with that.  Note
@@ -2292,7 +2292,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
   if (wbio->method == BIO_f_buffer() && (tmpbio = BIO_next(wbio)) != NULL)
 wbio = tmpbio;
 #endif
-  w = BIO_number_written(wbio);
+  w = (unsigned long) BIO_number_written(wbio);
 
   /* We are ok with letting these unsigned ints go "negative" here:
* If we wrapped around, this should still give us the right answer, unless



___
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.8] Merge branch 'bug20551_028' into maint-0.2.8

2016-11-03 Thread nickm
commit 61bdc452b098acf681466204e51d49199067ff33
Merge: 7a45ef5 464783a
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:25 2016 -0400

Merge branch 'bug20551_028' into maint-0.2.8

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

___
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.8] Use explicit casts to avoid warnings when building with openssl 1.1

2016-11-03 Thread nickm
commit 464783a8dcc337c103801b8c551d1331baec1e9c
Author: Nick Mathewson 
Date:   Thu Nov 3 09:35:41 2016 -0400

Use explicit casts to avoid warnings when building with openssl 1.1

fixes bug 20551; bugfix on 0.2.1.1-alpha
---
 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/changes/bug20551 b/changes/bug20551
new file mode 100644
index 000..1e0746b
--- /dev/null
+++ b/changes/bug20551
@@ -0,0 +1,3 @@
+  o Minor bugfixes (compilation);
+- Fix implicit conversion warnings under OpenSSL 1.1.
+  Fixes bug 20551; bugfix on 0.2.1.1-alpha.
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 9507bb7..89ad6af 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1656,8 +1656,8 @@ tor_tls_new(int sock, int isServer)
   result->state = TOR_TLS_ST_HANDSHAKE;
   result->isServer = isServer;
   result->wantwrite_n = 0;
-  result->last_write_count = BIO_number_written(bio);
-  result->last_read_count = BIO_number_read(bio);
+  result->last_write_count = (unsigned long) BIO_number_written(bio);
+  result->last_read_count = (unsigned long) BIO_number_read(bio);
   if (result->last_write_count || result->last_read_count) {
 log_warn(LD_NET, "Newly created BIO has read count %lu, write count %lu",
  result->last_read_count, result->last_write_count);
@@ -2271,7 +2271,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
 {
   BIO *wbio, *tmpbio;
   unsigned long r, w;
-  r = BIO_number_read(SSL_get_rbio(tls->ssl));
+  r = (unsigned long) BIO_number_read(SSL_get_rbio(tls->ssl));
   /* We want the number of bytes actually for real written.  Unfortunately,
* sometimes OpenSSL replaces the wbio on tls->ssl with a buffering bio,
* which makes the answer turn out wrong.  Let's cope with that.  Note
@@ -2292,7 +2292,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, 
size_t *n_written)
   if (wbio->method == BIO_f_buffer() && (tmpbio = BIO_next(wbio)) != NULL)
 wbio = tmpbio;
 #endif
-  w = BIO_number_written(wbio);
+  w = (unsigned long) BIO_number_written(wbio);
 
   /* We are ok with letting these unsigned ints go "negative" here:
* If we wrapped around, this should still give us the right answer, unless



___
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.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 59f4cae68c00e6b894e68d8cfefae295a8b9eb89
Merge: 3cd520a 61bdc45
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:43 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)




___
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 'bug20551_028' into maint-0.2.8

2016-11-03 Thread nickm
commit 61bdc452b098acf681466204e51d49199067ff33
Merge: 7a45ef5 464783a
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:25 2016 -0400

Merge branch 'bug20551_028' into maint-0.2.8

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)



___
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.8] Merge branch 'maint-0.2.8' into release-0.2.8

2016-11-03 Thread nickm
commit 5d0237ff232ac857ddc360dadb6c8baa79f0e01d
Merge: 2ba047f 61bdc45
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:37 2016 -0400

Merge branch 'maint-0.2.8' into release-0.2.8

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

___
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 'maint-0.2.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 59f4cae68c00e6b894e68d8cfefae295a8b9eb89
Merge: 3cd520a 61bdc45
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:43 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)

___
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 'bug20551_028' into maint-0.2.8

2016-11-03 Thread nickm
commit 61bdc452b098acf681466204e51d49199067ff33
Merge: 7a45ef5 464783a
Author: Nick Mathewson 
Date:   Thu Nov 3 18:36:25 2016 -0400

Merge branch 'bug20551_028' into maint-0.2.8

 changes/bug20551| 3 +++
 src/common/tortls.c | 8 
 2 files changed, 7 insertions(+), 4 deletions(-)



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


[tor-commits] [tor/master] Fix BUG message in channel/queue_impossible

2016-11-03 Thread nickm
commit 63c94954b15aa24294b713f6ab8b442bcfd4c444
Author: Nick Mathewson 
Date:   Thu Nov 3 18:34:44 2016 -0400

Fix BUG message in channel/queue_impossible
---
 src/test/test_channel.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index a9e0634..e87f99e 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -1405,10 +1405,14 @@ test_channel_queue_impossible(void *arg)
 
   /* Let it drain and check that the bad entry is discarded */
   test_chan_accept_cells = 1;
+  tor_capture_bugs_(1);
   channel_change_state(ch, CHANNEL_STATE_OPEN);
   tt_assert(test_cells_written == old_count);
   tt_int_op(chan_cell_queue_len(&(ch->outgoing_queue)), ==, 0);
 
+  tt_int_op(smartlist_len(tor_get_captured_bug_log_()), ==, 1);
+  tor_end_capture_bugs_();
+
  done:
   free_fake_channel(ch);
 

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


[tor-commits] [translation/torbutton-abouttorproperties_completed] Update translations for torbutton-abouttorproperties_completed

2016-11-03 Thread translation
commit 979496f220b75e094f510d124ecdc8c8ed44fb6a
Author: Translation commit bot 
Date:   Thu Nov 3 21:47:05 2016 +

Update translations for torbutton-abouttorproperties_completed
---
 es/abouttor.properties | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/es/abouttor.properties b/es/abouttor.properties
index fb92251..fe998a0 100644
--- a/es/abouttor.properties
+++ b/es/abouttor.properties
@@ -19,3 +19,10 @@ aboutTor.searchDC.privacy=Busque de forma 
segura con https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
+
+aboutTor.donationBanner.donate=¡Done ahora!
+aboutTor.donationBanner.heart=Tor está en el corazón de la libertad en 
Internet
+aboutTor.donationBanner.tagline1=Millones de personas dependen de Tor para la 
seguridad y la privacidad en línea
+aboutTor.donationBanner.tagline2=Una red de personas protegiendo a personas
+aboutTor.donationBanner.tagline3=Vigilancia = Opresión
+aboutTor.donationBanner.tagline4=Protegiendo a periodistas, activistas e 
informantes desde 2006

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


[tor-commits] [translation/torbutton-abouttorproperties] Update translations for torbutton-abouttorproperties

2016-11-03 Thread translation
commit 4eae4ae3c3393c4aafdf2c7b08796d8a7d054d68
Author: Translation commit bot 
Date:   Thu Nov 3 21:47:01 2016 +

Update translations for torbutton-abouttorproperties
---
 es/abouttor.properties | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/es/abouttor.properties b/es/abouttor.properties
index f60af98..fe998a0 100644
--- a/es/abouttor.properties
+++ b/es/abouttor.properties
@@ -20,9 +20,9 @@ aboutTor.searchDC.privacy.link=https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
 
-aboutTor.donationBanner.donate=Donate Now!
-aboutTor.donationBanner.heart=Tor is at the heart of Internet freedom
-aboutTor.donationBanner.tagline1=Millions of People Depend on Tor for Online 
Security & Privacy
-aboutTor.donationBanner.tagline2=A Network of People Protecting People
-aboutTor.donationBanner.tagline3=Surveillance = Oppression
-aboutTor.donationBanner.tagline4=Protecting Journalists, Activists & 
Whistleblowers Since 2006
+aboutTor.donationBanner.donate=¡Done ahora!
+aboutTor.donationBanner.heart=Tor está en el corazón de la libertad en 
Internet
+aboutTor.donationBanner.tagline1=Millones de personas dependen de Tor para la 
seguridad y la privacidad en línea
+aboutTor.donationBanner.tagline2=Una red de personas protegiendo a personas
+aboutTor.donationBanner.tagline3=Vigilancia = Opresión
+aboutTor.donationBanner.tagline4=Protegiendo a periodistas, activistas e 
informantes desde 2006

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


[tor-commits] [translation/torbutton-abouttorproperties] Update translations for torbutton-abouttorproperties

2016-11-03 Thread translation
commit a2327092a68bd7bb635c79c7e523d83e8e9bfd71
Author: Translation commit bot 
Date:   Thu Nov 3 21:16:59 2016 +

Update translations for torbutton-abouttorproperties
---
 fr_CA/abouttor.properties | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fr_CA/abouttor.properties b/fr_CA/abouttor.properties
index a442483..174b286 100644
--- a/fr_CA/abouttor.properties
+++ b/fr_CA/abouttor.properties
@@ -20,9 +20,9 @@ aboutTor.searchDC.privacy.link=https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
 
-aboutTor.donationBanner.donate=Donate Now!
-aboutTor.donationBanner.heart=Tor is at the heart of Internet freedom
-aboutTor.donationBanner.tagline1=Millions of People Depend on Tor for Online 
Security & Privacy
-aboutTor.donationBanner.tagline2=A Network of People Protecting People
+aboutTor.donationBanner.donate=Faites un don maintenant !
+aboutTor.donationBanner.heart=Tor est au cœur de la liberté sur Internet
+aboutTor.donationBanner.tagline1=Des millions de personnes dépendent de Tor 
pour leur sécurité et la protection de leurs renseignements personnels en 
ligne
+aboutTor.donationBanner.tagline2=Un réseau de personnes qui protège les gens
 aboutTor.donationBanner.tagline3=Surveillance = Oppression
-aboutTor.donationBanner.tagline4=Protecting Journalists, Activists & 
Whistleblowers Since 2006
+aboutTor.donationBanner.tagline4=Nous protégeons les journalistes, les 
activistes et les lanceurs d'alerte depuis 2006

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


[tor-commits] [translation/torbutton-abouttorproperties_completed] Update translations for torbutton-abouttorproperties_completed

2016-11-03 Thread translation
commit 766e61b49c48236f3c079dcae5869823f4fd1fba
Author: Translation commit bot 
Date:   Thu Nov 3 21:17:04 2016 +

Update translations for torbutton-abouttorproperties_completed
---
 fr_CA/abouttor.properties | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/fr_CA/abouttor.properties b/fr_CA/abouttor.properties
index 80d7b31..174b286 100644
--- a/fr_CA/abouttor.properties
+++ b/fr_CA/abouttor.properties
@@ -19,3 +19,10 @@ aboutTor.searchDC.privacy=Rechercher en toute 
sécurité avec
 aboutTor.searchDC.privacy.link=https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
+
+aboutTor.donationBanner.donate=Faites un don maintenant !
+aboutTor.donationBanner.heart=Tor est au cœur de la liberté sur Internet
+aboutTor.donationBanner.tagline1=Des millions de personnes dépendent de Tor 
pour leur sécurité et la protection de leurs renseignements personnels en 
ligne
+aboutTor.donationBanner.tagline2=Un réseau de personnes qui protège les gens
+aboutTor.donationBanner.tagline3=Surveillance = Oppression
+aboutTor.donationBanner.tagline4=Nous protégeons les journalistes, les 
activistes et les lanceurs d'alerte depuis 2006

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


[tor-commits] [translation/torbutton-abouttorproperties] Update translations for torbutton-abouttorproperties

2016-11-03 Thread translation
commit 8f96e58a8d489762fa055305ce11e77f6d268fbf
Author: Translation commit bot 
Date:   Thu Nov 3 20:18:20 2016 +

Update translations for torbutton-abouttorproperties
---
 ach/abouttor.properties | 7 +++
 ady/abouttor.properties | 7 +++
 af/abouttor.properties  | 7 +++
 ak/abouttor.properties  | 7 +++
 am/abouttor.properties  | 7 +++
 ar/abouttor.properties  | 7 +++
 arn/abouttor.properties | 7 +++
 ast/abouttor.properties | 7 +++
 az/abouttor.properties  | 7 +++
 ba/abouttor.properties  | 7 +++
 be/abouttor.properties  | 7 +++
 bg/abouttor.properties  | 7 +++
 bn/abouttor.properties  | 7 +++
 bn_BD/abouttor.properties   | 7 +++
 bn_IN/abouttor.properties   | 7 +++
 bo/abouttor.properties  | 7 +++
 br/abouttor.properties  | 7 +++
 brx/abouttor.properties | 7 +++
 bs/abouttor.properties  | 7 +++
 ca/abouttor.properties  | 7 +++
 ceb/abouttor.properties | 7 +++
 cs/abouttor.properties  | 7 +++
 csb/abouttor.properties | 7 +++
 cv/abouttor.properties  | 7 +++
 cy/abouttor.properties  | 7 +++
 da/abouttor.properties  | 7 +++
 de/abouttor.properties  | 7 +++
 dz/abouttor.properties  | 7 +++
 el/abouttor.properties  | 7 +++
 en/abouttor.properties  | 7 +++
 en_GB/abouttor.properties   | 7 +++
 eo/abouttor.properties  | 7 +++
 es/abouttor.properties  | 7 +++
 es_AR/abouttor.properties   | 7 +++
 es_CL/abouttor.properties   | 7 +++
 es_CO/abouttor.properties   | 7 +++
 es_MX/abouttor.properties   | 7 +++
 et/abouttor.properties  | 7 +++
 eu/abouttor.properties  | 7 +++
 fa/abouttor.properties  | 7 +++
 fi/abouttor.properties  | 7 +++
 fil/abouttor.properties | 7 +++
 fo/abouttor.properties  | 7 +++
 fr/abouttor.properties  | 7 +++
 fr_CA/abouttor.properties   | 7 +++
 fur/abouttor.properties | 7 +++
 fy/abouttor.properties  | 7 +++
 ga/abouttor.properties  | 7 +++
 gd/abouttor.properties  | 7 +++
 gl/abouttor.properties  | 7 +++
 gu/abouttor.properties  | 7 +++
 gu_IN/abouttor.properties   | 7 +++
 gun/abouttor.properties | 7 +++
 ha/abouttor.properties  | 7 +++
 he/abouttor.properties  | 7 +++
 hi/abouttor.properties  | 7 +++
 hr/abouttor.properties  | 7 +++
 hr_HR/abouttor.properties   | 7 +++
 ht/abouttor.properties  | 7 +++
 hu/abouttor.properties  | 7 +++
 hy/abouttor.properties  | 7 +++
 ia/abouttor.properties  | 7 +++
 id/abouttor.properties  | 7 +++
 is/abouttor.properties  | 7 +++
 it/abouttor.properties  | 7 +++
 ja/abouttor.properties  | 7 +++
 jv/abouttor.properties  | 7 +++
 ka/abouttor.properties  | 7 +++
 kk/abouttor.properties  | 7 +++
 km/abouttor.properties  | 7 +++
 kn/abouttor.properties  | 7 +++
 ko/abouttor.properties  | 7 +++
 ko_KR/abouttor.properties   | 7 +++
 ku/abouttor.properties  | 7 +++
 ku_IQ/abouttor.properties   | 7 +++
 kw/abouttor.properties  | 7 +++
 ky/abouttor.properties  | 7 +++
 la/abouttor.properties  | 7 +++
 lb/abouttor.properties  | 7 +++
 lg/abouttor.properties  | 7 +++
 ln/abouttor.properties  | 7 +++
 lo/abouttor.properties  | 7 +++
 lt/abouttor.properties  | 7 +++
 lv/abouttor.properties  | 7 +++
 mg/abouttor.properties  | 7 +++
 mi/abouttor.properties  | 7 +++
 mk/abouttor.properties  | 7 +++
 ml/abouttor.properties  | 7 +++
 mn/abouttor.properties  | 7 +++
 mr/abouttor.properties  | 7 +++
 ms_MY/abouttor.properties   | 7 +++
 mt/abouttor.properties  | 7 +++
 my/abouttor.properties  | 7 +++
 nah/abouttor.properties | 7 +++
 nap/abouttor.properties | 7 +++
 nb/abouttor.properties  | 7 +++
 nds/abouttor.properties | 7 +++
 ne/abouttor.properties  | 7 +++
 nl/abouttor.properties  | 7 +++
 nl_BE/abouttor.properties   | 7 +++
 nn/abouttor.properties  | 7 +++
 nso/abouttor.properties | 7 +++
 oc/abouttor.properties  | 7 +++
 om/abouttor.properties  | 7 +++
 or/abouttor.properties  | 7 +++
 pa/abouttor.properties  | 7 +++
 pap/abouttor.properties | 7 +++
 pl/

[tor-commits] [translation/torbutton-abouttorproperties_completed] Update translations for torbutton-abouttorproperties_completed

2016-11-03 Thread translation
commit 25aabb99c047f2a95ff0c6ad0e3f74fc0a8dc497
Author: Translation commit bot 
Date:   Thu Nov 3 20:18:25 2016 +

Update translations for torbutton-abouttorproperties_completed
---
 en/abouttor.properties | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/en/abouttor.properties b/en/abouttor.properties
index d607324..76192f4 100644
--- a/en/abouttor.properties
+++ b/en/abouttor.properties
@@ -19,3 +19,10 @@ aboutTor.searchDC.privacy=Search securely 
with https://disconnect.me/privacy
 # The following string is a link which replaces %2$S above.
 aboutTor.searchDC.search.link=https://search.disconnect.me/
+
+aboutTor.donationBanner.donate=Donate Now!
+aboutTor.donationBanner.heart=Tor is at the heart of Internet freedom
+aboutTor.donationBanner.tagline1=Millions of People Depend on Tor for Online 
Security & Privacy
+aboutTor.donationBanner.tagline2=A Network of People Protecting People
+aboutTor.donationBanner.tagline3=Surveillance = Oppression
+aboutTor.donationBanner.tagline4=Protecting Journalists, Activists & 
Whistleblowers Since 2006

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


[tor-commits] [tor/master] Replace some assert(1)s with nonfatal_unreached_once().

2016-11-03 Thread nickm
commit 0533d1421359c6cc106825f48eef781309071f4f
Author: Nick Mathewson 
Date:   Thu Nov 3 16:06:53 2016 -0400

Replace some assert(1)s with nonfatal_unreached_once().

These were probably supposed to be assert(0).
---
 src/or/channel.c| 2 +-
 src/or/channeltls.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 939b7f9..af58107 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -1738,7 +1738,7 @@ channel_get_cell_queue_entry_size(channel_t *chan, 
cell_queue_entry_t *q)
   rv = get_cell_network_size(chan->wide_circ_ids);
   break;
 default:
-  tor_assert(1);
+  tor_assert_nonfatal_unreached_once();
   }
 
   return rv;
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 5117672..9fb309d 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -601,7 +601,7 @@ channel_tls_get_remote_descr_method(channel_t *chan, int 
flags)
 break;
   default:
 /* Something's broken in channel.c */
-tor_assert(1);
+tor_assert_nonfatal_unreached_once();
 }
   } else {
 strlcpy(buf, "(No connection)", sizeof(buf));
@@ -670,7 +670,7 @@ channel_tls_is_canonical_method(channel_t *chan, int req)
 break;
   default:
 /* This shouldn't happen; channel.c is broken if it does */
-tor_assert(1);
+tor_assert_nonfatal_unreached_once();
 }
   }
   /* else return 0 for tlschan->conn == NULL */

___
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] refactor out the tor_event_base_loopexit() call

2016-11-03 Thread nickm
commit 28b755e66007c94521c45bdda07abdf3bcd59656
Author: Roger Dingledine 
Date:   Mon Oct 31 00:20:22 2016 -0400

refactor out the tor_event_base_loopexit() call

no actual changes
---
 src/or/main.c | 25 +
 src/or/main.h |  2 ++
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 6b5619c..cba19c3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -726,6 +726,19 @@ connection_should_read_from_linked_conn(connection_t *conn)
   return 0;
 }
 
+/** If we called event_base_loop() and told it to never stop until it
+ * runs out of events, now we've changed our mind: tell it we want it to
+ * finish. */
+void
+tell_event_loop_to_finish(void)
+{
+  if (!called_loop_once) {
+struct timeval tv = { 0, 0 };
+tor_event_base_loopexit(tor_libevent_get_base(), &tv);
+called_loop_once = 1; /* hack to avoid adding more exit events */
+  }
+}
+
 /** Helper: Tell the main loop to begin reading bytes into conn from
  * its linked connection, if it is not doing so already.  Called by
  * connection_start_reading and connection_start_writing as appropriate. */
@@ -738,14 +751,10 @@ connection_start_reading_from_linked_conn(connection_t 
*conn)
   if (!conn->active_on_link) {
 conn->active_on_link = 1;
 smartlist_add(active_linked_connection_lst, conn);
-if (!called_loop_once) {
-  /* This is the first event on the list; we won't be in LOOP_ONCE mode,
-   * so we need to make sure that the event_base_loop() actually exits at
-   * the end of its run through the current connections and lets us
-   * activate read events for linked connections. */
-  struct timeval tv = { 0, 0 };
-  tor_event_base_loopexit(tor_libevent_get_base(), &tv);
-}
+/* make sure that the event_base_loop() function exits at
+ * the end of its run through the current connections, so we can
+ * activate read events for linked connections. */
+tell_event_loop_to_finish();
   } else {
 tor_assert(smartlist_contains(active_linked_connection_lst, conn));
   }
diff --git a/src/or/main.h b/src/or/main.h
index ad865b8..6949376 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -45,6 +45,8 @@ int connection_is_writing(connection_t *conn);
 MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
 MOCK_DECL(void,connection_start_writing,(connection_t *conn));
 
+void tell_event_loop_to_finish(void);
+
 void connection_stop_reading_from_linked_conn(connection_t *conn);
 
 void directory_all_unreachable(time_t now);



___
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.8] Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

2016-11-03 Thread nickm
commit 7a45ef5a4706aab57abcf170c10080811223175e
Merge: 9b18b21 b2f82d4
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:30 2016 -0400

Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)

___
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 remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

2016-11-03 Thread nickm
commit 7a45ef5a4706aab57abcf170c10080811223175e
Merge: 9b18b21 b2f82d4
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:30 2016 -0400

Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)



___
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.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 3cd520a52d50b9e901d33d0164d847d12a278f1b
Merge: 3bb49c0 7a45ef5
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:46 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)

diff --cc src/or/main.h
index 0220ae3,6949376..07b2259
--- a/src/or/main.h
+++ b/src/or/main.h
@@@ -45,10 -45,10 +45,12 @@@ int connection_is_writing(connection_t 
  MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
  MOCK_DECL(void,connection_start_writing,(connection_t *conn));
  
+ void tell_event_loop_to_finish(void);
+ 
  void connection_stop_reading_from_linked_conn(connection_t *conn);
  
 +MOCK_DECL(int, connection_count_moribund, (void));
 +
  void directory_all_unreachable(time_t now);
  void directory_info_has_arrived(time_t now, int from_cache, int 
suppress_logs);
  



___
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 'maint-0.2.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 3cd520a52d50b9e901d33d0164d847d12a278f1b
Merge: 3bb49c0 7a45ef5
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:46 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)

diff --cc src/or/main.h
index 0220ae3,6949376..07b2259
--- a/src/or/main.h
+++ b/src/or/main.h
@@@ -45,10 -45,10 +45,12 @@@ int connection_is_writing(connection_t 
  MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
  MOCK_DECL(void,connection_start_writing,(connection_t *conn));
  
+ void tell_event_loop_to_finish(void);
+ 
  void connection_stop_reading_from_linked_conn(connection_t *conn);
  
 +MOCK_DECL(int, connection_count_moribund, (void));
 +
  void directory_all_unreachable(time_t now);
  void directory_info_has_arrived(time_t now, int from_cache, int 
suppress_logs);
  

___
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] Always call connection_ap_attach_pending() once a second.

2016-11-03 Thread nickm
commit b2f82d45b7e0166a8de3a7b6d38e288dd1e6d96e
Author: Nick Mathewson 
Date:   Mon Oct 31 14:42:26 2016 -0400

Always call connection_ap_attach_pending() once a second.

Fixes bug 19969; bugfix on b1d56fc58.  We can fix this some more in
later Tors, but for now, this is probably the simplest fix possible.

This is a belt-and-suspenders fix, where the earlier fix ("Ask
event_base_loop to finish when we add a pending stream") aims to respond
to new streams as soon as they arrive, and this one aims to make sure
that we definitely respond to all of the streams.
---
 src/or/main.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/or/main.c b/src/or/main.c
index cba19c3..d4d98ee 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1525,6 +1525,12 @@ run_scheduled_events(time_t now)
 circuit_expire_old_circs_as_needed(now);
   }
 
+  if (!net_is_disabled()) {
+/* This is usually redundant with circuit_build_needed_circs() above,
+ * but it is very fast when there is no work to do. */
+connection_ap_attach_pending(0);
+  }
+
   /* 5. We do housekeeping for each connection... */
   connection_or_set_bad_connections(NULL, 0);
   int i;



___
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 remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

2016-11-03 Thread nickm
commit 7a45ef5a4706aab57abcf170c10080811223175e
Merge: 9b18b21 b2f82d4
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:30 2016 -0400

Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)



___
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] Always call connection_ap_attach_pending() once a second.

2016-11-03 Thread nickm
commit b2f82d45b7e0166a8de3a7b6d38e288dd1e6d96e
Author: Nick Mathewson 
Date:   Mon Oct 31 14:42:26 2016 -0400

Always call connection_ap_attach_pending() once a second.

Fixes bug 19969; bugfix on b1d56fc58.  We can fix this some more in
later Tors, but for now, this is probably the simplest fix possible.

This is a belt-and-suspenders fix, where the earlier fix ("Ask
event_base_loop to finish when we add a pending stream") aims to respond
to new streams as soon as they arrive, and this one aims to make sure
that we definitely respond to all of the streams.
---
 src/or/main.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/or/main.c b/src/or/main.c
index cba19c3..d4d98ee 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1525,6 +1525,12 @@ run_scheduled_events(time_t now)
 circuit_expire_old_circs_as_needed(now);
   }
 
+  if (!net_is_disabled()) {
+/* This is usually redundant with circuit_build_needed_circs() above,
+ * but it is very fast when there is no work to do. */
+connection_ap_attach_pending(0);
+  }
+
   /* 5. We do housekeeping for each connection... */
   connection_or_set_bad_connections(NULL, 0);
   int i;



___
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.8] Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

2016-11-03 Thread nickm
commit 7a45ef5a4706aab57abcf170c10080811223175e
Merge: 9b18b21 b2f82d4
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:30 2016 -0400

Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)



___
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] Ask event_base_loop to finish when we add a pending stream

2016-11-03 Thread nickm
commit d89804a69d1b1f92076d47aac953776e1a3cd867
Author: Roger Dingledine 
Date:   Mon Oct 31 00:23:53 2016 -0400

Ask event_base_loop to finish when we add a pending stream

Fixes bug 19969; bugfix on b1d56fc58. We can fix this some more in
later Tors, but for now, this is probably the right fix for us.
---
 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 2 files changed, 19 insertions(+)

diff --git a/changes/bug19969 b/changes/bug19969
new file mode 100644
index 000..0bdd880
--- /dev/null
+++ b/changes/bug19969
@@ -0,0 +1,10 @@
+  o Major bugfixes (client performance);
+- Clients now respond to new application stream requests when
+  they arrive, rather than waiting up to one second before starting
+  to handle them. Fixes part of bug 19969; bugfix on 0.2.8.1-alpha.
+
+  o Major bugfixes (clients on flaky network connections);
+- When Tor leaves standby because of a new application request, open
+  circuits as needed to serve that request. Previously, we would
+  potentially wait a very long time. Fixes part of bug 19969; bugfix
+  on 0.2.8.1-alpha.
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 754e976..8098fb0 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -892,6 +892,15 @@ connection_ap_mark_as_pending_circuit_(entry_connection_t 
*entry_conn,
 
   untried_pending_connections = 1;
   smartlist_add(pending_entry_connections, entry_conn);
+
+  /* Work-around for bug 19969: we handle pending_entry_connections at
+   * the end of run_main_loop_once(), but in many cases that function will
+   * take a very long time, if ever, to finish its call to event_base_loop().
+   *
+   * So the fix is to tell it right now that it ought to finish its loop at
+   * its next available opportunity.
+   */
+  tell_event_loop_to_finish();
 }
 
 /** Mark entry_conn as no longer waiting for a circuit. */



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


[tor-commits] [tor/master] Always call connection_ap_attach_pending() once a second.

2016-11-03 Thread nickm
commit b2f82d45b7e0166a8de3a7b6d38e288dd1e6d96e
Author: Nick Mathewson 
Date:   Mon Oct 31 14:42:26 2016 -0400

Always call connection_ap_attach_pending() once a second.

Fixes bug 19969; bugfix on b1d56fc58.  We can fix this some more in
later Tors, but for now, this is probably the simplest fix possible.

This is a belt-and-suspenders fix, where the earlier fix ("Ask
event_base_loop to finish when we add a pending stream") aims to respond
to new streams as soon as they arrive, and this one aims to make sure
that we definitely respond to all of the streams.
---
 src/or/main.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/or/main.c b/src/or/main.c
index cba19c3..d4d98ee 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1525,6 +1525,12 @@ run_scheduled_events(time_t now)
 circuit_expire_old_circs_as_needed(now);
   }
 
+  if (!net_is_disabled()) {
+/* This is usually redundant with circuit_build_needed_circs() above,
+ * but it is very fast when there is no work to do. */
+connection_ap_attach_pending(0);
+  }
+
   /* 5. We do housekeeping for each connection... */
   connection_or_set_bad_connections(NULL, 0);
   int i;



___
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.8] Ask event_base_loop to finish when we add a pending stream

2016-11-03 Thread nickm
commit d89804a69d1b1f92076d47aac953776e1a3cd867
Author: Roger Dingledine 
Date:   Mon Oct 31 00:23:53 2016 -0400

Ask event_base_loop to finish when we add a pending stream

Fixes bug 19969; bugfix on b1d56fc58. We can fix this some more in
later Tors, but for now, this is probably the right fix for us.
---
 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 2 files changed, 19 insertions(+)

diff --git a/changes/bug19969 b/changes/bug19969
new file mode 100644
index 000..0bdd880
--- /dev/null
+++ b/changes/bug19969
@@ -0,0 +1,10 @@
+  o Major bugfixes (client performance);
+- Clients now respond to new application stream requests when
+  they arrive, rather than waiting up to one second before starting
+  to handle them. Fixes part of bug 19969; bugfix on 0.2.8.1-alpha.
+
+  o Major bugfixes (clients on flaky network connections);
+- When Tor leaves standby because of a new application request, open
+  circuits as needed to serve that request. Previously, we would
+  potentially wait a very long time. Fixes part of bug 19969; bugfix
+  on 0.2.8.1-alpha.
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 754e976..8098fb0 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -892,6 +892,15 @@ connection_ap_mark_as_pending_circuit_(entry_connection_t 
*entry_conn,
 
   untried_pending_connections = 1;
   smartlist_add(pending_entry_connections, entry_conn);
+
+  /* Work-around for bug 19969: we handle pending_entry_connections at
+   * the end of run_main_loop_once(), but in many cases that function will
+   * take a very long time, if ever, to finish its call to event_base_loop().
+   *
+   * So the fix is to tell it right now that it ought to finish its loop at
+   * its next available opportunity.
+   */
+  tell_event_loop_to_finish();
 }
 
 /** Mark entry_conn as no longer waiting for a circuit. */



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


[tor-commits] [tor/master] refactor out the tor_event_base_loopexit() call

2016-11-03 Thread nickm
commit 28b755e66007c94521c45bdda07abdf3bcd59656
Author: Roger Dingledine 
Date:   Mon Oct 31 00:20:22 2016 -0400

refactor out the tor_event_base_loopexit() call

no actual changes
---
 src/or/main.c | 25 +
 src/or/main.h |  2 ++
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 6b5619c..cba19c3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -726,6 +726,19 @@ connection_should_read_from_linked_conn(connection_t *conn)
   return 0;
 }
 
+/** If we called event_base_loop() and told it to never stop until it
+ * runs out of events, now we've changed our mind: tell it we want it to
+ * finish. */
+void
+tell_event_loop_to_finish(void)
+{
+  if (!called_loop_once) {
+struct timeval tv = { 0, 0 };
+tor_event_base_loopexit(tor_libevent_get_base(), &tv);
+called_loop_once = 1; /* hack to avoid adding more exit events */
+  }
+}
+
 /** Helper: Tell the main loop to begin reading bytes into conn from
  * its linked connection, if it is not doing so already.  Called by
  * connection_start_reading and connection_start_writing as appropriate. */
@@ -738,14 +751,10 @@ connection_start_reading_from_linked_conn(connection_t 
*conn)
   if (!conn->active_on_link) {
 conn->active_on_link = 1;
 smartlist_add(active_linked_connection_lst, conn);
-if (!called_loop_once) {
-  /* This is the first event on the list; we won't be in LOOP_ONCE mode,
-   * so we need to make sure that the event_base_loop() actually exits at
-   * the end of its run through the current connections and lets us
-   * activate read events for linked connections. */
-  struct timeval tv = { 0, 0 };
-  tor_event_base_loopexit(tor_libevent_get_base(), &tv);
-}
+/* make sure that the event_base_loop() function exits at
+ * the end of its run through the current connections, so we can
+ * activate read events for linked connections. */
+tell_event_loop_to_finish();
   } else {
 tor_assert(smartlist_contains(active_linked_connection_lst, conn));
   }
diff --git a/src/or/main.h b/src/or/main.h
index ad865b8..6949376 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -45,6 +45,8 @@ int connection_is_writing(connection_t *conn);
 MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
 MOCK_DECL(void,connection_start_writing,(connection_t *conn));
 
+void tell_event_loop_to_finish(void);
+
 void connection_stop_reading_from_linked_conn(connection_t *conn);
 
 void directory_all_unreachable(time_t now);



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


[tor-commits] [tor/master] Ask event_base_loop to finish when we add a pending stream

2016-11-03 Thread nickm
commit d89804a69d1b1f92076d47aac953776e1a3cd867
Author: Roger Dingledine 
Date:   Mon Oct 31 00:23:53 2016 -0400

Ask event_base_loop to finish when we add a pending stream

Fixes bug 19969; bugfix on b1d56fc58. We can fix this some more in
later Tors, but for now, this is probably the right fix for us.
---
 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 2 files changed, 19 insertions(+)

diff --git a/changes/bug19969 b/changes/bug19969
new file mode 100644
index 000..0bdd880
--- /dev/null
+++ b/changes/bug19969
@@ -0,0 +1,10 @@
+  o Major bugfixes (client performance);
+- Clients now respond to new application stream requests when
+  they arrive, rather than waiting up to one second before starting
+  to handle them. Fixes part of bug 19969; bugfix on 0.2.8.1-alpha.
+
+  o Major bugfixes (clients on flaky network connections);
+- When Tor leaves standby because of a new application request, open
+  circuits as needed to serve that request. Previously, we would
+  potentially wait a very long time. Fixes part of bug 19969; bugfix
+  on 0.2.8.1-alpha.
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 754e976..8098fb0 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -892,6 +892,15 @@ connection_ap_mark_as_pending_circuit_(entry_connection_t 
*entry_conn,
 
   untried_pending_connections = 1;
   smartlist_add(pending_entry_connections, entry_conn);
+
+  /* Work-around for bug 19969: we handle pending_entry_connections at
+   * the end of run_main_loop_once(), but in many cases that function will
+   * take a very long time, if ever, to finish its call to event_base_loop().
+   *
+   * So the fix is to tell it right now that it ought to finish its loop at
+   * its next available opportunity.
+   */
+  tell_event_loop_to_finish();
 }
 
 /** Mark entry_conn as no longer waiting for a circuit. */



___
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.8] Always call connection_ap_attach_pending() once a second.

2016-11-03 Thread nickm
commit b2f82d45b7e0166a8de3a7b6d38e288dd1e6d96e
Author: Nick Mathewson 
Date:   Mon Oct 31 14:42:26 2016 -0400

Always call connection_ap_attach_pending() once a second.

Fixes bug 19969; bugfix on b1d56fc58.  We can fix this some more in
later Tors, but for now, this is probably the simplest fix possible.

This is a belt-and-suspenders fix, where the earlier fix ("Ask
event_base_loop to finish when we add a pending stream") aims to respond
to new streams as soon as they arrive, and this one aims to make sure
that we definitely respond to all of the streams.
---
 src/or/main.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/or/main.c b/src/or/main.c
index cba19c3..d4d98ee 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1525,6 +1525,12 @@ run_scheduled_events(time_t now)
 circuit_expire_old_circs_as_needed(now);
   }
 
+  if (!net_is_disabled()) {
+/* This is usually redundant with circuit_build_needed_circs() above,
+ * but it is very fast when there is no work to do. */
+connection_ap_attach_pending(0);
+  }
+
   /* 5. We do housekeeping for each connection... */
   connection_or_set_bad_connections(NULL, 0);
   int i;



___
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.8] refactor out the tor_event_base_loopexit() call

2016-11-03 Thread nickm
commit 28b755e66007c94521c45bdda07abdf3bcd59656
Author: Roger Dingledine 
Date:   Mon Oct 31 00:20:22 2016 -0400

refactor out the tor_event_base_loopexit() call

no actual changes
---
 src/or/main.c | 25 +
 src/or/main.h |  2 ++
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 6b5619c..cba19c3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -726,6 +726,19 @@ connection_should_read_from_linked_conn(connection_t *conn)
   return 0;
 }
 
+/** If we called event_base_loop() and told it to never stop until it
+ * runs out of events, now we've changed our mind: tell it we want it to
+ * finish. */
+void
+tell_event_loop_to_finish(void)
+{
+  if (!called_loop_once) {
+struct timeval tv = { 0, 0 };
+tor_event_base_loopexit(tor_libevent_get_base(), &tv);
+called_loop_once = 1; /* hack to avoid adding more exit events */
+  }
+}
+
 /** Helper: Tell the main loop to begin reading bytes into conn from
  * its linked connection, if it is not doing so already.  Called by
  * connection_start_reading and connection_start_writing as appropriate. */
@@ -738,14 +751,10 @@ connection_start_reading_from_linked_conn(connection_t 
*conn)
   if (!conn->active_on_link) {
 conn->active_on_link = 1;
 smartlist_add(active_linked_connection_lst, conn);
-if (!called_loop_once) {
-  /* This is the first event on the list; we won't be in LOOP_ONCE mode,
-   * so we need to make sure that the event_base_loop() actually exits at
-   * the end of its run through the current connections and lets us
-   * activate read events for linked connections. */
-  struct timeval tv = { 0, 0 };
-  tor_event_base_loopexit(tor_libevent_get_base(), &tv);
-}
+/* make sure that the event_base_loop() function exits at
+ * the end of its run through the current connections, so we can
+ * activate read events for linked connections. */
+tell_event_loop_to_finish();
   } else {
 tor_assert(smartlist_contains(active_linked_connection_lst, conn));
   }
diff --git a/src/or/main.h b/src/or/main.h
index ad865b8..6949376 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -45,6 +45,8 @@ int connection_is_writing(connection_t *conn);
 MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
 MOCK_DECL(void,connection_start_writing,(connection_t *conn));
 
+void tell_event_loop_to_finish(void);
+
 void connection_stop_reading_from_linked_conn(connection_t *conn);
 
 void directory_all_unreachable(time_t now);



___
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 'arma/bug19969_028_squashed' into maint-0.2.8

2016-11-03 Thread nickm
commit 7a45ef5a4706aab57abcf170c10080811223175e
Merge: 9b18b21 b2f82d4
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:30 2016 -0400

Merge remote-tracking branch 'arma/bug19969_028_squashed' into maint-0.2.8

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)



___
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'

2016-11-03 Thread nickm
commit 272572c3a2203a8a62f4c8c081fea55183f1f426
Merge: 0abaedb 3cd520a
Author: Nick Mathewson 
Date:   Thu Nov 3 15:45:16 2016 -0400

Merge branch 'maint-0.2.9'

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)

___
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.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 3cd520a52d50b9e901d33d0164d847d12a278f1b
Merge: 3bb49c0 7a45ef5
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:46 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)

diff --cc src/or/main.h
index 0220ae3,6949376..07b2259
--- a/src/or/main.h
+++ b/src/or/main.h
@@@ -45,10 -45,10 +45,12 @@@ int connection_is_writing(connection_t 
  MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
  MOCK_DECL(void,connection_start_writing,(connection_t *conn));
  
+ void tell_event_loop_to_finish(void);
+ 
  void connection_stop_reading_from_linked_conn(connection_t *conn);
  
 +MOCK_DECL(int, connection_count_moribund, (void));
 +
  void directory_all_unreachable(time_t now);
  void directory_info_has_arrived(time_t now, int from_cache, int 
suppress_logs);
  

___
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.8] Merge branch 'maint-0.2.8' into release-0.2.8

2016-11-03 Thread nickm
commit 2ba047f596e401b294e356e8b89b70cde10c0948
Merge: 6520ef5 7a45ef5
Author: Nick Mathewson 
Date:   Thu Nov 3 15:44:40 2016 -0400

Merge branch 'maint-0.2.8' into release-0.2.8

 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 src/or/main.c| 31 +++
 src/or/main.h|  2 ++
 4 files changed, 44 insertions(+), 8 deletions(-)

___
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] refactor out the tor_event_base_loopexit() call

2016-11-03 Thread nickm
commit 28b755e66007c94521c45bdda07abdf3bcd59656
Author: Roger Dingledine 
Date:   Mon Oct 31 00:20:22 2016 -0400

refactor out the tor_event_base_loopexit() call

no actual changes
---
 src/or/main.c | 25 +
 src/or/main.h |  2 ++
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 6b5619c..cba19c3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -726,6 +726,19 @@ connection_should_read_from_linked_conn(connection_t *conn)
   return 0;
 }
 
+/** If we called event_base_loop() and told it to never stop until it
+ * runs out of events, now we've changed our mind: tell it we want it to
+ * finish. */
+void
+tell_event_loop_to_finish(void)
+{
+  if (!called_loop_once) {
+struct timeval tv = { 0, 0 };
+tor_event_base_loopexit(tor_libevent_get_base(), &tv);
+called_loop_once = 1; /* hack to avoid adding more exit events */
+  }
+}
+
 /** Helper: Tell the main loop to begin reading bytes into conn from
  * its linked connection, if it is not doing so already.  Called by
  * connection_start_reading and connection_start_writing as appropriate. */
@@ -738,14 +751,10 @@ connection_start_reading_from_linked_conn(connection_t 
*conn)
   if (!conn->active_on_link) {
 conn->active_on_link = 1;
 smartlist_add(active_linked_connection_lst, conn);
-if (!called_loop_once) {
-  /* This is the first event on the list; we won't be in LOOP_ONCE mode,
-   * so we need to make sure that the event_base_loop() actually exits at
-   * the end of its run through the current connections and lets us
-   * activate read events for linked connections. */
-  struct timeval tv = { 0, 0 };
-  tor_event_base_loopexit(tor_libevent_get_base(), &tv);
-}
+/* make sure that the event_base_loop() function exits at
+ * the end of its run through the current connections, so we can
+ * activate read events for linked connections. */
+tell_event_loop_to_finish();
   } else {
 tor_assert(smartlist_contains(active_linked_connection_lst, conn));
   }
diff --git a/src/or/main.h b/src/or/main.h
index ad865b8..6949376 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -45,6 +45,8 @@ int connection_is_writing(connection_t *conn);
 MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
 MOCK_DECL(void,connection_start_writing,(connection_t *conn));
 
+void tell_event_loop_to_finish(void);
+
 void connection_stop_reading_from_linked_conn(connection_t *conn);
 
 void directory_all_unreachable(time_t now);



___
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.8] Always call connection_ap_attach_pending() once a second.

2016-11-03 Thread nickm
commit b2f82d45b7e0166a8de3a7b6d38e288dd1e6d96e
Author: Nick Mathewson 
Date:   Mon Oct 31 14:42:26 2016 -0400

Always call connection_ap_attach_pending() once a second.

Fixes bug 19969; bugfix on b1d56fc58.  We can fix this some more in
later Tors, but for now, this is probably the simplest fix possible.

This is a belt-and-suspenders fix, where the earlier fix ("Ask
event_base_loop to finish when we add a pending stream") aims to respond
to new streams as soon as they arrive, and this one aims to make sure
that we definitely respond to all of the streams.
---
 src/or/main.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/or/main.c b/src/or/main.c
index cba19c3..d4d98ee 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1525,6 +1525,12 @@ run_scheduled_events(time_t now)
 circuit_expire_old_circs_as_needed(now);
   }
 
+  if (!net_is_disabled()) {
+/* This is usually redundant with circuit_build_needed_circs() above,
+ * but it is very fast when there is no work to do. */
+connection_ap_attach_pending(0);
+  }
+
   /* 5. We do housekeeping for each connection... */
   connection_or_set_bad_connections(NULL, 0);
   int i;



___
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] Ask event_base_loop to finish when we add a pending stream

2016-11-03 Thread nickm
commit d89804a69d1b1f92076d47aac953776e1a3cd867
Author: Roger Dingledine 
Date:   Mon Oct 31 00:23:53 2016 -0400

Ask event_base_loop to finish when we add a pending stream

Fixes bug 19969; bugfix on b1d56fc58. We can fix this some more in
later Tors, but for now, this is probably the right fix for us.
---
 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 2 files changed, 19 insertions(+)

diff --git a/changes/bug19969 b/changes/bug19969
new file mode 100644
index 000..0bdd880
--- /dev/null
+++ b/changes/bug19969
@@ -0,0 +1,10 @@
+  o Major bugfixes (client performance);
+- Clients now respond to new application stream requests when
+  they arrive, rather than waiting up to one second before starting
+  to handle them. Fixes part of bug 19969; bugfix on 0.2.8.1-alpha.
+
+  o Major bugfixes (clients on flaky network connections);
+- When Tor leaves standby because of a new application request, open
+  circuits as needed to serve that request. Previously, we would
+  potentially wait a very long time. Fixes part of bug 19969; bugfix
+  on 0.2.8.1-alpha.
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 754e976..8098fb0 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -892,6 +892,15 @@ connection_ap_mark_as_pending_circuit_(entry_connection_t 
*entry_conn,
 
   untried_pending_connections = 1;
   smartlist_add(pending_entry_connections, entry_conn);
+
+  /* Work-around for bug 19969: we handle pending_entry_connections at
+   * the end of run_main_loop_once(), but in many cases that function will
+   * take a very long time, if ever, to finish its call to event_base_loop().
+   *
+   * So the fix is to tell it right now that it ought to finish its loop at
+   * its next available opportunity.
+   */
+  tell_event_loop_to_finish();
 }
 
 /** Mark entry_conn as no longer waiting for a circuit. */



___
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.8] Ask event_base_loop to finish when we add a pending stream

2016-11-03 Thread nickm
commit d89804a69d1b1f92076d47aac953776e1a3cd867
Author: Roger Dingledine 
Date:   Mon Oct 31 00:23:53 2016 -0400

Ask event_base_loop to finish when we add a pending stream

Fixes bug 19969; bugfix on b1d56fc58. We can fix this some more in
later Tors, but for now, this is probably the right fix for us.
---
 changes/bug19969 | 10 ++
 src/or/connection_edge.c |  9 +
 2 files changed, 19 insertions(+)

diff --git a/changes/bug19969 b/changes/bug19969
new file mode 100644
index 000..0bdd880
--- /dev/null
+++ b/changes/bug19969
@@ -0,0 +1,10 @@
+  o Major bugfixes (client performance);
+- Clients now respond to new application stream requests when
+  they arrive, rather than waiting up to one second before starting
+  to handle them. Fixes part of bug 19969; bugfix on 0.2.8.1-alpha.
+
+  o Major bugfixes (clients on flaky network connections);
+- When Tor leaves standby because of a new application request, open
+  circuits as needed to serve that request. Previously, we would
+  potentially wait a very long time. Fixes part of bug 19969; bugfix
+  on 0.2.8.1-alpha.
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 754e976..8098fb0 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -892,6 +892,15 @@ connection_ap_mark_as_pending_circuit_(entry_connection_t 
*entry_conn,
 
   untried_pending_connections = 1;
   smartlist_add(pending_entry_connections, entry_conn);
+
+  /* Work-around for bug 19969: we handle pending_entry_connections at
+   * the end of run_main_loop_once(), but in many cases that function will
+   * take a very long time, if ever, to finish its call to event_base_loop().
+   *
+   * So the fix is to tell it right now that it ought to finish its loop at
+   * its next available opportunity.
+   */
+  tell_event_loop_to_finish();
 }
 
 /** Mark entry_conn as no longer waiting for a circuit. */



___
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.8] refactor out the tor_event_base_loopexit() call

2016-11-03 Thread nickm
commit 28b755e66007c94521c45bdda07abdf3bcd59656
Author: Roger Dingledine 
Date:   Mon Oct 31 00:20:22 2016 -0400

refactor out the tor_event_base_loopexit() call

no actual changes
---
 src/or/main.c | 25 +
 src/or/main.h |  2 ++
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index 6b5619c..cba19c3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -726,6 +726,19 @@ connection_should_read_from_linked_conn(connection_t *conn)
   return 0;
 }
 
+/** If we called event_base_loop() and told it to never stop until it
+ * runs out of events, now we've changed our mind: tell it we want it to
+ * finish. */
+void
+tell_event_loop_to_finish(void)
+{
+  if (!called_loop_once) {
+struct timeval tv = { 0, 0 };
+tor_event_base_loopexit(tor_libevent_get_base(), &tv);
+called_loop_once = 1; /* hack to avoid adding more exit events */
+  }
+}
+
 /** Helper: Tell the main loop to begin reading bytes into conn from
  * its linked connection, if it is not doing so already.  Called by
  * connection_start_reading and connection_start_writing as appropriate. */
@@ -738,14 +751,10 @@ connection_start_reading_from_linked_conn(connection_t 
*conn)
   if (!conn->active_on_link) {
 conn->active_on_link = 1;
 smartlist_add(active_linked_connection_lst, conn);
-if (!called_loop_once) {
-  /* This is the first event on the list; we won't be in LOOP_ONCE mode,
-   * so we need to make sure that the event_base_loop() actually exits at
-   * the end of its run through the current connections and lets us
-   * activate read events for linked connections. */
-  struct timeval tv = { 0, 0 };
-  tor_event_base_loopexit(tor_libevent_get_base(), &tv);
-}
+/* make sure that the event_base_loop() function exits at
+ * the end of its run through the current connections, so we can
+ * activate read events for linked connections. */
+tell_event_loop_to_finish();
   } else {
 tor_assert(smartlist_contains(active_linked_connection_lst, conn));
   }
diff --git a/src/or/main.h b/src/or/main.h
index ad865b8..6949376 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -45,6 +45,8 @@ int connection_is_writing(connection_t *conn);
 MOCK_DECL(void,connection_stop_writing,(connection_t *conn));
 MOCK_DECL(void,connection_start_writing,(connection_t *conn));
 
+void tell_event_loop_to_finish(void);
+
 void connection_stop_reading_from_linked_conn(connection_t *conn);
 
 void directory_all_unreachable(time_t now);



___
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.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 3bb49c011006d042f8a3f802d7abb3e9da51b15b
Merge: ff3e08f 9b18b21
Author: Nick Mathewson 
Date:   Thu Nov 3 15:41:04 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

___
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] Work around a behavior change in openssl's BUF_MEM code

2016-11-03 Thread nickm
commit 9b18b215bb34c4df1b94dec218c68a532c341e26
Author: Nick Mathewson 
Date:   Thu Nov 3 10:46:27 2016 -0400

Work around a behavior change in openssl's BUF_MEM code

In our code to write public keys to a string, for some unfathomable
reason since 253f0f160e1185c, we would allocate a memory BIO, then
set the NOCLOSE flag on it, extract its memory buffer, and free it.
Then a little while later we'd free the memory buffer with
BUF_MEM_free().

As of openssl 1.1 this doesn't work any more, since there is now a
BIO_BUF_MEM structure that wraps the BUF_MEM structure.  This
BIO_BUF_MEM doesn't get freed in our code.

So, we had a memory leak!

Is this an openssl bug?  Maybe.  But our code was already pretty
silly.  Why mess around with the NOCLOSE flag here when we can just
keep the BIO object around until we don't need the buffer any more?

Fixes bug 20553; bugfix on 0.0.2pre8
---
 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/changes/bug20553 b/changes/bug20553
new file mode 100644
index 000..12a2780
--- /dev/null
+++ b/changes/bug20553
@@ -0,0 +1,3 @@
+  o Minor bugfixes (memory leak):
+- Work around a memory leak in OpenSSL 1.1 when encoding public keys.
+  Fixes bug 20553; bugfix on 0.0.2pre8.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2b96324..c5d07df 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -755,14 +755,13 @@ crypto_pk_write_key_to_string_impl(crypto_pk_t *env, char 
**dest,
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void)BIO_set_close(b, BIO_NOCLOSE); /* so BIO_free doesn't free buf */
-  BIO_free(b);
 
   *dest = tor_malloc(buf->length+1);
   memcpy(*dest, buf->data, buf->length);
   (*dest)[buf->length] = 0; /* nul terminate it */
   *len = buf->length;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   return 0;
 }
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index 5f2cd3a..ed6c066 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -429,12 +429,11 @@ key_to_string(EVP_PKEY *key)
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void) BIO_set_close(b, BIO_NOCLOSE);
-  BIO_free(b);
   result = tor_malloc(buf->length + 1);
   memcpy(result, buf->data, buf->length);
   result[buf->length] = 0;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   RSA_free(rsa);
   return result;



___
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.8] Merge branch 'maint-0.2.8' into release-0.2.8

2016-11-03 Thread nickm
commit 6520ef5478731ef9a2a38d274f0840d9c26598ba
Merge: badc444 9b18b21
Author: Nick Mathewson 
Date:   Thu Nov 3 15:40:56 2016 -0400

Merge branch 'maint-0.2.8' into release-0.2.8

 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

___
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.8] Work around a behavior change in openssl's BUF_MEM code

2016-11-03 Thread nickm
commit 9b18b215bb34c4df1b94dec218c68a532c341e26
Author: Nick Mathewson 
Date:   Thu Nov 3 10:46:27 2016 -0400

Work around a behavior change in openssl's BUF_MEM code

In our code to write public keys to a string, for some unfathomable
reason since 253f0f160e1185c, we would allocate a memory BIO, then
set the NOCLOSE flag on it, extract its memory buffer, and free it.
Then a little while later we'd free the memory buffer with
BUF_MEM_free().

As of openssl 1.1 this doesn't work any more, since there is now a
BIO_BUF_MEM structure that wraps the BUF_MEM structure.  This
BIO_BUF_MEM doesn't get freed in our code.

So, we had a memory leak!

Is this an openssl bug?  Maybe.  But our code was already pretty
silly.  Why mess around with the NOCLOSE flag here when we can just
keep the BIO object around until we don't need the buffer any more?

Fixes bug 20553; bugfix on 0.0.2pre8
---
 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/changes/bug20553 b/changes/bug20553
new file mode 100644
index 000..12a2780
--- /dev/null
+++ b/changes/bug20553
@@ -0,0 +1,3 @@
+  o Minor bugfixes (memory leak):
+- Work around a memory leak in OpenSSL 1.1 when encoding public keys.
+  Fixes bug 20553; bugfix on 0.0.2pre8.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2b96324..c5d07df 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -755,14 +755,13 @@ crypto_pk_write_key_to_string_impl(crypto_pk_t *env, char 
**dest,
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void)BIO_set_close(b, BIO_NOCLOSE); /* so BIO_free doesn't free buf */
-  BIO_free(b);
 
   *dest = tor_malloc(buf->length+1);
   memcpy(*dest, buf->data, buf->length);
   (*dest)[buf->length] = 0; /* nul terminate it */
   *len = buf->length;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   return 0;
 }
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index 5f2cd3a..ed6c066 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -429,12 +429,11 @@ key_to_string(EVP_PKEY *key)
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void) BIO_set_close(b, BIO_NOCLOSE);
-  BIO_free(b);
   result = tor_malloc(buf->length + 1);
   memcpy(result, buf->data, buf->length);
   result[buf->length] = 0;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   RSA_free(rsa);
   return result;



___
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] Attempt to fix unit tests on netbsd

2016-11-03 Thread nickm
commit ff3e08f2af226d9660a08ab599c7e446c42fd7b4
Author: Nick Mathewson 
Date:   Tue Nov 1 13:32:21 2016 -0400

Attempt to fix unit tests on netbsd
---
 src/test/test_options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_options.c b/src/test/test_options.c
index 31a916f..0eada98 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -1078,7 +1078,7 @@ test_options_validate__transproxy(void *ignored)
   tt_int_op(ret, OP_EQ, -1);
   tt_assert(!msg);
 #endif
-#if defined(__FreeBSD_kernel__) || defined( DARWIN )
+#if defined(__FreeBSD_kernel__) || defined( DARWIN )  || defined(__NetBSD__)
   tdata = get_options_test_data("TransProxyType ipfw\n"
 "TransPort 127.0.0.1:123\n");
   ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);



___
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 'maint-0.2.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 3bb49c011006d042f8a3f802d7abb3e9da51b15b
Merge: ff3e08f 9b18b21
Author: Nick Mathewson 
Date:   Thu Nov 3 15:41:04 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

___
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.8' into maint-0.2.9

2016-11-03 Thread nickm
commit 3bb49c011006d042f8a3f802d7abb3e9da51b15b
Merge: ff3e08f 9b18b21
Author: Nick Mathewson 
Date:   Thu Nov 3 15:41:04 2016 -0400

Merge branch 'maint-0.2.8' into maint-0.2.9

 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)




___
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] Work around a behavior change in openssl's BUF_MEM code

2016-11-03 Thread nickm
commit 9b18b215bb34c4df1b94dec218c68a532c341e26
Author: Nick Mathewson 
Date:   Thu Nov 3 10:46:27 2016 -0400

Work around a behavior change in openssl's BUF_MEM code

In our code to write public keys to a string, for some unfathomable
reason since 253f0f160e1185c, we would allocate a memory BIO, then
set the NOCLOSE flag on it, extract its memory buffer, and free it.
Then a little while later we'd free the memory buffer with
BUF_MEM_free().

As of openssl 1.1 this doesn't work any more, since there is now a
BIO_BUF_MEM structure that wraps the BUF_MEM structure.  This
BIO_BUF_MEM doesn't get freed in our code.

So, we had a memory leak!

Is this an openssl bug?  Maybe.  But our code was already pretty
silly.  Why mess around with the NOCLOSE flag here when we can just
keep the BIO object around until we don't need the buffer any more?

Fixes bug 20553; bugfix on 0.0.2pre8
---
 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/changes/bug20553 b/changes/bug20553
new file mode 100644
index 000..12a2780
--- /dev/null
+++ b/changes/bug20553
@@ -0,0 +1,3 @@
+  o Minor bugfixes (memory leak):
+- Work around a memory leak in OpenSSL 1.1 when encoding public keys.
+  Fixes bug 20553; bugfix on 0.0.2pre8.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2b96324..c5d07df 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -755,14 +755,13 @@ crypto_pk_write_key_to_string_impl(crypto_pk_t *env, char 
**dest,
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void)BIO_set_close(b, BIO_NOCLOSE); /* so BIO_free doesn't free buf */
-  BIO_free(b);
 
   *dest = tor_malloc(buf->length+1);
   memcpy(*dest, buf->data, buf->length);
   (*dest)[buf->length] = 0; /* nul terminate it */
   *len = buf->length;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   return 0;
 }
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index 5f2cd3a..ed6c066 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -429,12 +429,11 @@ key_to_string(EVP_PKEY *key)
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void) BIO_set_close(b, BIO_NOCLOSE);
-  BIO_free(b);
   result = tor_malloc(buf->length + 1);
   memcpy(result, buf->data, buf->length);
   result[buf->length] = 0;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   RSA_free(rsa);
   return result;



___
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.8] Work around a behavior change in openssl's BUF_MEM code

2016-11-03 Thread nickm
commit 9b18b215bb34c4df1b94dec218c68a532c341e26
Author: Nick Mathewson 
Date:   Thu Nov 3 10:46:27 2016 -0400

Work around a behavior change in openssl's BUF_MEM code

In our code to write public keys to a string, for some unfathomable
reason since 253f0f160e1185c, we would allocate a memory BIO, then
set the NOCLOSE flag on it, extract its memory buffer, and free it.
Then a little while later we'd free the memory buffer with
BUF_MEM_free().

As of openssl 1.1 this doesn't work any more, since there is now a
BIO_BUF_MEM structure that wraps the BUF_MEM structure.  This
BIO_BUF_MEM doesn't get freed in our code.

So, we had a memory leak!

Is this an openssl bug?  Maybe.  But our code was already pretty
silly.  Why mess around with the NOCLOSE flag here when we can just
keep the BIO object around until we don't need the buffer any more?

Fixes bug 20553; bugfix on 0.0.2pre8
---
 changes/bug20553| 3 +++
 src/common/crypto.c | 5 ++---
 src/tools/tor-gencert.c | 5 ++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/changes/bug20553 b/changes/bug20553
new file mode 100644
index 000..12a2780
--- /dev/null
+++ b/changes/bug20553
@@ -0,0 +1,3 @@
+  o Minor bugfixes (memory leak):
+- Work around a memory leak in OpenSSL 1.1 when encoding public keys.
+  Fixes bug 20553; bugfix on 0.0.2pre8.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2b96324..c5d07df 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -755,14 +755,13 @@ crypto_pk_write_key_to_string_impl(crypto_pk_t *env, char 
**dest,
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void)BIO_set_close(b, BIO_NOCLOSE); /* so BIO_free doesn't free buf */
-  BIO_free(b);
 
   *dest = tor_malloc(buf->length+1);
   memcpy(*dest, buf->data, buf->length);
   (*dest)[buf->length] = 0; /* nul terminate it */
   *len = buf->length;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   return 0;
 }
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index 5f2cd3a..ed6c066 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -429,12 +429,11 @@ key_to_string(EVP_PKEY *key)
   }
 
   BIO_get_mem_ptr(b, &buf);
-  (void) BIO_set_close(b, BIO_NOCLOSE);
-  BIO_free(b);
   result = tor_malloc(buf->length + 1);
   memcpy(result, buf->data, buf->length);
   result[buf->length] = 0;
-  BUF_MEM_free(buf);
+
+  BIO_free(b);
 
   RSA_free(rsa);
   return result;

___
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'

2016-11-03 Thread nickm
commit 0abaedbf3469dfca8833867feef789c6d4e59225
Merge: f0b86e3 3bb49c0
Author: Nick Mathewson 
Date:   Thu Nov 3 15:41:18 2016 -0400

Merge branch 'maint-0.2.9'

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


[tor-commits] [tor/master] Slightly refactor and fix couple callsites

2016-11-03 Thread nickm
commit 70b9e79700f85ac07b931a2c836b4d63d0ba70c1
Author: David Goulet 
Date:   Thu Oct 27 10:34:02 2016 -0400

Slightly refactor and fix couple callsites

Signed-off-by: David Goulet 
---
 src/or/relay.c   |  7 +++
 src/or/rendmid.c | 13 +
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index aa29cc8..f5e9a6b 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -610,14 +610,13 @@ relay_send_command_from_edge_(streamid_t stream_id, 
circuit_t *circ,
 
   memset(&cell, 0, sizeof(cell_t));
   cell.command = CELL_RELAY;
-  if (cpath_layer) {
+  if (CIRCUIT_IS_ORIGIN(circ)) {
+tor_assert(cpath_layer);
 cell.circ_id = circ->n_circ_id;
 cell_direction = CELL_DIRECTION_OUT;
-  } else if (! CIRCUIT_IS_ORIGIN(circ)) {
+  } else {
 cell.circ_id = TO_OR_CIRCUIT(circ)->p_circ_id;
 cell_direction = CELL_DIRECTION_IN;
-  } else {
-tor_assert(0);
   }
 
   memset(&rh, 0, sizeof(rh));
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 96993b6..f39c92a 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -106,7 +106,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t 
*request,
RELAY_COMMAND_INTRO_ESTABLISHED,
"", 0, NULL)<0) {
 log_info(LD_GENERAL, "Couldn't send INTRO_ESTABLISHED cell.");
-return -1;
+goto err_no_close;
   }
 
   /* Now, set up this circuit. */
@@ -122,8 +122,9 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t 
*request,
   log_warn(LD_PROTOCOL, "Rejecting truncated ESTABLISH_INTRO cell.");
   reason = END_CIRC_REASON_TORPROTOCOL;
  err:
-  if (pk) crypto_pk_free(pk);
   circuit_mark_for_close(TO_CIRCUIT(circ), reason);
+ err_no_close:
+  if (pk) crypto_pk_free(pk);
   return -1;
 }
 
@@ -201,13 +202,15 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t 
*request,
(char*)request, request_len, NULL)) {
 log_warn(LD_GENERAL,
  "Unable to send INTRODUCE2 cell to Tor client.");
-goto err;
+/* Stop right now, the circuit has been closed. */
+return -1;
   }
   /* And send an ack down the client's circuit.  Empty body means succeeded. */
   if (relay_send_command_from_edge(0,TO_CIRCUIT(circ),
RELAY_COMMAND_INTRODUCE_ACK,
NULL,0,NULL)) {
 log_warn(LD_GENERAL, "Unable to send INTRODUCE_ACK cell to Tor client.");
+/* Stop right now, the circuit has been closed. */
 return -1;
   }
 
@@ -266,6 +269,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const 
uint8_t *request,
RELAY_COMMAND_RENDEZVOUS_ESTABLISHED,
"", 0, NULL)<0) {
 log_warn(LD_PROTOCOL, "Couldn't send RENDEZVOUS_ESTABLISHED cell.");
+/* Stop right now, the circuit has been closed. */
 return -1;
   }
 
@@ -342,7 +346,8 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t 
*request,
 log_warn(LD_GENERAL,
  "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
  (unsigned)rend_circ->p_circ_id);
-goto err;
+/* Stop right now, the circuit has been closed. */
+return -1;
   }
 
   /* Join the circuits. */



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


[tor-commits] [tor/master] Do not mark circs for close again after relay_send_command_from_edge()

2016-11-03 Thread nickm
commit 2d049469602f5e6efbe8f1ded0cbcd3aa957f3eb
Author: Ivan Markin 
Date:   Sun Oct 16 20:08:26 2016 +

Do not mark circs for close again after relay_send_command_from_edge()
---
 src/or/rendmid.c | 8 ++--
 src/or/rendservice.c | 6 ++
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index ca0ad7b..96993b6 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -106,7 +106,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t 
*request,
RELAY_COMMAND_INTRO_ESTABLISHED,
"", 0, NULL)<0) {
 log_info(LD_GENERAL, "Couldn't send INTRO_ESTABLISHED cell.");
-goto err;
+return -1;
   }
 
   /* Now, set up this circuit. */
@@ -208,7 +208,6 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t 
*request,
RELAY_COMMAND_INTRODUCE_ACK,
NULL,0,NULL)) {
 log_warn(LD_GENERAL, "Unable to send INTRODUCE_ACK cell to Tor client.");
-circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
 return -1;
   }
 
@@ -220,8 +219,6 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t 
*request,
RELAY_COMMAND_INTRODUCE_ACK,
nak_body, 1, NULL)) {
 log_warn(LD_GENERAL, "Unable to send NAK to Tor client.");
-/* Is this right? */
-circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
   }
   return -1;
 }
@@ -269,8 +266,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const 
uint8_t *request,
RELAY_COMMAND_RENDEZVOUS_ESTABLISHED,
"", 0, NULL)<0) {
 log_warn(LD_PROTOCOL, "Couldn't send RENDEZVOUS_ESTABLISHED cell.");
-reason = END_CIRC_REASON_INTERNAL;
-goto err;
+return -1;
   }
 
   circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_REND_POINT_WAITING);
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index ab7ec3f..3aeade8 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -3060,8 +3060,7 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
 log_info(LD_GENERAL,
  "Couldn't send introduction request for service %s on circuit %u",
  serviceid, (unsigned)circuit->base_.n_circ_id);
-reason = END_CIRC_REASON_INTERNAL;
-goto err;
+goto done;
   }
 
   /* We've attempted to use this circuit */
@@ -3223,8 +3222,7 @@ rend_service_rendezvous_has_opened(origin_circuit_t 
*circuit)
buf, REND_COOKIE_LEN+DH_KEY_LEN+DIGEST_LEN,
circuit->cpath->prev)<0) {
 log_warn(LD_GENERAL, "Couldn't send RENDEZVOUS1 cell.");
-reason = END_CIRC_REASON_INTERNAL;
-goto err;
+goto done;
   }
 
   crypto_dh_free(hop->rend_dh_handshake_state);



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


[tor-commits] [tor/master] Add assertion that cpath_layer==NULL on OR circ

2016-11-03 Thread nickm
commit f0b86e30d0d53e997872a9ece42242e8e14d45c8
Author: Nick Mathewson 
Date:   Thu Nov 3 14:36:10 2016 -0400

Add assertion that cpath_layer==NULL on OR circ
---
 src/or/relay.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/or/relay.c b/src/or/relay.c
index f5e9a6b..99750af 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -615,6 +615,7 @@ relay_send_command_from_edge_(streamid_t stream_id, 
circuit_t *circ,
 cell.circ_id = circ->n_circ_id;
 cell_direction = CELL_DIRECTION_OUT;
   } else {
+tor_assert(! cpath_layer);
 cell.circ_id = TO_OR_CIRCUIT(circ)->p_circ_id;
 cell_direction = CELL_DIRECTION_IN;
   }

___
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/bug20376_030_01'

2016-11-03 Thread nickm
commit 40487b0141096ddb40bec38f7d1c6a4367d8c279
Merge: df2615d 70b9e79
Author: Nick Mathewson 
Date:   Thu Nov 3 14:35:03 2016 -0400

Merge remote-tracking branch 'dgoulet/bug20376_030_01'

 src/or/relay.c   |  7 +++
 src/or/rendmid.c | 19 ++-
 src/or/rendservice.c |  6 ++
 3 files changed, 15 insertions(+), 17 deletions(-)




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


[tor-commits] [tor/master] Do assert when calling relay_send_command_from_edge() on OR-side circs

2016-11-03 Thread nickm
commit 23b878b875d7feab195be0e856da4aa3f5ac2e15
Author: Ivan Markin 
Date:   Mon Oct 17 16:06:36 2016 +

Do assert when calling relay_send_command_from_edge() on OR-side circs
---
 src/or/relay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 823e074..aa29cc8 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -617,7 +617,7 @@ relay_send_command_from_edge_(streamid_t stream_id, 
circuit_t *circ,
 cell.circ_id = TO_OR_CIRCUIT(circ)->p_circ_id;
 cell_direction = CELL_DIRECTION_IN;
   } else {
-return -1;
+tor_assert(0);
   }
 
   memset(&rh, 0, sizeof(rh));



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


[tor-commits] [tor/master] fix wide lines

2016-11-03 Thread nickm
commit df2615d43da4578b7fb68eb753cc1c0d943642af
Author: Nick Mathewson 
Date:   Thu Nov 3 14:29:18 2016 -0400

fix wide lines
---
 src/or/rendservice.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 1584691..305beb1 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -519,7 +519,8 @@ rend_config_services(const or_options_t *options, int 
validate_only)
 }
 log_info(LD_CONFIG,
  "HiddenServiceDirGroupReadable=%d for %s",
- service->dir_group_readable, 
rend_service_escaped_dir(service));
+ service->dir_group_readable,
+ rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceMaxStreams")) {
   service->max_streams_per_circuit = (int)tor_parse_long(line->value,
 10, 0, 65535, &ok, NULL);
@@ -532,7 +533,8 @@ rend_config_services(const or_options_t *options, int 
validate_only)
   }
   log_info(LD_CONFIG,
"HiddenServiceMaxStreams=%d for %s",
-   service->max_streams_per_circuit, 
rend_service_escaped_dir(service));
+   service->max_streams_per_circuit,
+   rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceMaxStreamsCloseCircuit")) {
   service->max_streams_close_circuit = (int)tor_parse_long(line->value,
 10, 0, 1, &ok, NULL);
@@ -563,7 +565,8 @@ rend_config_services(const or_options_t *options, int 
validate_only)
 return -1;
   }
   log_info(LD_CONFIG, "HiddenServiceNumIntroductionPoints=%d for %s",
-   service->n_intro_points_wanted, 
rend_service_escaped_dir(service));
+   service->n_intro_points_wanted,
+   rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceAuthorizeClient")) {
   /* Parse auth type and comma-separated list of client names and add a
* rend_authorized_client_t for each client to the service's list

___
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 'bug20527_030_01_squashed'

2016-11-03 Thread nickm
commit 16e75587f6c6e1dd0d316e8360c966f4841dc32c
Merge: 409984c 2f52fae
Author: Nick Mathewson 
Date:   Thu Nov 3 14:23:47 2016 -0400

Merge branch 'bug20527_030_01_squashed'

 src/or/rendservice.c | 27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)



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


[tor-commits] [tor/master] hs: Escape service directories before printing them

2016-11-03 Thread nickm
commit 2f52faee033bb2c0a203b73f7ad86f98dc0fc296
Author: Ivan Markin 
Date:   Tue Nov 1 18:55:03 2016 -0100

hs: Escape service directories before printing them

Signed-off-by: David Goulet 
---
 src/or/rendservice.c | 27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index ab7ec3f..1584691 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -286,8 +286,8 @@ rend_add_service(rend_service_t *service)
   }
 }
 smartlist_add(rend_service_list, service);
-log_debug(LD_REND,"Configuring service with directory \"%s\"",
-  service->directory);
+log_debug(LD_REND,"Configuring service with directory %s",
+  rend_service_escaped_dir(service));
 for (i = 0; i < smartlist_len(service->ports); ++i) {
   p = smartlist_get(service->ports, i);
   if (!(p->is_unix_addr)) {
@@ -504,7 +504,8 @@ rend_config_services(const or_options_t *options, int 
validate_only)
   }
   log_info(LD_CONFIG,
"HiddenServiceAllowUnknownPorts=%d for %s",
-   (int)service->allow_unknown_ports, service->directory);
+   (int)service->allow_unknown_ports,
+   rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key,
"HiddenServiceDirGroupReadable")) {
 service->dir_group_readable = (int)tor_parse_long(line->value,
@@ -518,7 +519,7 @@ rend_config_services(const or_options_t *options, int 
validate_only)
 }
 log_info(LD_CONFIG,
  "HiddenServiceDirGroupReadable=%d for %s",
- service->dir_group_readable, service->directory);
+ service->dir_group_readable, 
rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceMaxStreams")) {
   service->max_streams_per_circuit = (int)tor_parse_long(line->value,
 10, 0, 65535, &ok, NULL);
@@ -531,7 +532,7 @@ rend_config_services(const or_options_t *options, int 
validate_only)
   }
   log_info(LD_CONFIG,
"HiddenServiceMaxStreams=%d for %s",
-   service->max_streams_per_circuit, service->directory);
+   service->max_streams_per_circuit, 
rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceMaxStreamsCloseCircuit")) {
   service->max_streams_close_circuit = (int)tor_parse_long(line->value,
 10, 0, 1, &ok, NULL);
@@ -545,7 +546,8 @@ rend_config_services(const or_options_t *options, int 
validate_only)
   }
   log_info(LD_CONFIG,
"HiddenServiceMaxStreamsCloseCircuit=%d for %s",
-   (int)service->max_streams_close_circuit, service->directory);
+   (int)service->max_streams_close_circuit,
+   rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceNumIntroductionPoints")) {
   service->n_intro_points_wanted =
 (unsigned int) tor_parse_long(line->value, 10,
@@ -561,7 +563,7 @@ rend_config_services(const or_options_t *options, int 
validate_only)
 return -1;
   }
   log_info(LD_CONFIG, "HiddenServiceNumIntroductionPoints=%d for %s",
-   service->n_intro_points_wanted, service->directory);
+   service->n_intro_points_wanted, 
rend_service_escaped_dir(service));
 } else if (!strcasecmp(line->key, "HiddenServiceAuthorizeClient")) {
   /* Parse auth type and comma-separated list of client names and add a
* rend_authorized_client_t for each client to the service's list
@@ -1187,8 +1189,8 @@ rend_service_load_all_keys(const smartlist_t 
*service_list)
   SMARTLIST_FOREACH_BEGIN(s_list, rend_service_t *, s) {
 if (s->private_key)
   continue;
-log_info(LD_REND, "Loading hidden-service keys from \"%s\"",
- s->directory);
+log_info(LD_REND, "Loading hidden-service keys from %s",
+ rend_service_escaped_dir(s));
 
 if (rend_service_load_keys(s) < 0)
   return -1;
@@ -1266,7 +1268,8 @@ rend_service_load_keys(rend_service_t *s)
   if (s->dir_group_readable) {
 /* Only new dirs created get new opts, also enforce group read. */
 if (chmod(s->directory, 0750)) {
-  log_warn(LD_FS,"Unable to make %s group-readable.", s->directory);
+  log_warn(LD_FS,"Unable to make %s group-readable.",
+  rend_service_escaped_dir(s));
 }
   }
 #endif
@@ -4009,8 +4012,8 @@ rend_service_dump_stats(int severity)
 
   for (i=0; i < smartlist_len(rend_service_list); ++i) {
 service = smartlist_get(rend_service_list, i);
-tor_log(severity, LD_GENERAL, "Service configured in \"%s\":",
-service->directory);
+tor_log(severity, LD_GENERAL, "Service configured in %s:",
+rend_service_escaped_dir(service));
 for (j=0; j < smartlist_len(servi

[tor-commits] [tor-messenger-build/master] Use urls in input_files

2016-11-03 Thread arlo
commit f9a3a092d01c5fc4e0b29c15443213be576f1ea9
Author: Arlo Breault 
Date:   Thu Nov 3 09:56:07 2016 -0700

Use urls in input_files
---
 projects/tor-messenger/build   |   4 ++--
 projects/tor-messenger/config  |   8 ++--
 projects/tor-messenger/future-0.16.0.tar.gz| Bin 824484 -> 0 bytes
 projects/tor-messenger/pefile-2016.3.28.tar.gz | Bin 58110 -> 0 bytes
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/projects/tor-messenger/build b/projects/tor-messenger/build
index fb3a27d..c855675 100755
--- a/projects/tor-messenger/build
+++ b/projects/tor-messenger/build
@@ -92,12 +92,12 @@ mv bundle tor-messenger
 [% IF c('var/windows') -%]
 makensis tor-messenger.nsi
 
-tar xf future-0.16.0.tar.gz
+tar xf $rootdir/[% c('input_files_by_name/python-future') %]
 cd future-0.16.0/
 python setup.py install --user
 cd ..
 
-tar xf pefile-2016.3.28.tar.gz
+tar xf $rootdir/[% c('input_files_by_name/python-pefile') %]
 cd pefile-2016.3.28/
 python setup.py install --user
 cd ..
diff --git a/projects/tor-messenger/config b/projects/tor-messenger/config
index f1e4b88..70ae860 100644
--- a/projects/tor-messenger/config
+++ b/projects/tor-messenger/config
@@ -26,9 +26,13 @@ input_files:
 enable: '[% c("var/osx") %]'
   - filename: tor-messenger.nsi
 enable: '[% c("var/windows") %]'
-  - filename: future-0.16.0.tar.gz
+  - name: python-future
+URL: 
https://pypi.python.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz
+sha256sum: e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb
 enable: '[% c("var/windows") %]'
-  - filename: pefile-2016.3.28.tar.gz
+  - name: python-pefile
+URL: 
https://pypi.python.org/packages/92/c0/8589ce9734ffdba258bd3e5acd4afb2e3586c121fe73402f686288b684b0/pefile-2016.3.28.tar.gz
+sha256sum: f24021085b5c3ef7b0898bb1f1d93eecd3839e03512769e22b0c5a10d9095f7b
 enable: '[% c("var/windows") %]'
   - filename: pe_checksum_fix.py
 enable: '[% c("var/windows") %]'
diff --git a/projects/tor-messenger/future-0.16.0.tar.gz 
b/projects/tor-messenger/future-0.16.0.tar.gz
deleted file mode 100644
index 271b7e0..000
Binary files a/projects/tor-messenger/future-0.16.0.tar.gz and /dev/null differ
diff --git a/projects/tor-messenger/pefile-2016.3.28.tar.gz 
b/projects/tor-messenger/pefile-2016.3.28.tar.gz
deleted file mode 100644
index c045e69..000
Binary files a/projects/tor-messenger/pefile-2016.3.28.tar.gz and /dev/null 
differ

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


[tor-commits] [stem/master] fix for .swo file expected in installation

2016-11-03 Thread atagar
commit c3b7f258847a26750991c87a98e03fdeaca2d113
Author: Chelsea H. Komlo 
Date:   Mon Oct 31 22:30:06 2016 -0500

fix for .swo file expected in installation
---
 .gitignore | 1 +
 test/integ/installation.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index fda679b..7f97772 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 *.pyc
 *.swp
+*.swo
 .tox
 test/data/
 docs/_build/
diff --git a/test/integ/installation.py b/test/integ/installation.py
index d068d57..e830446 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -81,7 +81,8 @@ class TestInstallation(unittest.TestCase):
 
 for root, dirnames, filenames in os.walk(os.path.join(BASE_DIRECTORY, 
'stem')):
   for filename in filenames:
-if not filename.endswith('.pyc') and not filename.endswith('.swp'):
+if (not filename.endswith('.pyc') and not filename.endswith('.swp') and
+not filename.endswith('.swo')):
   expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 1:])
 
 for root, dirnames, filenames in os.walk(self.site_packages_path):



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


[tor-commits] [stem/master] Slightly tweak new swo check

2016-11-03 Thread atagar
commit 6a1764524990506bf09d2ec5ddea0b160e231077
Author: Damian Johnson 
Date:   Thu Nov 3 09:53:51 2016 -0700

Slightly tweak new swo check

Minorest of minor nitpicks. Was perfectly fine, just prefer a blank line and
for exclude to be in the conditional (imho didn't previously add any
readability).
---
 test/integ/installation.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/integ/installation.py b/test/integ/installation.py
index 533aefd..50c0339 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -82,8 +82,8 @@ class TestInstallation(unittest.TestCase):
 for root, dirnames, filenames in os.walk(os.path.join(BASE_DIRECTORY, 
'stem')):
   for filename in filenames:
   file_format = filename.split('.')[-1]
-  excluded = ['pyc', 'swp', 'swo']
-  if not file_format in excluded:
+
+  if file_format not in ('pyc', 'swp', 'swo'):
 expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 
1:])
 
 for root, dirnames, filenames in os.walk(self.site_packages_path):



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


[tor-commits] [stem/master] Integ tests failed if vim swo files were present

2016-11-03 Thread atagar
commit 0247044047e59fd74e91c908ab1792d7558f8534
Merge: 532f906 6a17645
Author: Damian Johnson 
Date:   Thu Nov 3 09:57:45 2016 -0700

Integ tests failed if vim swo files were present

Interesting, I use vim but have never seen these. Maybe it's something with
newer versions? Regardless, great catch from Chelsea...

  https://trac.torproject.org/projects/tor/ticket/20520

 .gitignore | 1 +
 test/integ/installation.py | 6 --
 2 files changed, 5 insertions(+), 2 deletions(-)

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


[tor-commits] [stem/master] refactor for extensibility, easier to exclude file formats from check for

2016-11-03 Thread atagar
commit 9a267690af2d6480753bfc794a5a7be2a89e7803
Author: Chelsea H. Komlo 
Date:   Tue Nov 1 08:09:51 2016 -0500

refactor for extensibility, easier to exclude file formats from check for
required files
---
 test/integ/installation.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/integ/installation.py b/test/integ/installation.py
index e830446..533aefd 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -81,9 +81,10 @@ class TestInstallation(unittest.TestCase):
 
 for root, dirnames, filenames in os.walk(os.path.join(BASE_DIRECTORY, 
'stem')):
   for filename in filenames:
-if (not filename.endswith('.pyc') and not filename.endswith('.swp') and
-not filename.endswith('.swo')):
-  expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 1:])
+  file_format = filename.split('.')[-1]
+  excluded = ['pyc', 'swp', 'swo']
+  if not file_format in excluded:
+expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 
1:])
 
 for root, dirnames, filenames in os.walk(self.site_packages_path):
   for filename in filenames:



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


[tor-commits] [orbot/master] 15.2.0-RC-5 notification fixes!

2016-11-03 Thread n8fr8
commit 24dee21b96f67cbb5cf84482808fe432ebcff814
Author: Nathan Freitas 
Date:   Thu Nov 3 12:49:54 2016 -0400

15.2.0-RC-5 notification fixes!
---
 app/src/main/AndroidManifest.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1c63803..9d884ee 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,8 +1,8 @@
 
 http://schemas.android.com/apk/res/android";
   package="org.torproject.android" 
-  android:versionName="15.2.0-RC-4"
-  android:versionCode="15204000"
+  android:versionName="15.2.0-RC-5"
+  android:versionCode="15205000"
 android:installLocation="auto"  
   >
 



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


[tor-commits] [orbot/master] make sure notification is shown immediately while starting up

2016-11-03 Thread n8fr8
commit ba212a447cd2873d806029992594b605c56ddc16
Author: Nathan Freitas 
Date:   Thu Nov 3 12:45:00 2016 -0400

make sure notification is shown immediately while starting up
---
 .../main/java/org/torproject/android/service/TorService.java   | 10 ++
 1 file changed, 10 insertions(+)

diff --git 
a/orbotservice/src/main/java/org/torproject/android/service/TorService.java 
b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
index 47af4ac..d55e1cf 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
@@ -163,6 +163,8 @@ public class TorService extends Service implements 
TorServiceConstants, OrbotCon
 if (mLastProcessId != -1 && conn != null) {
 
sendCallbackLogMessage(getString(R.string.found_existing_tor_process));
 sendCallbackStatus(STATUS_ON);
+
showToolbarNotification(getString(R.string.status_activated),NOTIFY_ID,R.drawable.ic_stat_tor);
+
 return true;
 }
 } catch (Exception e) {
@@ -335,6 +337,13 @@ public class TorService extends Service implements 
TorServiceConstants, OrbotCon
 }
 
 public void run() {
+
+while (!isTorUpgradeAndConfigComplete)
+{
+try { Thread.sleep (500);}
+catch (Exception e){}
+}
+
 String action = mIntent.getAction();
 
 if (action != null) {
@@ -775,6 +784,7 @@ public class TorService extends Service implements 
TorServiceConstants, OrbotCon
 // killAllDaemons();

sendCallbackStatus(STATUS_STARTING);
+
showToolbarNotification(getString(R.string.status_starting_up),NOTIFY_ID,R.drawable.ic_stat_tor);
sendCallbackLogMessage(getString(R.string.status_starting_up));
logNotice(getString(R.string.status_starting_up));




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


[tor-commits] [orbot/master] update changelog for RC5

2016-11-03 Thread n8fr8
commit 2a0145693d4d6217bd368062b8ba94b083705705
Author: Nathan Freitas 
Date:   Thu Nov 3 12:50:45 2016 -0400

update changelog for RC5
---
 CHANGELOG | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 0c46df3..66e24d7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,11 @@
 NOTE: Specific #s below correspond to Trac tickets logged and maintained at 
https://trac.torproject.org/projects/tor/
 
+/** 15.2.0 RC 5 / 3 November 2016/ 24dee21b96f67cbb5cf84482808fe432ebcff814 **/
+
+ba212a4 make sure notification is shown immediately while starting up
+45f7ae2 expanded notifications should be on by default for SDK 16+
+
+
 /** 15.2.0 RC 4 / 3 November 2016 / 6b2679cac16782a7a36a79f90f2dd0d8e330742f 
**/
 
 89f3fca make sure the binaries are cleanly installed (bump version number)

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


[tor-commits] [orbot/master] expanded notifications should be on by default for SDK 16+

2016-11-03 Thread n8fr8
commit 45f7ae23c642146c2b747a73f66e9b80c2c973c6
Author: Nathan Freitas 
Date:   Thu Nov 3 12:44:41 2016 -0400

expanded notifications should be on by default for SDK 16+
---
 .../src/main/java/org/torproject/android/service/util/Prefs.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/orbotservice/src/main/java/org/torproject/android/service/util/Prefs.java 
b/orbotservice/src/main/java/org/torproject/android/service/util/Prefs.java
index 38f2399..cf3489e 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/util/Prefs.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/util/Prefs.java
@@ -89,7 +89,7 @@ public class Prefs {
 }
 
 public static boolean expandedNotifications() {
-return prefs.getBoolean(PREF_EXPANDED_NOTIFICATIONS, false);
+return prefs.getBoolean(PREF_EXPANDED_NOTIFICATIONS, true);
 }
 
 public static boolean useDebugLogging() {



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


[tor-commits] [orbot/master] update JNI targets

2016-11-03 Thread n8fr8
commit 0050bfeb950c09f897345a4d114feb03dcfef557
Author: Nathan Freitas 
Date:   Thu Nov 3 10:38:10 2016 -0400

update JNI targets
---
 orbotservice/src/main/jni/Application.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/orbotservice/src/main/jni/Application.mk 
b/orbotservice/src/main/jni/Application.mk
index a356ed7..abc185b 100644
--- a/orbotservice/src/main/jni/Application.mk
+++ b/orbotservice/src/main/jni/Application.mk
@@ -1,4 +1,4 @@
 APP_ABI:= armeabi
-APP_PLATFORM   := android-16
+APP_PLATFORM   := android-23
 APP_STL:= stlport_static
-NDK_TOOLCHAIN_VERSION  := 4.8
+NDK_TOOLCHAIN_VERSION  := 4.9



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


[tor-commits] [orbot/master] use PIEFLAGS

2016-11-03 Thread n8fr8
commit 5ac21be984164a5145d46d2578c852c7483b1a41
Author: Nathan Freitas 
Date:   Thu Nov 3 11:00:12 2016 -0400

use PIEFLAGS
---
 external/Makefile | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/external/Makefile b/external/Makefile
index 850e92c..319b99e 100644
--- a/external/Makefile
+++ b/external/Makefile
@@ -23,11 +23,14 @@ endif
 
 # Android NDK setup
 ANDROID_NDK_HOME ?= /opt/android-ndk
-NDK_PLATFORM_LEVEL ?= 16
-NDK_TOOLCHAIN_VERSION=4.8
+NDK_PLATFORM_LEVEL ?= 21
+NDK_TOOLCHAIN_VERSION=4.9
 APP_ABI ?= armeabi
 NDK_ABI ?= $(APP_ABI)
-PIE_MODE ?= pie
+
+# PIEFLAGS for SDK 16/Android L must be set to -fPIE -pie, but can override 
for earlier targets 
+PIEFLAGS ?= -fPIE -pie
+
 ifneq ($(filter arm%, $(APP_ABI)),)
   NDK_ABI := arm
 endif
@@ -71,11 +74,6 @@ RANLIB := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-ranlib
 STRIP := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-strip \
--strip-unneeded -R .note -R .comment --strip-debug
 
-# PIEFLAGS for SDK 16/Android L must be set to -fPIE -pie, but can override 
for earlier targets 
-PIEFLAGS ?= -fPIE -pie
-ifeq ($(PIEMODE),nopie)
-   PIEFLAGS = 
-endif
 
 CFLAGS = -DANDROID $(TARGET_CFLAGS) $(PIEFLAGS)
 LDFLAGS = -llog $(TARGET_LDFLAGS) $(PIEFLAGS)



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


[tor-commits] [orbot/master] update manifest for 15.2.0-RC-4

2016-11-03 Thread n8fr8
commit 6b2679cac16782a7a36a79f90f2dd0d8e330742f
Author: Nathan Freitas 
Date:   Thu Nov 3 12:23:22 2016 -0400

update manifest for 15.2.0-RC-4
---
 app/src/main/AndroidManifest.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d25f5b7..1c63803 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,8 +1,8 @@
 
 http://schemas.android.com/apk/res/android";
   package="org.torproject.android" 
-  android:versionName="15.2.0-RC-3"
-  android:versionCode="15200050"
+  android:versionName="15.2.0-RC-4"
+  android:versionCode="15204000"
 android:installLocation="auto"  
   >
 



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


[tor-commits] [orbot/master] make sure tun2socks is loaded properly

2016-11-03 Thread n8fr8
commit f21f14bf5b2d2fa3cbe037dd4eccfc76656fd296
Author: Nathan Freitas 
Date:   Thu Nov 3 12:18:20 2016 -0400

make sure tun2socks is loaded properly
---
 .../main/java/org/torproject/android/service/vpn/OrbotVpnManager.java   | 2 ++
 .../src/main/java/org/torproject/android/service/vpn/Tun2Socks.java | 2 ++
 2 files changed, 4 insertions(+)

diff --git 
a/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java
 
b/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java
index 1b4cca0..ea07250 100644
--- 
a/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java
+++ 
b/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java
@@ -93,6 +93,8 @@ public class OrbotVpnManager implements Handler.Callback {
File fileBinHome = 
mService.getDir(TorServiceConstants.DIRECTORY_TOR_BINARY, 
Application.MODE_PRIVATE);
filePdnsd = new 
File(fileBinHome,TorServiceConstants.PDNSD_ASSET_KEY);
 
+   Tun2Socks.init();
+
}

 //public int onStartCommand(Intent intent, int flags, int startId) {
diff --git 
a/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java 
b/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java
index cff4c1c..ff1ac94 100644
--- 
a/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java
+++ 
b/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java
@@ -57,6 +57,8 @@ public class Tun2Socks
 // than one instance due to the use of global state (the lwip
 // module, etc.) in the native code.
 
+public static void init () {}
+
 public static void Start(
 ParcelFileDescriptor vpnInterfaceFileDescriptor,
 int vpnInterfaceMTU,



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


[tor-commits] [orbot/master] update changelog for RC4

2016-11-03 Thread n8fr8
commit 204b3f0441f66b22146bf019c583adb9fea6c74e
Author: Nathan Freitas 
Date:   Thu Nov 3 12:24:12 2016 -0400

update changelog for RC4
---
 CHANGELOG | 13 +
 1 file changed, 13 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 5a7dd19..0c46df3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,18 @@
 NOTE: Specific #s below correspond to Trac tickets logged and maintained at 
https://trac.torproject.org/projects/tor/
 
+/** 15.2.0 RC 4 / 3 November 2016 / 6b2679cac16782a7a36a79f90f2dd0d8e330742f 
**/
+
+89f3fca make sure the binaries are cleanly installed (bump version number)
+f5f544c update to latest badvpn for new torservice package
+f21f14b make sure tun2socks is loaded properly
+460f365 make sure Tun2Socks native library gets loaded
+5927fb0 update the build to target all arm types
+5ac21be use PIEFLAGS
+0050bfe update JNI targets
+1ae0c71 fixes github #59 for crash on app list UI
+e9ece47 update gitignore to ignore binaries
+37cd024 don't need to store this binary in the repo
+
 /** 15.2.0 RC 3 / 2 November 2016 / 354ce24283790ef72601d3a512e2d16f34aeba91  
**/
 
 41c9d2c lock in app item list row height

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


[tor-commits] [orbot/master] make sure the binaries are cleanly installed (bump version number)

2016-11-03 Thread n8fr8
commit 89f3fcacf22014d057c47a27bd18ded8f5071977
Author: Nathan Freitas 
Date:   Thu Nov 3 12:21:54 2016 -0400

make sure the binaries are cleanly installed (bump version number)
---
 .../main/java/org/torproject/android/service/TorServiceConstants.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java
 
b/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java
index bcaaf86..767f17a 100644
--- 
a/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java
+++ 
b/orbotservice/src/main/java/org/torproject/android/service/TorServiceConstants.java
@@ -134,7 +134,7 @@ public interface TorServiceConstants {
 public static final String CMD_SET_EXIT = "setexit";
 
 
-public static final String BINARY_TOR_VERSION = "0.2.8.9";
+public static final String BINARY_TOR_VERSION = "0.2.8.9a";
 public static final String PREF_BINARY_TOR_VERSION_INSTALLED = 
"BINARY_TOR_VERSION_INSTALLED";
 
 //obfsproxy 



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


[tor-commits] [orbot/master] make sure Tun2Socks native library gets loaded

2016-11-03 Thread n8fr8
commit 460f365b4ae73612c514ab5ebffa51800fb1e509
Author: Nathan Freitas 
Date:   Thu Nov 3 12:17:55 2016 -0400

make sure Tun2Socks native library gets loaded
---
 .../src/main/java/org/torproject/android/service/TorService.java| 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/orbotservice/src/main/java/org/torproject/android/service/TorService.java 
b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
index 0dab480..47af4ac 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
@@ -246,9 +246,11 @@ public class TorService extends Service implements 
TorServiceConstants, OrbotCon
 }
 
 mNotifyBuilder.setOngoing(Prefs.persistNotifications());
-mNotifyBuilder.setPriority(Notification.PRIORITY_LOW);
- mNotifyBuilder.setCategory(Notification.CATEGORY_SERVICE);
 
+ if (!Prefs.persistNotifications())
+mNotifyBuilder.setPriority(Notification.PRIORITY_LOW);
+
+ mNotifyBuilder.setCategory(Notification.CATEGORY_SERVICE);
 
  mNotification = mNotifyBuilder.build();
 



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


[tor-commits] [orbot/master] update to latest badvpn for new torservice package

2016-11-03 Thread n8fr8
commit f5f544c2d362d703862454768f99a0af0670298b
Author: Nathan Freitas 
Date:   Thu Nov 3 12:19:24 2016 -0400

update to latest badvpn for new torservice package
---
 external/badvpn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external/badvpn b/external/badvpn
index 24a97f2..fbc279c 16
--- a/external/badvpn
+++ b/external/badvpn
@@ -1 +1 @@
-Subproject commit 24a97f2101abaf0569b78ee430d62eb2543d3ec2
+Subproject commit fbc279c3c6999f8357666f4b85969dfd29764465



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


[tor-commits] [orbot/master] update the build to target all arm types

2016-11-03 Thread n8fr8
commit 5927fb0123fcaf1e6d498c7a3b938aa85372a334
Author: Nathan Freitas 
Date:   Thu Nov 3 12:17:23 2016 -0400

update the build to target all arm types
---
 orbotservice/src/main/jni/Application.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/orbotservice/src/main/jni/Application.mk 
b/orbotservice/src/main/jni/Application.mk
index abc185b..146bb44 100644
--- a/orbotservice/src/main/jni/Application.mk
+++ b/orbotservice/src/main/jni/Application.mk
@@ -1,4 +1,4 @@
-APP_ABI:= armeabi
+APP_ABI:= armeabi armeabi-v7a arm64-v8a
 APP_PLATFORM   := android-23
 APP_STL:= stlport_static
 NDK_TOOLCHAIN_VERSION  := 4.9



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


  1   2   >