[tor-commits] [translation/tor-launcher-network-settings] Update translations for tor-launcher-network-settings

2015-04-12 Thread translation
commit eb2fad8baa2c5222d36c96780d07f779ced730d3
Author: Translation commit bot 
Date:   Sun Apr 12 14:45:41 2015 +

Update translations for tor-launcher-network-settings
---
 zh_CN/network-settings.dtd |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zh_CN/network-settings.dtd b/zh_CN/network-settings.dtd
index 7162b0f..221b05d 100644
--- a/zh_CN/network-settings.dtd
+++ b/zh_CN/network-settings.dtd
@@ -47,7 +47,7 @@
 
 
 
-
+
 
 
 

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


[tor-commits] [translation/mat-gui] Update translations for mat-gui

2015-04-12 Thread translation
commit 7ae0aa082f690844746ee60713764343d099fdfd
Author: Translation commit bot 
Date:   Sun Apr 12 14:45:32 2015 +

Update translations for mat-gui
---
 ku_IQ.po |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ku_IQ.po b/ku_IQ.po
index f613e23..8e2894f 100644
--- a/ku_IQ.po
+++ b/ku_IQ.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2014-12-31 04:53+0100\n"
-"PO-Revision-Date: 2015-04-12 02:10+\n"
+"PO-Revision-Date: 2015-04-12 14:16+\n"
 "Last-Translator: runasand \n"
 "Language-Team: Kurdish (Iraq) 
(http://www.transifex.com/projects/p/torproject/language/ku_IQ/)\n"
 "MIME-Version: 1.0\n"

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


[tor-commits] [translation/tor-launcher-network-settings_completed] Update translations for tor-launcher-network-settings_completed

2015-04-12 Thread translation
commit f71a7aa593e802873398e26a81a40387db840366
Author: Translation commit bot 
Date:   Sun Apr 12 14:45:46 2015 +

Update translations for tor-launcher-network-settings_completed
---
 zh_CN/network-settings.dtd |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zh_CN/network-settings.dtd b/zh_CN/network-settings.dtd
index 7162b0f..221b05d 100644
--- a/zh_CN/network-settings.dtd
+++ b/zh_CN/network-settings.dtd
@@ -47,7 +47,7 @@
 
 
 
-
+
 
 
 

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


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

2015-04-12 Thread translation
commit 5b269e13bb0a3cd5b9b46dd815da13e4ec1dc29f
Author: Translation commit bot 
Date:   Sun Apr 12 14:45:04 2015 +

Update translations for bridgedb
---
 ku_IQ/LC_MESSAGES/bridgedb.po |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ku_IQ/LC_MESSAGES/bridgedb.po b/ku_IQ/LC_MESSAGES/bridgedb.po
index 1d1b337..12bb806 100644
--- a/ku_IQ/LC_MESSAGES/bridgedb.po
+++ b/ku_IQ/LC_MESSAGES/bridgedb.po
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
 "POT-Creation-Date: 2015-02-03 03:24+\n"
-"PO-Revision-Date: 2015-04-12 02:10+\n"
+"PO-Revision-Date: 2015-04-12 14:15+\n"
 "Last-Translator: Haval Abdulkarim \n"
 "Language-Team: Kurdish (Iraq) 
(http://www.transifex.com/projects/p/torproject/language/ku_IQ/)\n"
 "MIME-Version: 1.0\n"

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


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

2015-04-12 Thread translation
commit 32f570943772a37ac2941893bbf90cdc59c88111
Author: Translation commit bot 
Date:   Sun Apr 12 14:16:19 2015 +

Update translations for tails-misc
---
 ku_IQ.po |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ku_IQ.po b/ku_IQ.po
index 26082c9..55f6623 100644
--- a/ku_IQ.po
+++ b/ku_IQ.po
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2015-03-30 16:51+0200\n"
-"PO-Revision-Date: 2015-04-12 02:10+\n"
+"PO-Revision-Date: 2015-04-12 14:16+\n"
 "Last-Translator: Haval Abdulkarim \n"
 "Language-Team: Kurdish (Iraq) 
(http://www.transifex.com/projects/p/torproject/language/ku_IQ/)\n"
 "MIME-Version: 1.0\n"

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


[tor-commits] [translation/tails-persistence-setup] Update translations for tails-persistence-setup

2015-04-12 Thread translation
commit a104e06b0ba18972a4a898717bc0734c39ef631b
Author: Translation commit bot 
Date:   Sun Apr 12 14:15:41 2015 +

Update translations for tails-persistence-setup
---
 ku_IQ/ku_IQ.po |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ku_IQ/ku_IQ.po b/ku_IQ/ku_IQ.po
index b29113b..c0dd4c2 100644
--- a/ku_IQ/ku_IQ.po
+++ b/ku_IQ/ku_IQ.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2015-02-23 13:07+0100\n"
-"PO-Revision-Date: 2015-04-12 02:10+\n"
+"PO-Revision-Date: 2015-04-12 14:15+\n"
 "Last-Translator: runasand \n"
 "Language-Team: Kurdish (Iraq) 
(http://www.transifex.com/projects/p/torproject/language/ku_IQ/)\n"
 "MIME-Version: 1.0\n"

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


[tor-commits] [meek/master] Use persistent connections in the WSGI reflector.

2015-04-12 Thread dcf
commit e06bcf2c849075cf241addf2182dfc0125a35c92
Author: David Fifield 
Date:   Tue Apr 7 09:36:35 2015 -0700

Use persistent connections in the WSGI reflector.

This improves performance quite a lot--previously we were doing a
complete TCP and TLS handshake to meek-server for every single request,
which, apart from increasing latency, also caused a lot of CPU usage on
meek-server. it was up above 80% when I checked it.

Now we reuse connections until they error out, making a new connection
if all others are currently busy.
---
 wsgi/reflect.py |   90 ---
 1 file changed, 60 insertions(+), 30 deletions(-)

diff --git a/wsgi/reflect.py b/wsgi/reflect.py
index e9bff42..5b89f6a 100644
--- a/wsgi/reflect.py
+++ b/wsgi/reflect.py
@@ -2,35 +2,18 @@
 
 import httplib
 import urlparse
+import threading
 
 FORWARD_URL = "https://meek.bamsoftware.com/";
 TIMEOUT = 20
 BUFSIZ = 2048
+MAX_REQUEST_LENGTH = 0x1
 
 REFLECTED_HEADER_FIELDS = [
 "Content-Type",
 "X-Session-Id",
 ]
 
-# Limits a file-like object to reading only n bytes. Used to limit wsgi.input 
to
-# the Content-Length, otherwise it blocks.
-class LimitedReader(object):
-def __init__(self, f, n):
-self.f = f
-self.n = n
-
-def __getattr__(self, name):
-return getattr(self.f, name)
-
-def read(self, size=None):
-if self.n <= 0:
-return ""
-if size is None or size > self.n:
-size = self.n
-data = self.f.read(size)
-self.n -= len(data)
-return data
-
 # Join two URL paths.
 def path_join(a, b):
 if a.endswith("/"):
@@ -60,8 +43,14 @@ def copy_request(environ, url):
 
 content_length = environ.get("CONTENT_LENGTH")
 if content_length:
-body = LimitedReader(environ["wsgi.input"], int(content_length))
-headers.append(("Content-Length", content_length))
+content_length = int(content_length)
+# We read the whole response body (and limit its length). Normally we
+# would just pass environ["wsgi.input"] as the body to
+# HTTPSConnection.request. But make_request may need to try the request
+# twice, in which case it needs to send the same body the second time.
+if content_length > MAX_REQUEST_LENGTH:
+raise ValueError("Content-Length too large: %d" % content_length)
+body = environ["wsgi.input"].read(content_length)
 else:
 body = ""
 
@@ -73,18 +62,56 @@ def copy_request(environ, url):
 
 return method, url, body, headers
 
-def make_conn(url):
-u = urlparse.urlsplit(url)
-create_connection = httplib.HTTPConnection
-if u.scheme == "https":
-create_connection = httplib.HTTPSConnection
-return create_connection(u.hostname, u.port, strict=True, timeout=TIMEOUT)
+# We want to reuse persistent HTTPSConnections. If we don't then every request
+# will start a branch new TCP and TLS connection, leading to increased latency
+# and high CPU use on meek-server. A pool just locks connections so only one
+# thread can use a connection at a time. If the connection is still good after
+# use, then the caller should put it back by calling restore_conn.
+class ConnectionPool(object):
+def __init__(self, url):
+self.url = urlparse.urlsplit(url)
+self.conns = []
+self.lock = threading.RLock()
+
+def new_conn(self):
+create_connection = httplib.HTTPConnection
+if self.url.scheme == "https":
+create_connection = httplib.HTTPSConnection
+return create_connection(self.url.hostname, self.url.port, 
strict=True, timeout=TIMEOUT)
+
+def get_conn(self):
+with self.lock:
+try:
+return self.conns.pop(0)
+except IndexError:
+pass
+return self.new_conn()
+
+def restore_conn(self, conn):
+with self.lock:
+self.conns.append(conn)
 
 def make_request(conn, method, url, body, headers):
 u = urlparse.urlsplit(url)
 path = urlparse.urlunsplit(("", "", u.path, u.query, ""))
 conn.request(method, path, body, headers)
-return conn.getresponse()
+try:
+return conn.getresponse()
+except httplib.BadStatusLine, e:
+if e.message != "":
+raise
+# There's a very common error with httplib persistent connections. If
+# you let a connection idle until it times out, then issue a request,
+# you will get a BadStatusLine("") exception, not when the request is
+# sent, but when getresponse tries to read from a closed socket. When
+# that happens, we reinitialize the connection by first closing it,
+# which will cause a new TCP and TLS handshake to happen for the next
+# request.
+conn.close()
+conn.request(method, path, body, headers)
+return conn.getresponse()
+
+pool = ConnectionPool(FORWARD_U

[tor-commits] [translation/tor-launcher-network-settings_completed] Update translations for tor-launcher-network-settings_completed

2015-04-12 Thread translation
commit 03bd8f178eaeb937ea1f35f70d87da287047dfc6
Author: Translation commit bot 
Date:   Sun Apr 12 07:15:39 2015 +

Update translations for tor-launcher-network-settings_completed
---
 zh_CN/network-settings.dtd |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zh_CN/network-settings.dtd b/zh_CN/network-settings.dtd
index 4e6d5e1..7162b0f 100644
--- a/zh_CN/network-settings.dtd
+++ b/zh_CN/network-settings.dtd
@@ -47,9 +47,9 @@
 
 
 
-
+
 
-
+
 
 
 

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


[tor-commits] [translation/tor-launcher-network-settings] Update translations for tor-launcher-network-settings

2015-04-12 Thread translation
commit 99bd7a9027e985a228a8befc38f5c165cb0ac860
Author: Translation commit bot 
Date:   Sun Apr 12 07:15:33 2015 +

Update translations for tor-launcher-network-settings
---
 zh_CN/network-settings.dtd |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zh_CN/network-settings.dtd b/zh_CN/network-settings.dtd
index 4e6d5e1..7162b0f 100644
--- a/zh_CN/network-settings.dtd
+++ b/zh_CN/network-settings.dtd
@@ -47,9 +47,9 @@
 
 
 
-
+
 
-
+
 
 
 

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