[tor-commits] [translation/tor-browser-manual] Update translations for tor-browser-manual

2017-11-17 Thread translation
commit 4b39590ed53c604f30bdab039b0272f5a6f37b00
Author: Translation commit bot 
Date:   Fri Nov 17 22:50:29 2017 +

Update translations for tor-browser-manual
---
 it/it.po | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/it/it.po b/it/it.po
index 6cec45b3a..3aeadee30 100644
--- a/it/it.po
+++ b/it/it.po
@@ -531,6 +531,14 @@ msgid ""
 "Browser. If they do not match, you may need to try downloading again,"
 " or from a different source."
 msgstr ""
+"Seleziona il file Tor Browser scaricato. Satori visualizzerà il checksum del"
+" file, che dovreste confrontare con il checksum originale del software: "
+"questo lo potete trovare facendo clic sulla parola \"checksum\" dopo il "
+"collegamento su cui evete fatto clic per avviare il download. Se i due "
+"checksum corrispondono, il tuo download è andato a buon fine e puoi  iniziare ad utilizzare il  Browser Tor . Se non "
+"corrispondono, potrebbe essere necessario riprovare a riscaricarlo o a "
+"scaricarlo da un'altra fonte."
 
 #: first-time.page:7
 msgid "Learn how to use Tor Browser for the first time"
@@ -1113,6 +1121,10 @@ msgid ""
 "icon at the top-left of the window, which allows you to control the "
 "JavaScript that runs on individual web pages, or to block it entirely."
 msgstr ""
+"Il browser Toe include un add-on chiamato NoScript, che può essere "
+"utilizzato cliccando l'icona \"S\" situata in alto a sinistra della "
+"finestra; questa permette di controllare i Javascript di ogni singola pagina"
+" o di bloccarli completamente. "
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1266,6 +1278,8 @@ msgid ""
 "Network location of the computer used to visit the website (the public IP "
 "address)."
 msgstr ""
+"Posizione di rete del computer utilizzato per visitare il sito Web "
+"(l'indirizzo IP pubblico)."
 
 #: secure-connections.page:115
 msgid "Whether or not Tor is being used."
@@ -1482,6 +1496,11 @@ msgid ""
 "Web Services; meek-azure makes it look like you are using a Microsoft web "
 "site; and meek-google makes it look like you are using Google search."
 msgstr ""
+"Questi trasporti lo fanno credere che state navigando in un sito dei siti "
+"principali del Web invece di utilizzare Tor. Meek-amazon fa sembrare che "
+"state usando i servizi web di Amazon; meek-azure fa sembrare che state "
+"visitando un sito Web Microsoft e meek-google fa sembrare che state "
+"utilizzando la ricerca di Google."
 
 #: troubleshooting.page:6
 msgid "What to do if Tor Browser doesn’t work"

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


[tor-commits] [translation/tor-browser-manual] Update translations for tor-browser-manual

2017-11-17 Thread translation
commit c8d73114e7f5b6c60d1a85d1c4fd186b0ecdc18c
Author: Translation commit bot 
Date:   Fri Nov 17 22:22:11 2017 +

Update translations for tor-browser-manual
---
 it/it.po | 44 +++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/it/it.po b/it/it.po
index 910645a14..6cec45b3a 100644
--- a/it/it.po
+++ b/it/it.po
@@ -577,6 +577,12 @@ msgid ""
 "Troubleshooting page for help solving "
 "the problem."
 msgstr ""
+"Nella maggior parte dei casi, scegliendo \"Connetti\" è possibile "
+"connettersi alla rete Tor senza ulteriori configurazioni. Una volta "
+"cliccato, apparirà una barra di stato che mostrerà l'avanzamento della "
+"connessione Tor. Se hai una connessione relativamente veloce, ma questa "
+"barra sembra bloccarsi a un certo punto, consulta la pagina Problemiper assistenza."
 
 #: first-time.page:33
 msgid "Configure"
@@ -758,6 +764,12 @@ msgid ""
 "trackers, and advertising beacons, all of which can link your activity "
 "across different sites."
 msgstr ""
+"Quando ti connetti a un sito web, non ci sono solo gli operatori di quel "
+"sito Web che possono registrare informazioni sulla tua visita. La maggior "
+"parte dei siti Web utilizza numerosi servizi di terze parti, tra cui "
+"pulsanti \"Mi piace\" dei social network, tracker di analisi e beacon "
+"pubblicitari, ognuno dei quali può collegare la tua attività sui diversi "
+"siti."
 
 #: managing-identities.page:20
 msgid ""
@@ -767,6 +779,12 @@ msgid ""
 " Browser includes some additional features that help you control what "
 "information can be tied to your identity."
 msgstr ""
+"L'uso della rete Tor impedisce agli osservatori di scoprire la posizione "
+"esatta e l'indirizzo IP, ma anche senza queste informazioni potrebbero "
+"essere in grado di collegare insieme le diverse aree della vostra attività. "
+"Per questo motivo il Browser Tor include alcune funzionalità aggiuntive che "
+"vi aiutano a controllare quali informazioni possono essere legate alla "
+"vostra identità."
 
 #: managing-identities.page:29
 msgid "The URL bar"
@@ -788,6 +806,10 @@ msgid ""
 "single website in separate tabs or windows, without any loss of "
 "functionality."
 msgstr ""
+"D'altra parte, tutte le connessioni ad un singolo indirizzo del sito web "
+"saranno fatte sullo stesso circuito Tor, il che significa che potrete "
+"sfogliare diverse pagine di un singolo sito web in schede o finestre "
+"separate, senza alcuna perdita di funzionalità."
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -820,6 +842,10 @@ msgid ""
 "there may be situations in which it makes sense to use Tor with websites "
 "that require usernames, passwords, or other identifying information."
 msgstr ""
+"Anche se il Browser Tor è progettato per consentire l'anonimato totale "
+"dell'utente sul Web, ci possono essere situazioni in cui ha senso utilizzare"
+" Tor con siti web che richiedono nomi utente, password o altre informazioni "
+"identificative."
 
 #: managing-identities.page:62
 msgid ""
@@ -830,6 +856,13 @@ msgid ""
 "you reveal to the websites you browse. Logging in using Tor Browser is also "
 "useful if the website you are trying to reach is censored on your network."
 msgstr ""
+"Se si accede a un sito Web utilizzando un normale browser, si rivela anche "
+"l'indirizzo IP e la posizione geografica nel processo. Lo stesso è spesso "
+"vero quando si invia una e-mail. L'accesso al social network o agli account "
+"di posta elettronica tramite il Browser Tor consente di scegliere "
+"esattamente quali informazioni rivelare ai siti Web che si visitano. "
+"L'accesso utilizzando il Browser Tor è utile anche se il sito Web che stai "
+"cercando di raggiungere è censurato sulla tua rete."
 
 #: managing-identities.page:72
 msgid ""
@@ -1026,6 +1059,9 @@ msgid ""
 "connecting to http://3g2upl4pq6kufc4m.onion/\;>DuckDuckGo's "
 "Onion Service"
 msgstr ""
+"Puoi anche assicurarti di poter accedere ai servizi Onion connettendoti al "
+"http://3g2upl4pq6kufc4m.onion/\;>Servizio Onion "
+"DuckDuckGo"
 
 #: plugins.page:6
 msgid "How Tor Browser handles add-ons, plugins and JavaScript"
@@ -1233,7 +1269,7 @@ msgstr ""
 
 #: secure-connections.page:115
 msgid "Whether or not Tor is being used."
-msgstr ""
+msgstr "Indipendentemente dal fatto che Tor venga utilizzato o meno."
 
 #: security-slider.page:6
 msgid "Configuring Tor Browser for security and usability"
@@ -1457,6 +1493,9 @@ msgid ""
 " running the program, and clicking the “Connect” button if you are using 
it "
 "for the first time."
 msgstr ""
+"Dovreste essere in grado di iniziare a navigare sul Web utilizzando il "
+"browser Tor poco dopo aver eseguito il programma e facendo clic sul pulsante"
+" \"Connetti\" se lo state utilizzando per la prima volta."
 
 #: troubleshooting.page:21
 msgid "Quick fixes"
@@ 

[tor-commits] [translation/tor-browser-manual] Update translations for tor-browser-manual

2017-11-17 Thread translation
commit 7e861f0e86b9d79a21969ca5acea09eff17f74fd
Author: Translation commit bot 
Date:   Fri Nov 17 21:50:29 2017 +

Update translations for tor-browser-manual
---
 it/it.po | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/it/it.po b/it/it.po
index 41f2d494b..910645a14 100644
--- a/it/it.po
+++ b/it/it.po
@@ -330,6 +330,8 @@ msgid ""
 "Select “Connect with provided bridges”. Tor Browser currently has six "
 "pluggable transport options to choose from."
 msgstr ""
+"Seleziona \" Connetti con i ponti predefiniti\". Il browser Tor ha sei "
+"diversi opzioni di pluggable transports selezionabili"
 
 #: circumvention.page:60
 msgid "Which transport should I use?"
@@ -504,6 +506,12 @@ msgid ""
 "after the name of the program — each one represents a different source from 
"
 "which to get the software. Your download will then begin."
 msgstr ""
+"All'apertura di Satori, fai clic sulla tua lingua preferita. Un menu si "
+"aprirà elencando i download disponibili per la lingua selezionata. Trova la "
+"voce per il Browser tor sotto il nome del tuo sistema operativo. Seleziona "
+"\"A\" o \"B\" dopo il nome del programma - ognuno rappresenta una fonte "
+"diversa da cui ottenere il software. Dopo di ciò inizierà il download del "
+"file."
 
 #: downloading.page:115
 msgid ""
@@ -997,6 +1005,10 @@ msgid ""
 "entered the 16-character onion address correctly: even a small mistake will "
 "stop Tor Browser from being able to reach the site."
 msgstr ""
+"Se non riuscite a raggiungere il servizio onion di cui avete bisogno "
+"controllate di aver digitato correttamente i 16 caratteri "
+"dell'indirizzo.Anche un minino errore impedirà al Browser Tor di raggiungere"
+" il sito richiesto."
 
 #: onionsites.page:64
 msgid ""
@@ -1004,6 +1016,9 @@ msgid ""
 "later. There may be a temporary connection issue, or the site operators may "
 "have allowed it to go offline without warning."
 msgstr ""
+"Se ancora non riuscite a connettervi al servizio onion riprovate più tardi. "
+"Potrebbero esserci dei problemi temporanei di connessione o i gestori del "
+"sito lo hanno messo offline senza nessun avviso"
 
 #: onionsites.page:69
 msgid ""
@@ -1132,6 +1147,12 @@ msgid ""
 " verify this in the URL bar: if your connection is encrypted, the address "
 "will begin with “https://”, rather than “http://”.;
 msgstr ""
+"Se le informazioni personali, quali login e/o password, viaggiano in chiaro "
+"sulla rete  potrebbero essere facilmente ascoltate da un intercettatore. Se "
+"stai accedendo a qualsiasi sito web sii sicuro che il sito offra una "
+"cifratura HTTPS che protegge i dati dalle intercettazioni. Puoi verificare "
+"che la connessione è cifrata se l'indirizzo inizia per \"https://\; al posto"
+" di \"http://\";
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1151,6 +1172,8 @@ msgid ""
 "The following visualization shows what information is visible to "
 "eavesdroppers with and without Tor Browser and HTTPS encryption:"
 msgstr ""
+"Questa visualizzazione mostra quali informazioni sono visibili agli "
+"intercettatori con e senza la cifratura del Browser Tor e HTTPS:"
 
 #: secure-connections.page:35
 msgid ""
@@ -1166,18 +1189,25 @@ msgid ""
 "Click the “HTTPS” button to see what data is visible to observers when "
 "you're using HTTPS. The button will turn green to indicate that HTTPS is on."
 msgstr ""
+"Cliccate sul pulsante \"HTTPS\" per vedere quali dati sono visibili ad un "
+"osservatore quando state usando il protocollo HTTPS. Il pulsante diventerà "
+"verde quando HTTPS è attivo"
 
 #: secure-connections.page:49
 msgid ""
 "When both buttons are green, you see the data that is visible to observers "
 "when you are using both tools."
 msgstr ""
+"Quando entrambi i pulsanti sono verdi, vengono visualizzati i dati visibili "
+"agli osservatori quando si utilizzano entrambi gli strumenti."
 
 #: secure-connections.page:55
 msgid ""
 "When both buttons are grey, you see the data that is visible to observers "
 "when you don't use either tool."
 msgstr ""
+"Quando entrambi i pulsanti sono grigi, vengono visualizzati i dati visibili "
+"agli osservatori quando non si utilizzano entrambi gli strumenti."
 
 #: secure-connections.page:62
 msgid "Potentially visible data"

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


[tor-commits] [translation/tor-browser-manual] Update translations for tor-browser-manual

2017-11-17 Thread translation
commit 4d5fd2647bcd28f7b80db96303c3b3b6af0989e1
Author: Translation commit bot 
Date:   Fri Nov 17 21:20:29 2017 +

Update translations for tor-browser-manual
---
 it/it.po | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/it/it.po b/it/it.po
index 951c761e0..41f2d494b 100644
--- a/it/it.po
+++ b/it/it.po
@@ -702,6 +702,8 @@ msgid ""
 "The Tor Browser package is dated January 1, 2000 00:00:00 UTC. This is to "
 "ensure that each software build is exactly reproducible."
 msgstr ""
+"Il pacchetto del browser Tor è datato 1 gennaio 2000 00:00:00 UTC. Questo "
+"per garantire che ogni build del software sia esattamente riproducibile."
 
 #: known-issues.page:54
 msgid ""
@@ -1155,6 +1157,9 @@ msgid ""
 "Click the “Tor” button to see what data is visible to observers when 
you're "
 "using Tor. The button will turn green to indicate that Tor is on."
 msgstr ""
+"Cliccate sul pulsante \"Tor\" per vedere quali dati sono visibili ad un "
+"osservatore quando state utilizzando la rete Tor. Il bottone diventerà verde"
+" quando Tor è attivato"
 
 #: secure-connections.page:42
 msgid ""
@@ -1397,6 +1402,8 @@ msgid ""
 "FTE (format-transforming encryption) disguises Tor traffic as ordinary web "
 "(HTTP) traffic."
 msgstr ""
+"FTE (cifratura format-transforming) nasconde il traffico Tor e lo fa passare"
+" come del normale traffico web (HTTP)."
 
 #: transports.page:82
 msgid "meek"

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


[tor-commits] [nyx/master] Fix git link on changelog

2017-11-17 Thread atagar
commit 2ca19e623a82620672457f2e3ffc34d33506bfa4
Author: Damian Johnson 
Date:   Fri Nov 17 12:34:31 2017 -0800

Fix git link on changelog

https://trac.torproject.org/projects/tor/ticket/24289
---
 web/changelog/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/changelog/index.html b/web/changelog/index.html
index f597404..54737d5 100644
--- a/web/changelog/index.html
+++ b/web/changelog/index.html
@@ -65,7 +65,7 @@
   
   Unreleased
 
-  The following are only available within Nyx's git 
repository.
+  The following are only available within Nyx's https://gitweb.torproject.org/nyx.git;>git repository.
 
   
 Connections

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


[tor-commits] [translation/tor-launcher-properties] Update translations for tor-launcher-properties

2017-11-17 Thread translation
commit 972c512574809c84cc1fbc49477f168f2adc1a7a
Author: Translation commit bot 
Date:   Fri Nov 17 18:16:36 2017 +

Update translations for tor-launcher-properties
---
 ms_MY/torlauncher.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ms_MY/torlauncher.properties b/ms_MY/torlauncher.properties
index 83bedf6fa..aecbe5a74 100644
--- a/ms_MY/torlauncher.properties
+++ b/ms_MY/torlauncher.properties
@@ -32,7 +32,7 @@ torlauncher.bridge_suffix.meek-amazon=(works in China)
 torlauncher.bridge_suffix.meek-azure=(works in China)
 
 torlauncher.connect=Menyambung
-torlauncher.restart_tor=Restart Tor
+torlauncher.restart_tor=Mulakan semula Tor
 torlauncher.quit=Henti
 torlauncher.quit_win=Keluar
 torlauncher.done=Selesai

___
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

2017-11-17 Thread translation
commit 340873780e6f65dd02ca76aeb8a066e61d77ee64
Author: Translation commit bot 
Date:   Fri Nov 17 18:16:55 2017 +

Update translations for tor-launcher-network-settings
---
 ms_MY/network-settings.dtd | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ms_MY/network-settings.dtd b/ms_MY/network-settings.dtd
index 978df8b82..f047e2797 100644
--- a/ms_MY/network-settings.dtd
+++ b/ms_MY/network-settings.dtd
@@ -9,15 +9,15 @@
 
 
 
-
+
 
 
-
+
 
 
 
 
-
+
 
 
 
@@ -27,9 +27,9 @@
 
 
 
-
+
 
-
+
 
 
 

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


[tor-commits] [depictor/master] Add the ReachableIPv6 pseudoflag. Closes 24287

2017-11-17 Thread tom
commit 5a8e4af0d4a1b7ea62a79d37eda63b3a5c6bcd6c
Author: Tom Ritter 
Date:   Fri Nov 17 11:49:35 2017 -0600

Add the ReachableIPv6 pseudoflag. Closes 24287
---
 website.py | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/website.py b/website.py
index ded0fce..c71e486 100755
--- a/website.py
+++ b/website.py
@@ -29,7 +29,10 @@ class WebsiteWriter:
directory_key_warning_time = datetime.timedelta(days=14)
config = {}
known_params = []
+   already_added_pseudoflags = False
def write_website(self, filename, include_relay_info=True):
+   if not self.already_added_pseudoflags:
+   self._add_pseudo_flags()
self.site = open(filename, 'w')
self._write_page_header(include_relay_info)
self._write_valid_after_time()
@@ -76,6 +79,29 @@ class WebsiteWriter:
return self.consensus.valid_after
 

#-
+   def _add_pseudo_flags(self):
+   """
+   Add any calculated or otherwise pseudoflags to the data 
structures
+   """
+   self.already_added_pseudoflags = True
+
+   # Add the ReachableIPv6 flag
+   for dirauth_nickname in self.known_authorities:
+   if dirauth_nickname in self.votes:
+   vote = self.votes[dirauth_nickname]
+   has_ipv6 = False
+   for r in vote.routers:
+   if len([a for a in 
vote.routers[r].or_addresses if a[2] == True]):
+   has_ipv6 = True
+   
vote.routers[r].flags.append('ReachableIPv6')
+   if has_ipv6:
+   vote.known_flags.append('ReachableIPv6')
+   for r in self.consensus.routers:
+   if len([a for a in 
self.consensus.routers[r].or_addresses if a[2] == True]):
+   
self.consensus.routers[r].flags.append('ReachableIPv6')
+   self.consensus.known_flags.append('ReachableIPv6')
+
+   
#-
def _write_page_header(self, include_relay_info):
"""
Write the HTML page header including the metrics website 
navigation.

___
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

2017-11-17 Thread translation
commit be6aa854ebfdfdde740e7df66da139d38acb288b
Author: Translation commit bot 
Date:   Fri Nov 17 17:46:53 2017 +

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

diff --git a/ms_MY/network-settings.dtd b/ms_MY/network-settings.dtd
index 0d66f7a2e..978df8b82 100644
--- a/ms_MY/network-settings.dtd
+++ b/ms_MY/network-settings.dtd
@@ -1,11 +1,11 @@
 
-
+
 
 
 
 
 
-
+
 
 
 

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


[tor-commits] [depictor/master] Correctly return to the execution directory, so invocation of ./website.py can succeed.

2017-11-17 Thread tom
commit a168d6af049fd9b08fcae161973a0696021dd529
Author: Tom Ritter 
Date:   Fri Nov 17 11:11:43 2017 -0600

Correctly return to the execution directory, so invocation of ./website.py 
can succeed.
---
 website.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/website.py b/website.py
index 31d526e..ded0fce 100755
--- a/website.py
+++ b/website.py
@@ -1414,7 +1414,7 @@ class WebsiteWriter:
 
os.chdir(os.path.join(os.path.dirname(__file__), 'stem'))
stem_version = subprocess.check_output(['git', 'rev-parse', 
'--short', 'HEAD'])
-   os.chdir(os.path.join(os.path.dirname(__file__)))
+   os.chdir('../../')
 
self.site.write("\n"
+ "\n"

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


[tor-commits] [metrics-web/master] Take out quoted qualified search terms for now.

2017-11-17 Thread karsten
commit 953ac3064dfad3aa2fab19b0669424d4c7a7c736
Author: Karsten Loesing 
Date:   Fri Nov 17 17:17:27 2017 +0100

Take out quoted qualified search terms for now.

It looks like the implemention is still broken, so we should fix that
first and then either revert this commit or re-introduce this feature
in a new protocol version 4.4.
---
 website/src/main/resources/web/WEB-INF/onionoo.jsp | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/website/src/main/resources/web/WEB-INF/onionoo.jsp 
b/website/src/main/resources/web/WEB-INF/onionoo.jsp
index 8468111..efb68e2 100644
--- a/website/src/main/resources/web/WEB-INF/onionoo.jsp
+++ b/website/src/main/resources/web/WEB-INF/onionoo.jsp
@@ -280,8 +280,7 @@ Added "build_revision" field to response header
 on October 10, 2017.
 #
 4.3:
-Added support for quoting qualified search terms in the "search"
-parameter, a new "host_name" parameter to filter by host name, and a new
+Added a new "host_name" parameter to filter by host name and a new
 "unreachable_or_addresses" field with declared but unreachable OR
 addresses on November 17, 2017.
 #
@@ -396,7 +395,7 @@ Parameter values are case-insensitive.
 
 
 
-search updated
+search
 #
 
 Return only (1) relays with the parameter value matching (part of a)
@@ -418,15 +417,12 @@ of all relays and bridges matching all search terms will 
be returned.
 Complete hex-encoded fingerprints should always be hashed using SHA-1,
 regardless of searching for a relay or a bridge, in order to not
 accidentally leak non-hashed bridge fingerprints in the URL.
-Qualified search terms have the form 'key:value' (without single quotes)
-or 'key:"value"' (without single quotes, using \" to escape double quotes)
+Qualified search terms have the form "key:value" (without double quotes)
 with "key" being one of the parameters listed here except for "search",
 "fingerprint", "order", "limit", "offset", and "fields", and "value" being
 the string that will internally be passed to that parameter.
 If a qualified search term for a given "key" is specified more than once,
 only the first "value" is considered.
-Added support for quoting qualified
-search terms on November 17, 2017.
 
 
 

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


[tor-commits] [metrics-web/master] Fix formatting on Onionoo protocol page.

2017-11-17 Thread karsten
commit 1573b086267cced9513709143d0ce3f3278c60e4
Author: Karsten Loesing 
Date:   Fri Nov 17 16:33:52 2017 +0100

Fix formatting on Onionoo protocol page.
---
 website/src/main/resources/web/WEB-INF/onionoo.jsp | 24 +++---
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/website/src/main/resources/web/WEB-INF/onionoo.jsp 
b/website/src/main/resources/web/WEB-INF/onionoo.jsp
index 32b5c36..8468111 100644
--- a/website/src/main/resources/web/WEB-INF/onionoo.jsp
+++ b/website/src/main/resources/web/WEB-INF/onionoo.jsp
@@ -396,7 +396,7 @@ Parameter values are case-insensitive.
 
 
 
-search
+search updated
 #
 
 Return only (1) relays with the parameter value matching (part of a)
@@ -425,7 +425,7 @@ with "key" being one of the parameters listed here except 
for "search",
 the string that will internally be passed to that parameter.
 If a qualified search term for a given "key" is specified more than once,
 only the first "value" is considered.
-Added support for quoting qualified
+Added support for quoting qualified
 search terms on November 17, 2017.
 
 
@@ -578,7 +578,7 @@ Searchers are case-insensitive.
 
 
 
-host_name
+host_name new
 #
 
 Return only relays with a domain name ending in the given (partial)
@@ -587,7 +587,7 @@ Searches for subdomains of a specific domain should ideally 
be prefixed
 with a period, for example: ".csail.mit.edu".
 Non-ASCII host name characters must be encoded as punycode.
 Filtering by host name is case-insensitive.
-Added on November 17, 2017.
+Added on November 17, 2017.
 
 
 
@@ -1450,7 +1450,7 @@ the relay did not report which version it runs.
 
 
 
-effective_family
+effective_family updated
 array of strings
 optional
 #
@@ -1461,7 +1461,7 @@ These relays are part of this relay's family and they 
consider this relay
 to be part of their family.
 Omitted if empty or if descriptor containing this information cannot be
 found.
-Protocol version 5.0 is going to
+Protocol version 5.0 is going to
 remove the $ prefix from fingerprints, to be deployed after December 17,
 2017.
 
@@ -1469,7 +1469,7 @@ remove the $ prefix from fingerprints, to be deployed 
after December 17,
 
 
 
-alleged_family
+alleged_family updated
 array of strings
 optional
 #
@@ -1480,7 +1480,7 @@ These relays are part of this relay's family but they 
don't consider this
 relay to be part of their family.
 Omitted if empty or if descriptor containing this information cannot be
 found.
-Protocol version 5.0 is going to
+Protocol version 5.0 is going to
 remove the $ prefix from fingerprints, to be deployed after December 17,
 2017.
 
@@ -1488,7 +1488,7 @@ remove the $ prefix from fingerprints, to be deployed 
after December 17,
 
 
 
-indirect_family
+indirect_family updated
 array of strings
 optional
 #
@@ -1498,7 +1498,7 @@ mutual family relationship with this relay but that can 
be reached by
 following effective, mutual family relationships starting at this relay.
 Omitted if empty or if descriptor containing this information cannot be
 found.
-Protocol version 5.0 is going to
+Protocol version 5.0 is going to
 remove the $ prefix from fingerprints, to be deployed after December 17,
 2017.
 
@@ -1586,7 +1586,7 @@ contain measurement information.
 
 
 
-unreachable_or_addresses
+unreachable_or_addresses new
 array of strings
 optional
 #
@@ -1599,7 +1599,7 @@ whereas relays with an unreachable primary address are 
excluded entirely.
 Addresses are in arbitrary order.
 IPv6 hex characters are all lower-case.
 Omitted if empty.
-Added on November 17, 2017.
+Added on November 17, 2017.
 
 
 

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


[tor-commits] [metrics-web/master] Update Onionoo protocol for versions 4.3 and 5.0.

2017-11-17 Thread karsten
commit 283109367f93cafb6162db090c1ead0bda3bb31b
Author: Karsten Loesing 
Date:   Fri Nov 17 15:28:07 2017 +0100

Update Onionoo protocol for versions 4.3 and 5.0.

Includes specification updates for #21366 (quoting qualified search
terms), #16553 (host_name parameter), #21637 (unreachable_or_addresses
field), and #22261 (remove $ from fingerprints in family-related
fields).
---
 website/src/main/resources/web/WEB-INF/onionoo.jsp | 59 +-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/website/src/main/resources/web/WEB-INF/onionoo.jsp 
b/website/src/main/resources/web/WEB-INF/onionoo.jsp
index 0ed4f6c..32b5c36 100644
--- a/website/src/main/resources/web/WEB-INF/onionoo.jsp
+++ b/website/src/main/resources/web/WEB-INF/onionoo.jsp
@@ -279,6 +279,17 @@ on August 30, 2017.
 Added "build_revision" field to response header
 on October 10, 2017.
 #
+4.3:
+Added support for quoting qualified search terms in the "search"
+parameter, a new "host_name" parameter to filter by host name, and a new
+"unreachable_or_addresses" field with declared but unreachable OR
+addresses on November 17, 2017.
+#
+5.0
+(scheduled, but not deployed yet!): Remove $ from fingerprints in
+"effective_family", "alleged_family", and "indirect_family" fields, to
+be deployed after December 17, 2017.
+#
 
 
 
@@ -407,12 +418,15 @@ of all relays and bridges matching all search terms will 
be returned.
 Complete hex-encoded fingerprints should always be hashed using SHA-1,
 regardless of searching for a relay or a bridge, in order to not
 accidentally leak non-hashed bridge fingerprints in the URL.
-Qualified search terms have the form "key:value" (without double quotes)
+Qualified search terms have the form 'key:value' (without single quotes)
+or 'key:"value"' (without single quotes, using \" to escape double quotes)
 with "key" being one of the parameters listed here except for "search",
 "fingerprint", "order", "limit", "offset", and "fields", and "value" being
 the string that will internally be passed to that parameter.
 If a qualified search term for a given "key" is specified more than once,
 only the first "value" is considered.
+Added support for quoting qualified
+search terms on November 17, 2017.
 
 
 
@@ -562,6 +576,21 @@ Searchers are case-insensitive.
 
 
 
+
+
+host_name
+#
+
+Return only relays with a domain name ending in the given (partial)
+host name.
+Searches for subdomains of a specific domain should ideally be prefixed
+with a period, for example: ".csail.mit.edu".
+Non-ASCII host name characters must be encoded as punycode.
+Filtering by host name is case-insensitive.
+Added on November 17, 2017.
+
+
+
 
 
 
@@ -1432,6 +1461,9 @@ These relays are part of this relay's family and they 
consider this relay
 to be part of their family.
 Omitted if empty or if descriptor containing this information cannot be
 found.
+Protocol version 5.0 is going to
+remove the $ prefix from fingerprints, to be deployed after December 17,
+2017.
 
 
 
@@ -1448,6 +1480,9 @@ These relays are part of this relay's family but they 
don't consider this
 relay to be part of their family.
 Omitted if empty or if descriptor containing this information cannot be
 found.
+Protocol version 5.0 is going to
+remove the $ prefix from fingerprints, to be deployed after December 17,
+2017.
 
 
 
@@ -1463,6 +1498,9 @@ mutual family relationship with this relay but that can 
be reached by
 following effective, mutual family relationships starting at this relay.
 Omitted if empty or if descriptor containing this information cannot be
 found.
+Protocol version 5.0 is going to
+remove the $ prefix from fingerprints, to be deployed after December 17,
+2017.
 
 
 
@@ -1546,6 +1584,25 @@ contain measurement information.
 
 
 
+
+
+unreachable_or_addresses
+array of strings
+optional
+#
+
+Array of IPv4 or IPv6 addresses and TCP ports or port lists where the
+relay claims in its descriptor to accept onion-routing connections but
+that the directory authorities failed to confirm as reachable.
+Contains only additional addresses of a relay that are found unreachable,
+whereas relays with an unreachable primary address are excluded entirely.
+Addresses are in arbitrary order.
+IPv6 hex characters are all lower-case.
+Omitted if empty.
+Added on November 17, 2017.
+
+
+
 
 
 

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


[tor-commits] [onionoo/master] Bump version to 4.3-1.7.1-dev.

2017-11-17 Thread karsten
commit e118782c5066c8ac79829c11078c73fc8ddd8b61
Author: Karsten Loesing 
Date:   Fri Nov 17 16:21:14 2017 +0100

Bump version to 4.3-1.7.1-dev.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index 4e865c9..45e09dc 100644
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
   
   
   
+value="${onionoo.protocol.version}-1.7.1-dev"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/release] Prepare for 4.3-1.7.1 release.

2017-11-17 Thread karsten
commit 8f54fc8e34b2d932293b8ddc83b81f6413417e78
Author: Karsten Loesing 
Date:   Fri Nov 17 16:05:38 2017 +0100

Prepare for 4.3-1.7.1 release.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index dd2967f..4e865c9 100644
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
   
   
   
+value="${onionoo.protocol.version}-1.7.1"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/release] Bump version to 4.3-1.7.0-dev.

2017-11-17 Thread karsten
commit 022c89b919076e2d91677044b3de50a800fa98b4
Author: Karsten Loesing 
Date:   Fri Nov 17 14:49:47 2017 +0100

Bump version to 4.3-1.7.0-dev.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index b4ef4d2..dd2967f 100644
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
   
   
   
+value="${onionoo.protocol.version}-1.7.0-dev"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/release] Add "unreachable_or_addresses" to "fields" parameter.

2017-11-17 Thread karsten
commit 708946d2b5a73d868778af69d6f46a80400587f7
Author: Karsten Loesing 
Date:   Fri Nov 17 16:02:43 2017 +0100

Add "unreachable_or_addresses" to "fields" parameter.
---
 CHANGELOG.md | 7 +++
 src/main/java/org/torproject/onionoo/server/ResponseBuilder.java | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b7c400..eef02a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# Changes in version 4.3-1.7.1 - 2017-11-17
+
+ * Minor changes
+   - Include "unreachable_or_addresses" as accepted value in the
+ "fields" parameter.
+
+
 # Changes in version 4.3-1.7.0 - 2017-11-17
 
  * Medium changes
diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java 
b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index 267c359..58b66ce 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -339,6 +339,9 @@ public class ResponseBuilder {
 dd.setAllegedFamily(detailsDocument.getAllegedFamily());
   } else if (field.equals("indirect_family")) {
 dd.setIndirectFamily(detailsDocument.getIndirectFamily());
+  } else if (field.equals("unreachable_or_addresses")) {
+dd.setUnreachableOrAddresses(
+detailsDocument.getUnreachableOrAddresses());
   }
 }
 /* Don't escape HTML characters, like < and >, contained in



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


[tor-commits] [onionoo/master] Prepare for 4.3-1.7.1 release.

2017-11-17 Thread karsten
commit 8f54fc8e34b2d932293b8ddc83b81f6413417e78
Author: Karsten Loesing 
Date:   Fri Nov 17 16:05:38 2017 +0100

Prepare for 4.3-1.7.1 release.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index dd2967f..4e865c9 100644
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
   
   
   
+value="${onionoo.protocol.version}-1.7.1"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/master] Add "unreachable_or_addresses" to "fields" parameter.

2017-11-17 Thread karsten
commit 708946d2b5a73d868778af69d6f46a80400587f7
Author: Karsten Loesing 
Date:   Fri Nov 17 16:02:43 2017 +0100

Add "unreachable_or_addresses" to "fields" parameter.
---
 CHANGELOG.md | 7 +++
 src/main/java/org/torproject/onionoo/server/ResponseBuilder.java | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b7c400..eef02a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# Changes in version 4.3-1.7.1 - 2017-11-17
+
+ * Minor changes
+   - Include "unreachable_or_addresses" as accepted value in the
+ "fields" parameter.
+
+
 # Changes in version 4.3-1.7.0 - 2017-11-17
 
  * Medium changes
diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java 
b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index 267c359..58b66ce 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -339,6 +339,9 @@ public class ResponseBuilder {
 dd.setAllegedFamily(detailsDocument.getAllegedFamily());
   } else if (field.equals("indirect_family")) {
 dd.setIndirectFamily(detailsDocument.getIndirectFamily());
+  } else if (field.equals("unreachable_or_addresses")) {
+dd.setUnreachableOrAddresses(
+detailsDocument.getUnreachableOrAddresses());
   }
 }
 /* Don't escape HTML characters, like < and >, contained in

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


[tor-commits] [tor/release-0.3.2] Fix a clang unitialized-var warning

2017-11-17 Thread nickm
commit 3a5ca47d8f0b97da80199c7787b81c28c9247bb3
Author: Nick Mathewson 
Date:   Tue Nov 7 19:40:52 2017 -0500

Fix a clang unitialized-var warning
---
 src/test/test_entrynodes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 2aef5cbbf..43cc39488 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -1729,6 +1729,7 @@ test_entry_guard_select_for_circuit_no_confirmed(void 
*arg)
   /* Simpler cases: no gaurds are confirmed yet. */
   (void)arg;
   guard_selection_t *gs = guard_selection_new("default", GS_TYPE_NORMAL);
+  entry_guard_restriction_t *rst = NULL;
 
   /* simple starting configuration */
   entry_guards_update_primary(gs);
@@ -1810,7 +1811,6 @@ test_entry_guard_select_for_circuit_no_confirmed(void 
*arg)
   tt_ptr_op(g2, OP_EQ, g);
 
   /* But if we impose a restriction, we don't get the same guard */
-  entry_guard_restriction_t *rst;
   rst = guard_create_exit_restriction((uint8_t*)g->identity);
   g2 = select_entry_guard_for_circuit(gs, GUARD_USAGE_TRAFFIC, rst, );
   tt_ptr_op(g2, OP_NE, g);



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


[tor-commits] [tor/release-0.3.2] Fix a wide comment

2017-11-17 Thread nickm
commit 9fbc835f10e9fba6a9b0c6643a41aee9c8aa05c2
Author: Nick Mathewson 
Date:   Fri Nov 17 09:57:15 2017 -0500

Fix a wide comment
---
 src/or/scheduler.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index dabac386d..cbf51447b 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -258,9 +258,10 @@ select_scheduler(void)
   /* We should only log this once in most cases. If it was the kernel
* losing support for kist that caused scheduler_can_use_kist() to
* return false, then this flag makes sure we only log this message
-   * once. If it was the consensus that switched from "yes use kist" to
-   * "no don't use kist", then we still set the flag so we log once, 
but
-   * we unset the flag elsewhere if we ever can_use_kist() again.
+   * once. If it was the consensus that switched from "yes use kist"
+   * to "no don't use kist", then we still set the flag so we log
+   * once, but we unset the flag elsewhere if we ever can_use_kist()
+   * again.
*/
   have_logged_kist_suddenly_disabled = 1;
   log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "



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


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

2017-11-17 Thread nickm
commit 9c17a6d28b4acf044f408a0c7211e051e238c797
Merge: 9fbc835f1 3a5ca47d8
Author: Nick Mathewson 
Date:   Fri Nov 17 09:58:12 2017 -0500

Merge branch 'bug23817_tests_032' into maint-0.3.2

 src/or/directory.c |  42 -
 src/or/directory.h |  42 +
 src/test/test_entrynodes.c | 146 +++--
 3 files changed, 171 insertions(+), 59 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.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2017-11-17 Thread nickm
commit cf92667b9ffb427f85584f95bc8fea389ab31885
Merge: 330ccb699 9c17a6d28
Author: Nick Mathewson 
Date:   Fri Nov 17 09:59:26 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug23817   |   3 +
 src/or/directory.c |  82 -
 src/or/directory.h |  44 ++
 src/or/entrynodes.c| 121 +
 src/or/entrynodes.h|  33 +++---
 src/or/microdesc.c | 101 +++
 src/or/microdesc.h |   4 ++
 src/or/networkstatus.c |   3 +
 src/or/scheduler.c |   7 ++-
 src/test/test_entrynodes.c | 146 +++--
 10 files changed, 447 insertions(+), 97 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 a clang unitialized-var warning

2017-11-17 Thread nickm
commit 3a5ca47d8f0b97da80199c7787b81c28c9247bb3
Author: Nick Mathewson 
Date:   Tue Nov 7 19:40:52 2017 -0500

Fix a clang unitialized-var warning
---
 src/test/test_entrynodes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 2aef5cbbf..43cc39488 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -1729,6 +1729,7 @@ test_entry_guard_select_for_circuit_no_confirmed(void 
*arg)
   /* Simpler cases: no gaurds are confirmed yet. */
   (void)arg;
   guard_selection_t *gs = guard_selection_new("default", GS_TYPE_NORMAL);
+  entry_guard_restriction_t *rst = NULL;
 
   /* simple starting configuration */
   entry_guards_update_primary(gs);
@@ -1810,7 +1811,6 @@ test_entry_guard_select_for_circuit_no_confirmed(void 
*arg)
   tt_ptr_op(g2, OP_EQ, g);
 
   /* But if we impose a restriction, we don't get the same guard */
-  entry_guard_restriction_t *rst;
   rst = guard_create_exit_restriction((uint8_t*)g->identity);
   g2 = select_entry_guard_for_circuit(gs, GUARD_USAGE_TRAFFIC, rst, );
   tt_ptr_op(g2, OP_NE, g);



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


[tor-commits] [tor/release-0.3.2] Intoduce unittest for skipping outdated dirservers.

2017-11-17 Thread nickm
commit 7e52947d571c8038bfcd82e14f373f3c00924cbe
Author: George Kadianakis 
Date:   Mon Nov 6 15:45:42 2017 +0200

Intoduce unittest for skipping outdated dirservers.
---
 src/or/directory.c |  42 -
 src/or/directory.h |  42 +
 src/test/test_entrynodes.c | 146 +++--
 3 files changed, 171 insertions(+), 59 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 43a03a2fd..66bdef236 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1012,48 +1012,6 @@ directory_must_use_begindir(const or_options_t *options)
   return !public_server_mode(options);
 }
 
-struct directory_request_t {
-  /**
-   * These fields specify which directory we're contacting.  Routerstatus,
-   * if present, overrides the other fields.
-   *
-   * @{ */
-  tor_addr_port_t or_addr_port;
-  tor_addr_port_t dir_addr_port;
-  char digest[DIGEST_LEN];
-
-  const routerstatus_t *routerstatus;
-  /** @} */
-  /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
-   * kind of operation we'll be doing (upload/download), and of what kind
-   * of document. */
-  uint8_t dir_purpose;
-  /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
-   * and extrainfo docs.  */
-  uint8_t router_purpose;
-  /** Enum: determines whether to anonymize, and whether to use dirport or
-   * orport. */
-  dir_indirection_t indirection;
-  /** Alias to the variable part of the URL for this request */
-  const char *resource;
-  /** Alias to the payload to upload (if any) */
-  const char *payload;
-  /** Number of bytes to upload from payload */
-  size_t payload_len;
-  /** Value to send in an if-modified-since header, or 0 for none. */
-  time_t if_modified_since;
-  /** Hidden-service-specific information v2. */
-  const rend_data_t *rend_query;
-  /** Extra headers to append to the request */
-  config_line_t *additional_headers;
-  /** Hidden-service-specific information for v3+. */
-  const hs_ident_dir_conn_t *hs_ident;
-  /** Used internally to directory.c: gets informed when the attempt to
-   * connect to the directory succeeds or fails, if that attempt bears on the
-   * directory's usability as a directory guard. */
-  circuit_guard_state_t *guard_state;
-};
-
 /** Evaluate the situation and decide if we should use an encrypted
  * "begindir-style" connection for this directory request.
  * 0) If there is no DirPort, yes.
diff --git a/src/or/directory.h b/src/or/directory.h
index b57b7b544..5e6a91d3e 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -183,6 +183,48 @@ typedef struct response_handler_args_t {
   const char *headers;
 } response_handler_args_t;
 
+struct directory_request_t {
+  /**
+   * These fields specify which directory we're contacting.  Routerstatus,
+   * if present, overrides the other fields.
+   *
+   * @{ */
+  tor_addr_port_t or_addr_port;
+  tor_addr_port_t dir_addr_port;
+  char digest[DIGEST_LEN];
+
+  const routerstatus_t *routerstatus;
+  /** @} */
+  /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
+   * kind of operation we'll be doing (upload/download), and of what kind
+   * of document. */
+  uint8_t dir_purpose;
+  /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
+   * and extrainfo docs.  */
+  uint8_t router_purpose;
+  /** Enum: determines whether to anonymize, and whether to use dirport or
+   * orport. */
+  dir_indirection_t indirection;
+  /** Alias to the variable part of the URL for this request */
+  const char *resource;
+  /** Alias to the payload to upload (if any) */
+  const char *payload;
+  /** Number of bytes to upload from payload */
+  size_t payload_len;
+  /** Value to send in an if-modified-since header, or 0 for none. */
+  time_t if_modified_since;
+  /** Hidden-service-specific information v2. */
+  const rend_data_t *rend_query;
+  /** Extra headers to append to the request */
+  config_line_t *additional_headers;
+  /** Hidden-service-specific information for v3+. */
+  const hs_ident_dir_conn_t *hs_ident;
+  /** Used internally to directory.c: gets informed when the attempt to
+   * connect to the directory succeeds or fails, if that attempt bears on the
+   * directory's usability as a directory guard. */
+  struct circuit_guard_state_t *guard_state;
+};
+
 struct get_handler_args_t;
 STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn,
const struct get_handler_args_t *args);
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index f9d981953..2aef5cbbf 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -7,6 +7,7 @@
 #define STATEFILE_PRIVATE
 #define ENTRYNODES_PRIVATE
 #define ROUTERLIST_PRIVATE
+#define DIRECTORY_PRIVATE
 
 #include "or.h"
 #include "test.h"
@@ -15,6 +16,7 @@
 #include "circuitlist.h"
 #include "config.h"
 #include "confparse.h"
+#include "directory.h"

[tor-commits] [tor/release-0.3.2] Make should_set_md_dirserver_restriction() look at num filtered guards

2017-11-17 Thread nickm
commit 96b69942a54e69e9f4d8aeb07bf9a5fb98892900
Author: Nick Mathewson 
Date:   Thu Nov 16 08:49:24 2017 -0500

Make should_set_md_dirserver_restriction() look at num filtered guards

This seems closer to what the code intended.
---
 src/or/entrynodes.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 1cc24d8d6..dc02557b5 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1472,9 +1472,10 @@ guard_create_exit_restriction(const uint8_t *exit_id)
   return rst;
 }
 
-/** If we have less than these many configured bridges, don't set dirserver
- *  restrictions because we might blacklist all of them. */
-#define TOO_FEW_BRIDGES_FOR_RESTRICTION 10
+/** If we have fewer than this many possible guards, don't set
+ * MD-availability-based restrictions: we might blacklist all of
+ * them. */
+#define MIN_GUARDS_FOR_MD_RESTRICTION 10
 
 /** Return true if we should set md dirserver restrictions. We might not want
  *  to set those if our network is too restricted, since we don't want to
@@ -1484,20 +1485,17 @@ should_set_md_dirserver_restriction(void)
 {
   const guard_selection_t *gs = get_guard_selection_info();
 
-  /* Don't set a restriction if we are on a restricted guard selection */
-  if (gs->type == GS_TYPE_RESTRICTED) {
-return 0;
-  }
-
-  /* Don't set restriction if we are using bridges and have too few of those */
-  if (gs->type == GS_TYPE_BRIDGE && gs->sampled_entry_guards) {
-int num_sampled_guards = smartlist_len(gs->sampled_entry_guards);
-if (num_sampled_guards < TOO_FEW_BRIDGES_FOR_RESTRICTION) {
-  return 0;
+  /* Compute the number of filtered guards */
+  int n_filtered_guards = 0;
+  SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
+if (guard->is_filtered_guard) {
+  ++n_filtered_guards;
 }
-  }
+  } SMARTLIST_FOREACH_END(guard);
 
-  return 1;
+  /* Do we have enough filtered guards that we feel okay about blacklisting
+   * some for MD restriction? */
+  return (n_filtered_guards >= MIN_GUARDS_FOR_MD_RESTRICTION);
 }
 
 /** Allocate and return an outdated md guard restriction. Return NULL if no
@@ -1508,6 +1506,8 @@ guard_create_dirserver_md_restriction(void)
   entry_guard_restriction_t *rst = NULL;
 
   if (!should_set_md_dirserver_restriction()) {
+log_debug(LD_GUARD, "Not setting md restriction: too few "
+  "filtered guards.");
 return NULL;
   }
 



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


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

2017-11-17 Thread nickm
commit 2cee26b16447c14ffc16502ecc28b48060cd
Merge: b98614f1a 96b69942a
Author: Nick Mathewson 
Date:   Fri Nov 17 09:56:53 2017 -0500

Merge branch 'bug23817_031' into maint-0.3.2

 changes/bug23817   |   3 ++
 src/or/directory.c |  40 ++--
 src/or/directory.h |   2 +
 src/or/entrynodes.c| 121 -
 src/or/entrynodes.h|  33 ++
 src/or/microdesc.c | 101 +
 src/or/microdesc.h |   4 ++
 src/or/networkstatus.c |   3 ++
 8 files changed, 272 insertions(+), 35 deletions(-)

diff --cc src/or/directory.h
index d26d83537,571c30a0f..b57b7b544
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@@ -191,8 -166,10 +191,10 @@@ STATIC char *accept_encoding_header(voi
  STATIC int allowed_anonymous_connection_compression_method(compress_method_t);
  STATIC void warn_disallowed_anonymous_compression_method(compress_method_t);
  
 -struct response_handler_args_t;
 -
 +STATIC int handle_response_fetch_hsdesc_v3(dir_connection_t *conn,
 +  const response_handler_args_t 
*args);
+ STATIC int handle_response_fetch_microdesc(dir_connection_t *conn,
 - const struct response_handler_args_t *args);
++ const response_handler_args_t *args);
  
  #endif /* defined(DIRECTORY_PRIVATE) */
  
diff --cc src/or/entrynodes.h
index 9e1e72993,29de627de..49bb3e55c
--- a/src/or/entrynodes.h
+++ b/src/or/entrynodes.h
@@@ -550,6 -557,16 +557,14 @@@ STATIC unsigned entry_guards_note_guard
  unsigned old_state);
  STATIC int entry_guard_has_higher_priority(entry_guard_t *a, entry_guard_t 
*b);
  STATIC char *getinfo_helper_format_single_entry_guard(const entry_guard_t *e);
+ 
 -STATIC entry_guard_restriction_t *
 -guard_create_exit_restriction(const uint8_t *exit_id);
++STATIC entry_guard_restriction_t *guard_create_exit_restriction(
++  const uint8_t *exit_id);
+ 
 -STATIC entry_guard_restriction_t *
 -guard_create_dirserver_md_restriction(void);
++STATIC entry_guard_restriction_t *guard_create_dirserver_md_restriction(void);
+ 
 -STATIC void
 -entry_guard_restriction_free(entry_guard_restriction_t *rst);
++STATIC void entry_guard_restriction_free(entry_guard_restriction_t *rst);
+ 
  #endif /* defined(ENTRYNODES_PRIVATE) */
  
  void remove_all_entry_guards_for_guard_selection(guard_selection_t *gs);
diff --cc src/or/networkstatus.c
index 2660e6a32,36e62020e..f31529733
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@@ -2009,11 -2037,13 +2009,14 @@@ networkstatus_set_current_consensus(con
   "consensus network status document (%s UTC).  Tor needs an "
   "accurate clock to work correctly. Please check your time and "
   "date settings!", dbuf, tbuf);
 -control_event_general_status(LOG_WARN,
 -"CLOCK_SKEW MIN_SKEW=%ld SOURCE=CONSENSUS", delta);
 +tor_asprintf(, "%s flavor consensus", flavor);
 +clock_skew_warning(NULL, delta, 1, LD_GENERAL, flavormsg, "CONSENSUS");
 +tor_free(flavormsg);
}
  
+   /* We got a new consesus. Reset our md fetch fail cache */
+   microdesc_reset_outdated_dirservers_list();
+ 
router_dir_info_changed();
  
result = 0;



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


[tor-commits] [tor/master] Make should_set_md_dirserver_restriction() look at num filtered guards

2017-11-17 Thread nickm
commit 96b69942a54e69e9f4d8aeb07bf9a5fb98892900
Author: Nick Mathewson 
Date:   Thu Nov 16 08:49:24 2017 -0500

Make should_set_md_dirserver_restriction() look at num filtered guards

This seems closer to what the code intended.
---
 src/or/entrynodes.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 1cc24d8d6..dc02557b5 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1472,9 +1472,10 @@ guard_create_exit_restriction(const uint8_t *exit_id)
   return rst;
 }
 
-/** If we have less than these many configured bridges, don't set dirserver
- *  restrictions because we might blacklist all of them. */
-#define TOO_FEW_BRIDGES_FOR_RESTRICTION 10
+/** If we have fewer than this many possible guards, don't set
+ * MD-availability-based restrictions: we might blacklist all of
+ * them. */
+#define MIN_GUARDS_FOR_MD_RESTRICTION 10
 
 /** Return true if we should set md dirserver restrictions. We might not want
  *  to set those if our network is too restricted, since we don't want to
@@ -1484,20 +1485,17 @@ should_set_md_dirserver_restriction(void)
 {
   const guard_selection_t *gs = get_guard_selection_info();
 
-  /* Don't set a restriction if we are on a restricted guard selection */
-  if (gs->type == GS_TYPE_RESTRICTED) {
-return 0;
-  }
-
-  /* Don't set restriction if we are using bridges and have too few of those */
-  if (gs->type == GS_TYPE_BRIDGE && gs->sampled_entry_guards) {
-int num_sampled_guards = smartlist_len(gs->sampled_entry_guards);
-if (num_sampled_guards < TOO_FEW_BRIDGES_FOR_RESTRICTION) {
-  return 0;
+  /* Compute the number of filtered guards */
+  int n_filtered_guards = 0;
+  SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
+if (guard->is_filtered_guard) {
+  ++n_filtered_guards;
 }
-  }
+  } SMARTLIST_FOREACH_END(guard);
 
-  return 1;
+  /* Do we have enough filtered guards that we feel okay about blacklisting
+   * some for MD restriction? */
+  return (n_filtered_guards >= MIN_GUARDS_FOR_MD_RESTRICTION);
 }
 
 /** Allocate and return an outdated md guard restriction. Return NULL if no
@@ -1508,6 +1506,8 @@ guard_create_dirserver_md_restriction(void)
   entry_guard_restriction_t *rst = NULL;
 
   if (!should_set_md_dirserver_restriction()) {
+log_debug(LD_GUARD, "Not setting md restriction: too few "
+  "filtered guards.");
 return NULL;
   }
 



___
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 'bug23817_tests_032' into maint-0.3.2

2017-11-17 Thread nickm
commit 9c17a6d28b4acf044f408a0c7211e051e238c797
Merge: 9fbc835f1 3a5ca47d8
Author: Nick Mathewson 
Date:   Fri Nov 17 09:58:12 2017 -0500

Merge branch 'bug23817_tests_032' into maint-0.3.2

 src/or/directory.c |  42 -
 src/or/directory.h |  42 +
 src/test/test_entrynodes.c | 146 +++--
 3 files changed, 171 insertions(+), 59 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.3.2'

2017-11-17 Thread nickm
commit fcdec00685608c85161116bdb7408f33094ea3fa
Merge: 94dce246e 9c17a6d28
Author: Nick Mathewson 
Date:   Fri Nov 17 09:59:26 2017 -0500

Merge branch 'maint-0.3.2'

 changes/bug23817   |   3 +
 src/or/directory.c |  82 -
 src/or/directory.h |  44 ++
 src/or/entrynodes.c| 121 +
 src/or/entrynodes.h|  33 +++---
 src/or/microdesc.c | 101 +++
 src/or/microdesc.h |   4 ++
 src/or/networkstatus.c |   3 +
 src/or/scheduler.c |   7 ++-
 src/test/test_entrynodes.c | 146 +++--
 10 files changed, 447 insertions(+), 97 deletions(-)

diff --cc src/or/directory.h
index 904bdfae4,5e6a91d3e..3aef60071
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@@ -193,10 -235,9 +235,12 @@@ STATIC void warn_disallowed_anonymous_c
  
  STATIC int handle_response_fetch_hsdesc_v3(dir_connection_t *conn,
const response_handler_args_t 
*args);
+ STATIC int handle_response_fetch_microdesc(dir_connection_t *conn,
+  const response_handler_args_t *args);
  
 +STATIC int handle_response_fetch_consensus(dir_connection_t *conn,
 + const response_handler_args_t *args);
 +
  #endif /* defined(DIRECTORY_PRIVATE) */
  
  #ifdef TOR_UNIT_TESTS

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


[tor-commits] [tor/master] Intoduce unittest for skipping outdated dirservers.

2017-11-17 Thread nickm
commit 7e52947d571c8038bfcd82e14f373f3c00924cbe
Author: George Kadianakis 
Date:   Mon Nov 6 15:45:42 2017 +0200

Intoduce unittest for skipping outdated dirservers.
---
 src/or/directory.c |  42 -
 src/or/directory.h |  42 +
 src/test/test_entrynodes.c | 146 +++--
 3 files changed, 171 insertions(+), 59 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 43a03a2fd..66bdef236 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1012,48 +1012,6 @@ directory_must_use_begindir(const or_options_t *options)
   return !public_server_mode(options);
 }
 
-struct directory_request_t {
-  /**
-   * These fields specify which directory we're contacting.  Routerstatus,
-   * if present, overrides the other fields.
-   *
-   * @{ */
-  tor_addr_port_t or_addr_port;
-  tor_addr_port_t dir_addr_port;
-  char digest[DIGEST_LEN];
-
-  const routerstatus_t *routerstatus;
-  /** @} */
-  /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
-   * kind of operation we'll be doing (upload/download), and of what kind
-   * of document. */
-  uint8_t dir_purpose;
-  /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
-   * and extrainfo docs.  */
-  uint8_t router_purpose;
-  /** Enum: determines whether to anonymize, and whether to use dirport or
-   * orport. */
-  dir_indirection_t indirection;
-  /** Alias to the variable part of the URL for this request */
-  const char *resource;
-  /** Alias to the payload to upload (if any) */
-  const char *payload;
-  /** Number of bytes to upload from payload */
-  size_t payload_len;
-  /** Value to send in an if-modified-since header, or 0 for none. */
-  time_t if_modified_since;
-  /** Hidden-service-specific information v2. */
-  const rend_data_t *rend_query;
-  /** Extra headers to append to the request */
-  config_line_t *additional_headers;
-  /** Hidden-service-specific information for v3+. */
-  const hs_ident_dir_conn_t *hs_ident;
-  /** Used internally to directory.c: gets informed when the attempt to
-   * connect to the directory succeeds or fails, if that attempt bears on the
-   * directory's usability as a directory guard. */
-  circuit_guard_state_t *guard_state;
-};
-
 /** Evaluate the situation and decide if we should use an encrypted
  * "begindir-style" connection for this directory request.
  * 0) If there is no DirPort, yes.
diff --git a/src/or/directory.h b/src/or/directory.h
index b57b7b544..5e6a91d3e 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -183,6 +183,48 @@ typedef struct response_handler_args_t {
   const char *headers;
 } response_handler_args_t;
 
+struct directory_request_t {
+  /**
+   * These fields specify which directory we're contacting.  Routerstatus,
+   * if present, overrides the other fields.
+   *
+   * @{ */
+  tor_addr_port_t or_addr_port;
+  tor_addr_port_t dir_addr_port;
+  char digest[DIGEST_LEN];
+
+  const routerstatus_t *routerstatus;
+  /** @} */
+  /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
+   * kind of operation we'll be doing (upload/download), and of what kind
+   * of document. */
+  uint8_t dir_purpose;
+  /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
+   * and extrainfo docs.  */
+  uint8_t router_purpose;
+  /** Enum: determines whether to anonymize, and whether to use dirport or
+   * orport. */
+  dir_indirection_t indirection;
+  /** Alias to the variable part of the URL for this request */
+  const char *resource;
+  /** Alias to the payload to upload (if any) */
+  const char *payload;
+  /** Number of bytes to upload from payload */
+  size_t payload_len;
+  /** Value to send in an if-modified-since header, or 0 for none. */
+  time_t if_modified_since;
+  /** Hidden-service-specific information v2. */
+  const rend_data_t *rend_query;
+  /** Extra headers to append to the request */
+  config_line_t *additional_headers;
+  /** Hidden-service-specific information for v3+. */
+  const hs_ident_dir_conn_t *hs_ident;
+  /** Used internally to directory.c: gets informed when the attempt to
+   * connect to the directory succeeds or fails, if that attempt bears on the
+   * directory's usability as a directory guard. */
+  struct circuit_guard_state_t *guard_state;
+};
+
 struct get_handler_args_t;
 STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn,
const struct get_handler_args_t *args);
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index f9d981953..2aef5cbbf 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -7,6 +7,7 @@
 #define STATEFILE_PRIVATE
 #define ENTRYNODES_PRIVATE
 #define ROUTERLIST_PRIVATE
+#define DIRECTORY_PRIVATE
 
 #include "or.h"
 #include "test.h"
@@ -15,6 +16,7 @@
 #include "circuitlist.h"
 #include "config.h"
 #include "confparse.h"
+#include "directory.h"

[tor-commits] [tor/master] Fix a wide comment

2017-11-17 Thread nickm
commit 9fbc835f10e9fba6a9b0c6643a41aee9c8aa05c2
Author: Nick Mathewson 
Date:   Fri Nov 17 09:57:15 2017 -0500

Fix a wide comment
---
 src/or/scheduler.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index dabac386d..cbf51447b 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -258,9 +258,10 @@ select_scheduler(void)
   /* We should only log this once in most cases. If it was the kernel
* losing support for kist that caused scheduler_can_use_kist() to
* return false, then this flag makes sure we only log this message
-   * once. If it was the consensus that switched from "yes use kist" to
-   * "no don't use kist", then we still set the flag so we log once, 
but
-   * we unset the flag elsewhere if we ever can_use_kist() again.
+   * once. If it was the consensus that switched from "yes use kist"
+   * to "no don't use kist", then we still set the flag so we log
+   * once, but we unset the flag elsewhere if we ever can_use_kist()
+   * again.
*/
   have_logged_kist_suddenly_disabled = 1;
   log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "



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


[tor-commits] [tor/master] Introduce new guard restriction and use it to skip outdated dirs.

2017-11-17 Thread nickm
commit f61e3090fb2975ad8c2a5e138b87c62428c5f46b
Author: George Kadianakis 
Date:   Mon Nov 6 19:38:47 2017 +0200

Introduce new guard restriction and use it to skip outdated dirs.
---
 changes/bug23817|  3 ++
 src/or/directory.c  |  4 +--
 src/or/entrynodes.c | 95 ++---
 src/or/entrynodes.h | 37 +++--
 4 files changed, 116 insertions(+), 23 deletions(-)

diff --git a/changes/bug23817 b/changes/bug23817
new file mode 100644
index 0..474094279
--- /dev/null
+++ b/changes/bug23817
@@ -0,0 +1,3 @@
+  o Minor bugfixes (descriptors):
+- Don't try fetching microdescriptors from relays that have failed to
+  deliver them in the past. Fixes bug 23817; bugfix on 0.3.0.1-alpha.
diff --git a/src/or/directory.c b/src/or/directory.c
index 129309ae4..aec8ef5bf 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -464,7 +464,7 @@ directory_pick_generic_dirserver(dirinfo_type_t type, int 
pds_flags,
 log_warn(LD_BUG, "Called when we have UseBridges set.");
 
   if (should_use_directory_guards(options)) {
-const node_t *node = guards_choose_dirguard(guard_state_out);
+const node_t *node = guards_choose_dirguard(dir_purpose, guard_state_out);
 if (node)
   rs = node->rs;
   } else {
@@ -598,7 +598,7 @@ directory_get_from_dirserver,(
* sort of dir fetch we'll be doing, so it won't return a bridge
* that can't answer our question.
*/
-  const node_t *node = guards_choose_dirguard(_state);
+  const node_t *node = guards_choose_dirguard(dir_purpose, _state);
   if (node && node->ri) {
 /* every bridge has a routerinfo. */
 routerinfo_t *ri = node->ri;
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 26f53cbfe..f2ca7aac2 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1460,6 +1460,70 @@ guard_in_node_family(const entry_guard_t *guard, const 
node_t *node)
   }
 }
 
+/* Allocate and return a new exit guard restriction (where exit_id is of
+ * size DIGEST_LEN) */
+STATIC entry_guard_restriction_t *
+guard_create_exit_restriction(const uint8_t *exit_id)
+{
+  entry_guard_restriction_t *rst = NULL;
+  rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
+  rst->type = RST_EXIT_NODE;
+  memcpy(rst->exclude_id, exit_id, DIGEST_LEN);
+  return rst;
+}
+
+/** Allocate and return an outdated md guard restriction. */
+STATIC entry_guard_restriction_t *
+guard_create_dirserver_md_restriction(void)
+{
+  entry_guard_restriction_t *rst = NULL;
+
+  rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
+  rst->type = RST_OUTDATED_MD_DIRSERVER;
+
+  return rst;
+}
+
+/* Return True if guard obeys the exit restriction rst. */
+static int
+guard_obeys_exit_restriction(const entry_guard_t *guard,
+ const entry_guard_restriction_t *rst)
+{
+  tor_assert(rst->type == RST_EXIT_NODE);
+
+  // Exclude the exit ID and all of its family.
+  const node_t *node = node_get_by_id((const char*)rst->exclude_id);
+  if (node && guard_in_node_family(guard, node))
+return 0;
+
+  return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN);
+}
+
+/** Return True if guard should be used as a dirserver for fetching
+ *  microdescriptors. */
+static int
+guard_obeys_md_dirserver_restriction(const entry_guard_t *guard)
+{
+  /* Don't enforce dirserver restrictions for bridges since we might not have
+   * many of those. Be willing to try them over and over again for now. */
+  /* XXX: Improvement might be possible here */
+  if (guard->bridge_addr) {
+return 1;
+  }
+
+  /* If this guard is an outdated dirserver, don't use it. */
+  if (microdesc_relay_is_outdated_dirserver(guard->identity)) {
+log_info(LD_GENERAL, "Skipping %s dirserver: outdated",
+ hex_str(guard->identity, DIGEST_LEN));
+return 0;
+  }
+
+  log_debug(LD_GENERAL, "%s dirserver obeys md restrictions",
+hex_str(guard->identity, DIGEST_LEN));
+
+  return 1;
+}
+
 /**
  * Return true iff guard obeys the restrictions defined in rst.
  * (If rst is NULL, there are no restrictions.)
@@ -1472,13 +1536,14 @@ entry_guard_obeys_restriction(const entry_guard_t 
*guard,
   if (! rst)
 return 1; // No restriction?  No problem.
 
-  // Only one kind of restriction exists right now: excluding an exit
-  // ID and all of its family.
-  const node_t *node = node_get_by_id((const char*)rst->exclude_id);
-  if (node && guard_in_node_family(guard, node))
-return 0;
+  if (rst->type == RST_EXIT_NODE) {
+return guard_obeys_exit_restriction(guard, rst);
+  } else if (rst->type == RST_OUTDATED_MD_DIRSERVER) {
+return guard_obeys_md_dirserver_restriction(guard);
+  }
 
-  return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN);
+  tor_assert_nonfatal_unreached();
+  return 0;
 }
 
 /**
@@ -2105,7 +2170,7 @@ entry_guard_has_higher_priority(entry_guard_t *a, 
entry_guard_t *b)
 }
 
 /** Release all storage held 

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

2017-11-17 Thread nickm
commit 9c17a6d28b4acf044f408a0c7211e051e238c797
Merge: 9fbc835f1 3a5ca47d8
Author: Nick Mathewson 
Date:   Fri Nov 17 09:58:12 2017 -0500

Merge branch 'bug23817_tests_032' into maint-0.3.2

 src/or/directory.c |  42 -
 src/or/directory.h |  42 +
 src/test/test_entrynodes.c | 146 +++--
 3 files changed, 171 insertions(+), 59 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.3.2] Introduce cache for outdated microdesc dirservers.

2017-11-17 Thread nickm
commit 7fc64f02a3057405f9e75d70848afd2e9b95da05
Author: George Kadianakis 
Date:   Mon Nov 6 14:48:22 2017 +0200

Introduce cache for outdated microdesc dirservers.

We gonna use this cache to avoid dirservers without outdated md info.
---
 src/or/directory.c |  36 +++---
 src/or/directory.h |   7 +++-
 src/or/microdesc.c | 101 +
 src/or/microdesc.h |   6 ++-
 src/or/networkstatus.c |   3 ++
 5 files changed, 138 insertions(+), 15 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 9494cf02b..129309ae4 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -117,7 +117,8 @@ static void dir_routerdesc_download_failed(smartlist_t 
*failed,
int was_extrainfo,
int was_descriptor_digests);
 static void dir_microdesc_download_failed(smartlist_t *failed,
-  int status_code);
+  int status_code,
+  const char *dir_id);
 static int client_likes_consensus(const struct consensus_cache_entry_t *ent,
   const char *want_url);
 
@@ -2178,8 +2179,6 @@ static int 
handle_response_fetch_detached_signatures(dir_connection_t *,
  const response_handler_args_t *);
 static int handle_response_fetch_desc(dir_connection_t *,
  const response_handler_args_t *);
-static int handle_response_fetch_microdesc(dir_connection_t *,
-   const response_handler_args_t *);
 static int handle_response_upload_dir(dir_connection_t *,
   const response_handler_args_t *);
 static int handle_response_upload_vote(dir_connection_t *,
@@ -2839,7 +2838,7 @@ handle_response_fetch_desc(dir_connection_t *conn,
  * Handler function: processes a response to a request for a group of
  * microdescriptors
  **/
-static int
+STATIC int
 handle_response_fetch_microdesc(dir_connection_t *conn,
 const response_handler_args_t *args)
 {
@@ -2856,6 +2855,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
conn->base_.port);
   tor_assert(conn->requested_resource &&
  !strcmpstart(conn->requested_resource, "d/"));
+  tor_assert_nonfatal(!tor_mem_is_zero(conn->identity_digest, DIGEST_LEN));
   which = smartlist_new();
   dir_split_resource_into_fingerprints(conn->requested_resource+2,
which, NULL,
@@ -2866,7 +2866,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
  "soon.",
  status_code, escaped(reason), conn->base_.address,
  (int)conn->base_.port, conn->requested_resource);
-dir_microdesc_download_failed(which, status_code);
+dir_microdesc_download_failed(which, status_code, conn->identity_digest);
 SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
 smartlist_free(which);
 return 0;
@@ -2878,7 +2878,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
   now, which);
 if (smartlist_len(which)) {
   /* Mark remaining ones as failed. */
-  dir_microdesc_download_failed(which, status_code);
+  dir_microdesc_download_failed(which, status_code, conn->identity_digest);
 }
 if (mds && smartlist_len(mds)) {
   control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
@@ -5546,13 +5546,14 @@ dir_routerdesc_download_failed(smartlist_t *failed, int 
status_code,
* every 10 or 60 seconds (FOO_DESCRIPTOR_RETRY_INTERVAL) in main.c. */
 }
 
-/** Called when a connection to download microdescriptors has failed in whole
- * or in part. failed is a list of every microdesc digest we didn't
- * get. status_code is the http status code we received. Reschedule the
- * microdesc downloads as appropriate. */
+/** Called when a connection to download microdescriptors from relay with
+ * dir_id has failed in whole or in part. failed is a list
+ * of every microdesc digest we didn't get. status_code is the http
+ * status code we received. Reschedule the microdesc downloads as
+ * appropriate. */
 static void
 dir_microdesc_download_failed(smartlist_t *failed,
-  int status_code)
+  int status_code, const char *dir_id)
 {
   networkstatus_t *consensus
 = networkstatus_get_latest_consensus_by_flavor(FLAV_MICRODESC);
@@ -5563,17 +5564,26 @@ dir_microdesc_download_failed(smartlist_t *failed,
 
   if (! consensus)
 return;
+
+  /* We failed to fetch a microdescriptor from 'dir_id', note it down
+   * so that we don't try the same relay next time... */
+  microdesc_note_outdated_dirserver(dir_id);
+
   SMARTLIST_FOREACH_BEGIN(failed, const char *, d) {
 

[tor-commits] [tor/release-0.3.2] Skip dirserver restrictions in small networks.

2017-11-17 Thread nickm
commit c400ffc2e88dab54b070a856717fb0ee6fe096cb
Author: George Kadianakis 
Date:   Mon Nov 13 22:26:22 2017 +0200

Skip dirserver restrictions in small networks.
---
 src/or/entrynodes.c | 42 ++
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index f2ca7aac2..1cc24d8d6 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1472,12 +1472,45 @@ guard_create_exit_restriction(const uint8_t *exit_id)
   return rst;
 }
 
-/** Allocate and return an outdated md guard restriction. */
+/** If we have less than these many configured bridges, don't set dirserver
+ *  restrictions because we might blacklist all of them. */
+#define TOO_FEW_BRIDGES_FOR_RESTRICTION 10
+
+/** Return true if we should set md dirserver restrictions. We might not want
+ *  to set those if our network is too restricted, since we don't want to
+ *  blacklist all our nodes. */
+static int
+should_set_md_dirserver_restriction(void)
+{
+  const guard_selection_t *gs = get_guard_selection_info();
+
+  /* Don't set a restriction if we are on a restricted guard selection */
+  if (gs->type == GS_TYPE_RESTRICTED) {
+return 0;
+  }
+
+  /* Don't set restriction if we are using bridges and have too few of those */
+  if (gs->type == GS_TYPE_BRIDGE && gs->sampled_entry_guards) {
+int num_sampled_guards = smartlist_len(gs->sampled_entry_guards);
+if (num_sampled_guards < TOO_FEW_BRIDGES_FOR_RESTRICTION) {
+  return 0;
+}
+  }
+
+  return 1;
+}
+
+/** Allocate and return an outdated md guard restriction. Return NULL if no
+ *  such restriction is needed. */
 STATIC entry_guard_restriction_t *
 guard_create_dirserver_md_restriction(void)
 {
   entry_guard_restriction_t *rst = NULL;
 
+  if (!should_set_md_dirserver_restriction()) {
+return NULL;
+  }
+
   rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
   rst->type = RST_OUTDATED_MD_DIRSERVER;
 
@@ -1504,13 +1537,6 @@ guard_obeys_exit_restriction(const entry_guard_t *guard,
 static int
 guard_obeys_md_dirserver_restriction(const entry_guard_t *guard)
 {
-  /* Don't enforce dirserver restrictions for bridges since we might not have
-   * many of those. Be willing to try them over and over again for now. */
-  /* XXX: Improvement might be possible here */
-  if (guard->bridge_addr) {
-return 1;
-  }
-
   /* If this guard is an outdated dirserver, don't use it. */
   if (microdesc_relay_is_outdated_dirserver(guard->identity)) {
 log_info(LD_GENERAL, "Skipping %s dirserver: outdated",



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


[tor-commits] [tor/release-0.3.2] Introduce new guard restriction and use it to skip outdated dirs.

2017-11-17 Thread nickm
commit f61e3090fb2975ad8c2a5e138b87c62428c5f46b
Author: George Kadianakis 
Date:   Mon Nov 6 19:38:47 2017 +0200

Introduce new guard restriction and use it to skip outdated dirs.
---
 changes/bug23817|  3 ++
 src/or/directory.c  |  4 +--
 src/or/entrynodes.c | 95 ++---
 src/or/entrynodes.h | 37 +++--
 4 files changed, 116 insertions(+), 23 deletions(-)

diff --git a/changes/bug23817 b/changes/bug23817
new file mode 100644
index 0..474094279
--- /dev/null
+++ b/changes/bug23817
@@ -0,0 +1,3 @@
+  o Minor bugfixes (descriptors):
+- Don't try fetching microdescriptors from relays that have failed to
+  deliver them in the past. Fixes bug 23817; bugfix on 0.3.0.1-alpha.
diff --git a/src/or/directory.c b/src/or/directory.c
index 129309ae4..aec8ef5bf 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -464,7 +464,7 @@ directory_pick_generic_dirserver(dirinfo_type_t type, int 
pds_flags,
 log_warn(LD_BUG, "Called when we have UseBridges set.");
 
   if (should_use_directory_guards(options)) {
-const node_t *node = guards_choose_dirguard(guard_state_out);
+const node_t *node = guards_choose_dirguard(dir_purpose, guard_state_out);
 if (node)
   rs = node->rs;
   } else {
@@ -598,7 +598,7 @@ directory_get_from_dirserver,(
* sort of dir fetch we'll be doing, so it won't return a bridge
* that can't answer our question.
*/
-  const node_t *node = guards_choose_dirguard(_state);
+  const node_t *node = guards_choose_dirguard(dir_purpose, _state);
   if (node && node->ri) {
 /* every bridge has a routerinfo. */
 routerinfo_t *ri = node->ri;
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 26f53cbfe..f2ca7aac2 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1460,6 +1460,70 @@ guard_in_node_family(const entry_guard_t *guard, const 
node_t *node)
   }
 }
 
+/* Allocate and return a new exit guard restriction (where exit_id is of
+ * size DIGEST_LEN) */
+STATIC entry_guard_restriction_t *
+guard_create_exit_restriction(const uint8_t *exit_id)
+{
+  entry_guard_restriction_t *rst = NULL;
+  rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
+  rst->type = RST_EXIT_NODE;
+  memcpy(rst->exclude_id, exit_id, DIGEST_LEN);
+  return rst;
+}
+
+/** Allocate and return an outdated md guard restriction. */
+STATIC entry_guard_restriction_t *
+guard_create_dirserver_md_restriction(void)
+{
+  entry_guard_restriction_t *rst = NULL;
+
+  rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
+  rst->type = RST_OUTDATED_MD_DIRSERVER;
+
+  return rst;
+}
+
+/* Return True if guard obeys the exit restriction rst. */
+static int
+guard_obeys_exit_restriction(const entry_guard_t *guard,
+ const entry_guard_restriction_t *rst)
+{
+  tor_assert(rst->type == RST_EXIT_NODE);
+
+  // Exclude the exit ID and all of its family.
+  const node_t *node = node_get_by_id((const char*)rst->exclude_id);
+  if (node && guard_in_node_family(guard, node))
+return 0;
+
+  return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN);
+}
+
+/** Return True if guard should be used as a dirserver for fetching
+ *  microdescriptors. */
+static int
+guard_obeys_md_dirserver_restriction(const entry_guard_t *guard)
+{
+  /* Don't enforce dirserver restrictions for bridges since we might not have
+   * many of those. Be willing to try them over and over again for now. */
+  /* XXX: Improvement might be possible here */
+  if (guard->bridge_addr) {
+return 1;
+  }
+
+  /* If this guard is an outdated dirserver, don't use it. */
+  if (microdesc_relay_is_outdated_dirserver(guard->identity)) {
+log_info(LD_GENERAL, "Skipping %s dirserver: outdated",
+ hex_str(guard->identity, DIGEST_LEN));
+return 0;
+  }
+
+  log_debug(LD_GENERAL, "%s dirserver obeys md restrictions",
+hex_str(guard->identity, DIGEST_LEN));
+
+  return 1;
+}
+
 /**
  * Return true iff guard obeys the restrictions defined in rst.
  * (If rst is NULL, there are no restrictions.)
@@ -1472,13 +1536,14 @@ entry_guard_obeys_restriction(const entry_guard_t 
*guard,
   if (! rst)
 return 1; // No restriction?  No problem.
 
-  // Only one kind of restriction exists right now: excluding an exit
-  // ID and all of its family.
-  const node_t *node = node_get_by_id((const char*)rst->exclude_id);
-  if (node && guard_in_node_family(guard, node))
-return 0;
+  if (rst->type == RST_EXIT_NODE) {
+return guard_obeys_exit_restriction(guard, rst);
+  } else if (rst->type == RST_OUTDATED_MD_DIRSERVER) {
+return guard_obeys_md_dirserver_restriction(guard);
+  }
 
-  return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN);
+  tor_assert_nonfatal_unreached();
+  return 0;
 }
 
 /**
@@ -2105,7 +2170,7 @@ entry_guard_has_higher_priority(entry_guard_t *a, 
entry_guard_t *b)
 }
 
 /** Release all storage held 

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

2017-11-17 Thread nickm
commit 2cee26b16447c14ffc16502ecc28b48060cd
Merge: b98614f1a 96b69942a
Author: Nick Mathewson 
Date:   Fri Nov 17 09:56:53 2017 -0500

Merge branch 'bug23817_031' into maint-0.3.2

 changes/bug23817   |   3 ++
 src/or/directory.c |  40 ++--
 src/or/directory.h |   2 +
 src/or/entrynodes.c| 121 -
 src/or/entrynodes.h|  33 ++
 src/or/microdesc.c | 101 +
 src/or/microdesc.h |   4 ++
 src/or/networkstatus.c |   3 ++
 8 files changed, 272 insertions(+), 35 deletions(-)

diff --cc src/or/directory.h
index d26d83537,571c30a0f..b57b7b544
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@@ -191,8 -166,10 +191,10 @@@ STATIC char *accept_encoding_header(voi
  STATIC int allowed_anonymous_connection_compression_method(compress_method_t);
  STATIC void warn_disallowed_anonymous_compression_method(compress_method_t);
  
 -struct response_handler_args_t;
 -
 +STATIC int handle_response_fetch_hsdesc_v3(dir_connection_t *conn,
 +  const response_handler_args_t 
*args);
+ STATIC int handle_response_fetch_microdesc(dir_connection_t *conn,
 - const struct response_handler_args_t *args);
++ const response_handler_args_t *args);
  
  #endif /* defined(DIRECTORY_PRIVATE) */
  
diff --cc src/or/entrynodes.h
index 9e1e72993,29de627de..49bb3e55c
--- a/src/or/entrynodes.h
+++ b/src/or/entrynodes.h
@@@ -550,6 -557,16 +557,14 @@@ STATIC unsigned entry_guards_note_guard
  unsigned old_state);
  STATIC int entry_guard_has_higher_priority(entry_guard_t *a, entry_guard_t 
*b);
  STATIC char *getinfo_helper_format_single_entry_guard(const entry_guard_t *e);
+ 
 -STATIC entry_guard_restriction_t *
 -guard_create_exit_restriction(const uint8_t *exit_id);
++STATIC entry_guard_restriction_t *guard_create_exit_restriction(
++  const uint8_t *exit_id);
+ 
 -STATIC entry_guard_restriction_t *
 -guard_create_dirserver_md_restriction(void);
++STATIC entry_guard_restriction_t *guard_create_dirserver_md_restriction(void);
+ 
 -STATIC void
 -entry_guard_restriction_free(entry_guard_restriction_t *rst);
++STATIC void entry_guard_restriction_free(entry_guard_restriction_t *rst);
+ 
  #endif /* defined(ENTRYNODES_PRIVATE) */
  
  void remove_all_entry_guards_for_guard_selection(guard_selection_t *gs);
diff --cc src/or/networkstatus.c
index 2660e6a32,36e62020e..f31529733
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@@ -2009,11 -2037,13 +2009,14 @@@ networkstatus_set_current_consensus(con
   "consensus network status document (%s UTC).  Tor needs an "
   "accurate clock to work correctly. Please check your time and "
   "date settings!", dbuf, tbuf);
 -control_event_general_status(LOG_WARN,
 -"CLOCK_SKEW MIN_SKEW=%ld SOURCE=CONSENSUS", delta);
 +tor_asprintf(, "%s flavor consensus", flavor);
 +clock_skew_warning(NULL, delta, 1, LD_GENERAL, flavormsg, "CONSENSUS");
 +tor_free(flavormsg);
}
  
+   /* We got a new consesus. Reset our md fetch fail cache */
+   microdesc_reset_outdated_dirservers_list();
+ 
router_dir_info_changed();
  
result = 0;



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


[tor-commits] [tor/maint-0.3.2] Intoduce unittest for skipping outdated dirservers.

2017-11-17 Thread nickm
commit 7e52947d571c8038bfcd82e14f373f3c00924cbe
Author: George Kadianakis 
Date:   Mon Nov 6 15:45:42 2017 +0200

Intoduce unittest for skipping outdated dirservers.
---
 src/or/directory.c |  42 -
 src/or/directory.h |  42 +
 src/test/test_entrynodes.c | 146 +++--
 3 files changed, 171 insertions(+), 59 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 43a03a2fd..66bdef236 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1012,48 +1012,6 @@ directory_must_use_begindir(const or_options_t *options)
   return !public_server_mode(options);
 }
 
-struct directory_request_t {
-  /**
-   * These fields specify which directory we're contacting.  Routerstatus,
-   * if present, overrides the other fields.
-   *
-   * @{ */
-  tor_addr_port_t or_addr_port;
-  tor_addr_port_t dir_addr_port;
-  char digest[DIGEST_LEN];
-
-  const routerstatus_t *routerstatus;
-  /** @} */
-  /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
-   * kind of operation we'll be doing (upload/download), and of what kind
-   * of document. */
-  uint8_t dir_purpose;
-  /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
-   * and extrainfo docs.  */
-  uint8_t router_purpose;
-  /** Enum: determines whether to anonymize, and whether to use dirport or
-   * orport. */
-  dir_indirection_t indirection;
-  /** Alias to the variable part of the URL for this request */
-  const char *resource;
-  /** Alias to the payload to upload (if any) */
-  const char *payload;
-  /** Number of bytes to upload from payload */
-  size_t payload_len;
-  /** Value to send in an if-modified-since header, or 0 for none. */
-  time_t if_modified_since;
-  /** Hidden-service-specific information v2. */
-  const rend_data_t *rend_query;
-  /** Extra headers to append to the request */
-  config_line_t *additional_headers;
-  /** Hidden-service-specific information for v3+. */
-  const hs_ident_dir_conn_t *hs_ident;
-  /** Used internally to directory.c: gets informed when the attempt to
-   * connect to the directory succeeds or fails, if that attempt bears on the
-   * directory's usability as a directory guard. */
-  circuit_guard_state_t *guard_state;
-};
-
 /** Evaluate the situation and decide if we should use an encrypted
  * "begindir-style" connection for this directory request.
  * 0) If there is no DirPort, yes.
diff --git a/src/or/directory.h b/src/or/directory.h
index b57b7b544..5e6a91d3e 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -183,6 +183,48 @@ typedef struct response_handler_args_t {
   const char *headers;
 } response_handler_args_t;
 
+struct directory_request_t {
+  /**
+   * These fields specify which directory we're contacting.  Routerstatus,
+   * if present, overrides the other fields.
+   *
+   * @{ */
+  tor_addr_port_t or_addr_port;
+  tor_addr_port_t dir_addr_port;
+  char digest[DIGEST_LEN];
+
+  const routerstatus_t *routerstatus;
+  /** @} */
+  /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
+   * kind of operation we'll be doing (upload/download), and of what kind
+   * of document. */
+  uint8_t dir_purpose;
+  /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
+   * and extrainfo docs.  */
+  uint8_t router_purpose;
+  /** Enum: determines whether to anonymize, and whether to use dirport or
+   * orport. */
+  dir_indirection_t indirection;
+  /** Alias to the variable part of the URL for this request */
+  const char *resource;
+  /** Alias to the payload to upload (if any) */
+  const char *payload;
+  /** Number of bytes to upload from payload */
+  size_t payload_len;
+  /** Value to send in an if-modified-since header, or 0 for none. */
+  time_t if_modified_since;
+  /** Hidden-service-specific information v2. */
+  const rend_data_t *rend_query;
+  /** Extra headers to append to the request */
+  config_line_t *additional_headers;
+  /** Hidden-service-specific information for v3+. */
+  const hs_ident_dir_conn_t *hs_ident;
+  /** Used internally to directory.c: gets informed when the attempt to
+   * connect to the directory succeeds or fails, if that attempt bears on the
+   * directory's usability as a directory guard. */
+  struct circuit_guard_state_t *guard_state;
+};
+
 struct get_handler_args_t;
 STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn,
const struct get_handler_args_t *args);
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index f9d981953..2aef5cbbf 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -7,6 +7,7 @@
 #define STATEFILE_PRIVATE
 #define ENTRYNODES_PRIVATE
 #define ROUTERLIST_PRIVATE
+#define DIRECTORY_PRIVATE
 
 #include "or.h"
 #include "test.h"
@@ -15,6 +16,7 @@
 #include "circuitlist.h"
 #include "config.h"
 #include "confparse.h"
+#include "directory.h"

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

2017-11-17 Thread nickm
commit 2cee26b16447c14ffc16502ecc28b48060cd
Merge: b98614f1a 96b69942a
Author: Nick Mathewson 
Date:   Fri Nov 17 09:56:53 2017 -0500

Merge branch 'bug23817_031' into maint-0.3.2

 changes/bug23817   |   3 ++
 src/or/directory.c |  40 ++--
 src/or/directory.h |   2 +
 src/or/entrynodes.c| 121 -
 src/or/entrynodes.h|  33 ++
 src/or/microdesc.c | 101 +
 src/or/microdesc.h |   4 ++
 src/or/networkstatus.c |   3 ++
 8 files changed, 272 insertions(+), 35 deletions(-)

diff --cc src/or/directory.h
index d26d83537,571c30a0f..b57b7b544
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@@ -191,8 -166,10 +191,10 @@@ STATIC char *accept_encoding_header(voi
  STATIC int allowed_anonymous_connection_compression_method(compress_method_t);
  STATIC void warn_disallowed_anonymous_compression_method(compress_method_t);
  
 -struct response_handler_args_t;
 -
 +STATIC int handle_response_fetch_hsdesc_v3(dir_connection_t *conn,
 +  const response_handler_args_t 
*args);
+ STATIC int handle_response_fetch_microdesc(dir_connection_t *conn,
 - const struct response_handler_args_t *args);
++ const response_handler_args_t *args);
  
  #endif /* defined(DIRECTORY_PRIVATE) */
  
diff --cc src/or/entrynodes.h
index 9e1e72993,29de627de..49bb3e55c
--- a/src/or/entrynodes.h
+++ b/src/or/entrynodes.h
@@@ -550,6 -557,16 +557,14 @@@ STATIC unsigned entry_guards_note_guard
  unsigned old_state);
  STATIC int entry_guard_has_higher_priority(entry_guard_t *a, entry_guard_t 
*b);
  STATIC char *getinfo_helper_format_single_entry_guard(const entry_guard_t *e);
+ 
 -STATIC entry_guard_restriction_t *
 -guard_create_exit_restriction(const uint8_t *exit_id);
++STATIC entry_guard_restriction_t *guard_create_exit_restriction(
++  const uint8_t *exit_id);
+ 
 -STATIC entry_guard_restriction_t *
 -guard_create_dirserver_md_restriction(void);
++STATIC entry_guard_restriction_t *guard_create_dirserver_md_restriction(void);
+ 
 -STATIC void
 -entry_guard_restriction_free(entry_guard_restriction_t *rst);
++STATIC void entry_guard_restriction_free(entry_guard_restriction_t *rst);
+ 
  #endif /* defined(ENTRYNODES_PRIVATE) */
  
  void remove_all_entry_guards_for_guard_selection(guard_selection_t *gs);
diff --cc src/or/networkstatus.c
index 2660e6a32,36e62020e..f31529733
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@@ -2009,11 -2037,13 +2009,14 @@@ networkstatus_set_current_consensus(con
   "consensus network status document (%s UTC).  Tor needs an "
   "accurate clock to work correctly. Please check your time and "
   "date settings!", dbuf, tbuf);
 -control_event_general_status(LOG_WARN,
 -"CLOCK_SKEW MIN_SKEW=%ld SOURCE=CONSENSUS", delta);
 +tor_asprintf(, "%s flavor consensus", flavor);
 +clock_skew_warning(NULL, delta, 1, LD_GENERAL, flavormsg, "CONSENSUS");
 +tor_free(flavormsg);
}
  
+   /* We got a new consesus. Reset our md fetch fail cache */
+   microdesc_reset_outdated_dirservers_list();
+ 
router_dir_info_changed();
  
result = 0;



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


[tor-commits] [tor/master] Skip dirserver restrictions in small networks.

2017-11-17 Thread nickm
commit c400ffc2e88dab54b070a856717fb0ee6fe096cb
Author: George Kadianakis 
Date:   Mon Nov 13 22:26:22 2017 +0200

Skip dirserver restrictions in small networks.
---
 src/or/entrynodes.c | 42 ++
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index f2ca7aac2..1cc24d8d6 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1472,12 +1472,45 @@ guard_create_exit_restriction(const uint8_t *exit_id)
   return rst;
 }
 
-/** Allocate and return an outdated md guard restriction. */
+/** If we have less than these many configured bridges, don't set dirserver
+ *  restrictions because we might blacklist all of them. */
+#define TOO_FEW_BRIDGES_FOR_RESTRICTION 10
+
+/** Return true if we should set md dirserver restrictions. We might not want
+ *  to set those if our network is too restricted, since we don't want to
+ *  blacklist all our nodes. */
+static int
+should_set_md_dirserver_restriction(void)
+{
+  const guard_selection_t *gs = get_guard_selection_info();
+
+  /* Don't set a restriction if we are on a restricted guard selection */
+  if (gs->type == GS_TYPE_RESTRICTED) {
+return 0;
+  }
+
+  /* Don't set restriction if we are using bridges and have too few of those */
+  if (gs->type == GS_TYPE_BRIDGE && gs->sampled_entry_guards) {
+int num_sampled_guards = smartlist_len(gs->sampled_entry_guards);
+if (num_sampled_guards < TOO_FEW_BRIDGES_FOR_RESTRICTION) {
+  return 0;
+}
+  }
+
+  return 1;
+}
+
+/** Allocate and return an outdated md guard restriction. Return NULL if no
+ *  such restriction is needed. */
 STATIC entry_guard_restriction_t *
 guard_create_dirserver_md_restriction(void)
 {
   entry_guard_restriction_t *rst = NULL;
 
+  if (!should_set_md_dirserver_restriction()) {
+return NULL;
+  }
+
   rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
   rst->type = RST_OUTDATED_MD_DIRSERVER;
 
@@ -1504,13 +1537,6 @@ guard_obeys_exit_restriction(const entry_guard_t *guard,
 static int
 guard_obeys_md_dirserver_restriction(const entry_guard_t *guard)
 {
-  /* Don't enforce dirserver restrictions for bridges since we might not have
-   * many of those. Be willing to try them over and over again for now. */
-  /* XXX: Improvement might be possible here */
-  if (guard->bridge_addr) {
-return 1;
-  }
-
   /* If this guard is an outdated dirserver, don't use it. */
   if (microdesc_relay_is_outdated_dirserver(guard->identity)) {
 log_info(LD_GENERAL, "Skipping %s dirserver: outdated",



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


[tor-commits] [tor/master] Introduce cache for outdated microdesc dirservers.

2017-11-17 Thread nickm
commit 7fc64f02a3057405f9e75d70848afd2e9b95da05
Author: George Kadianakis 
Date:   Mon Nov 6 14:48:22 2017 +0200

Introduce cache for outdated microdesc dirservers.

We gonna use this cache to avoid dirservers without outdated md info.
---
 src/or/directory.c |  36 +++---
 src/or/directory.h |   7 +++-
 src/or/microdesc.c | 101 +
 src/or/microdesc.h |   6 ++-
 src/or/networkstatus.c |   3 ++
 5 files changed, 138 insertions(+), 15 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 9494cf02b..129309ae4 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -117,7 +117,8 @@ static void dir_routerdesc_download_failed(smartlist_t 
*failed,
int was_extrainfo,
int was_descriptor_digests);
 static void dir_microdesc_download_failed(smartlist_t *failed,
-  int status_code);
+  int status_code,
+  const char *dir_id);
 static int client_likes_consensus(const struct consensus_cache_entry_t *ent,
   const char *want_url);
 
@@ -2178,8 +2179,6 @@ static int 
handle_response_fetch_detached_signatures(dir_connection_t *,
  const response_handler_args_t *);
 static int handle_response_fetch_desc(dir_connection_t *,
  const response_handler_args_t *);
-static int handle_response_fetch_microdesc(dir_connection_t *,
-   const response_handler_args_t *);
 static int handle_response_upload_dir(dir_connection_t *,
   const response_handler_args_t *);
 static int handle_response_upload_vote(dir_connection_t *,
@@ -2839,7 +2838,7 @@ handle_response_fetch_desc(dir_connection_t *conn,
  * Handler function: processes a response to a request for a group of
  * microdescriptors
  **/
-static int
+STATIC int
 handle_response_fetch_microdesc(dir_connection_t *conn,
 const response_handler_args_t *args)
 {
@@ -2856,6 +2855,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
conn->base_.port);
   tor_assert(conn->requested_resource &&
  !strcmpstart(conn->requested_resource, "d/"));
+  tor_assert_nonfatal(!tor_mem_is_zero(conn->identity_digest, DIGEST_LEN));
   which = smartlist_new();
   dir_split_resource_into_fingerprints(conn->requested_resource+2,
which, NULL,
@@ -2866,7 +2866,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
  "soon.",
  status_code, escaped(reason), conn->base_.address,
  (int)conn->base_.port, conn->requested_resource);
-dir_microdesc_download_failed(which, status_code);
+dir_microdesc_download_failed(which, status_code, conn->identity_digest);
 SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
 smartlist_free(which);
 return 0;
@@ -2878,7 +2878,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
   now, which);
 if (smartlist_len(which)) {
   /* Mark remaining ones as failed. */
-  dir_microdesc_download_failed(which, status_code);
+  dir_microdesc_download_failed(which, status_code, conn->identity_digest);
 }
 if (mds && smartlist_len(mds)) {
   control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
@@ -5546,13 +5546,14 @@ dir_routerdesc_download_failed(smartlist_t *failed, int 
status_code,
* every 10 or 60 seconds (FOO_DESCRIPTOR_RETRY_INTERVAL) in main.c. */
 }
 
-/** Called when a connection to download microdescriptors has failed in whole
- * or in part. failed is a list of every microdesc digest we didn't
- * get. status_code is the http status code we received. Reschedule the
- * microdesc downloads as appropriate. */
+/** Called when a connection to download microdescriptors from relay with
+ * dir_id has failed in whole or in part. failed is a list
+ * of every microdesc digest we didn't get. status_code is the http
+ * status code we received. Reschedule the microdesc downloads as
+ * appropriate. */
 static void
 dir_microdesc_download_failed(smartlist_t *failed,
-  int status_code)
+  int status_code, const char *dir_id)
 {
   networkstatus_t *consensus
 = networkstatus_get_latest_consensus_by_flavor(FLAV_MICRODESC);
@@ -5563,17 +5564,26 @@ dir_microdesc_download_failed(smartlist_t *failed,
 
   if (! consensus)
 return;
+
+  /* We failed to fetch a microdescriptor from 'dir_id', note it down
+   * so that we don't try the same relay next time... */
+  microdesc_note_outdated_dirserver(dir_id);
+
   SMARTLIST_FOREACH_BEGIN(failed, const char *, d) {
 

[tor-commits] [tor/maint-0.3.2] Fix a clang unitialized-var warning

2017-11-17 Thread nickm
commit 3a5ca47d8f0b97da80199c7787b81c28c9247bb3
Author: Nick Mathewson 
Date:   Tue Nov 7 19:40:52 2017 -0500

Fix a clang unitialized-var warning
---
 src/test/test_entrynodes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 2aef5cbbf..43cc39488 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -1729,6 +1729,7 @@ test_entry_guard_select_for_circuit_no_confirmed(void 
*arg)
   /* Simpler cases: no gaurds are confirmed yet. */
   (void)arg;
   guard_selection_t *gs = guard_selection_new("default", GS_TYPE_NORMAL);
+  entry_guard_restriction_t *rst = NULL;
 
   /* simple starting configuration */
   entry_guards_update_primary(gs);
@@ -1810,7 +1811,6 @@ test_entry_guard_select_for_circuit_no_confirmed(void 
*arg)
   tt_ptr_op(g2, OP_EQ, g);
 
   /* But if we impose a restriction, we don't get the same guard */
-  entry_guard_restriction_t *rst;
   rst = guard_create_exit_restriction((uint8_t*)g->identity);
   g2 = select_entry_guard_for_circuit(gs, GUARD_USAGE_TRAFFIC, rst, );
   tt_ptr_op(g2, OP_NE, g);



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


[tor-commits] [tor/maint-0.3.2] Make should_set_md_dirserver_restriction() look at num filtered guards

2017-11-17 Thread nickm
commit 96b69942a54e69e9f4d8aeb07bf9a5fb98892900
Author: Nick Mathewson 
Date:   Thu Nov 16 08:49:24 2017 -0500

Make should_set_md_dirserver_restriction() look at num filtered guards

This seems closer to what the code intended.
---
 src/or/entrynodes.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 1cc24d8d6..dc02557b5 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1472,9 +1472,10 @@ guard_create_exit_restriction(const uint8_t *exit_id)
   return rst;
 }
 
-/** If we have less than these many configured bridges, don't set dirserver
- *  restrictions because we might blacklist all of them. */
-#define TOO_FEW_BRIDGES_FOR_RESTRICTION 10
+/** If we have fewer than this many possible guards, don't set
+ * MD-availability-based restrictions: we might blacklist all of
+ * them. */
+#define MIN_GUARDS_FOR_MD_RESTRICTION 10
 
 /** Return true if we should set md dirserver restrictions. We might not want
  *  to set those if our network is too restricted, since we don't want to
@@ -1484,20 +1485,17 @@ should_set_md_dirserver_restriction(void)
 {
   const guard_selection_t *gs = get_guard_selection_info();
 
-  /* Don't set a restriction if we are on a restricted guard selection */
-  if (gs->type == GS_TYPE_RESTRICTED) {
-return 0;
-  }
-
-  /* Don't set restriction if we are using bridges and have too few of those */
-  if (gs->type == GS_TYPE_BRIDGE && gs->sampled_entry_guards) {
-int num_sampled_guards = smartlist_len(gs->sampled_entry_guards);
-if (num_sampled_guards < TOO_FEW_BRIDGES_FOR_RESTRICTION) {
-  return 0;
+  /* Compute the number of filtered guards */
+  int n_filtered_guards = 0;
+  SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
+if (guard->is_filtered_guard) {
+  ++n_filtered_guards;
 }
-  }
+  } SMARTLIST_FOREACH_END(guard);
 
-  return 1;
+  /* Do we have enough filtered guards that we feel okay about blacklisting
+   * some for MD restriction? */
+  return (n_filtered_guards >= MIN_GUARDS_FOR_MD_RESTRICTION);
 }
 
 /** Allocate and return an outdated md guard restriction. Return NULL if no
@@ -1508,6 +1506,8 @@ guard_create_dirserver_md_restriction(void)
   entry_guard_restriction_t *rst = NULL;
 
   if (!should_set_md_dirserver_restriction()) {
+log_debug(LD_GUARD, "Not setting md restriction: too few "
+  "filtered guards.");
 return 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.3.2] Introduce cache for outdated microdesc dirservers.

2017-11-17 Thread nickm
commit 7fc64f02a3057405f9e75d70848afd2e9b95da05
Author: George Kadianakis 
Date:   Mon Nov 6 14:48:22 2017 +0200

Introduce cache for outdated microdesc dirservers.

We gonna use this cache to avoid dirservers without outdated md info.
---
 src/or/directory.c |  36 +++---
 src/or/directory.h |   7 +++-
 src/or/microdesc.c | 101 +
 src/or/microdesc.h |   6 ++-
 src/or/networkstatus.c |   3 ++
 5 files changed, 138 insertions(+), 15 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 9494cf02b..129309ae4 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -117,7 +117,8 @@ static void dir_routerdesc_download_failed(smartlist_t 
*failed,
int was_extrainfo,
int was_descriptor_digests);
 static void dir_microdesc_download_failed(smartlist_t *failed,
-  int status_code);
+  int status_code,
+  const char *dir_id);
 static int client_likes_consensus(const struct consensus_cache_entry_t *ent,
   const char *want_url);
 
@@ -2178,8 +2179,6 @@ static int 
handle_response_fetch_detached_signatures(dir_connection_t *,
  const response_handler_args_t *);
 static int handle_response_fetch_desc(dir_connection_t *,
  const response_handler_args_t *);
-static int handle_response_fetch_microdesc(dir_connection_t *,
-   const response_handler_args_t *);
 static int handle_response_upload_dir(dir_connection_t *,
   const response_handler_args_t *);
 static int handle_response_upload_vote(dir_connection_t *,
@@ -2839,7 +2838,7 @@ handle_response_fetch_desc(dir_connection_t *conn,
  * Handler function: processes a response to a request for a group of
  * microdescriptors
  **/
-static int
+STATIC int
 handle_response_fetch_microdesc(dir_connection_t *conn,
 const response_handler_args_t *args)
 {
@@ -2856,6 +2855,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
conn->base_.port);
   tor_assert(conn->requested_resource &&
  !strcmpstart(conn->requested_resource, "d/"));
+  tor_assert_nonfatal(!tor_mem_is_zero(conn->identity_digest, DIGEST_LEN));
   which = smartlist_new();
   dir_split_resource_into_fingerprints(conn->requested_resource+2,
which, NULL,
@@ -2866,7 +2866,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
  "soon.",
  status_code, escaped(reason), conn->base_.address,
  (int)conn->base_.port, conn->requested_resource);
-dir_microdesc_download_failed(which, status_code);
+dir_microdesc_download_failed(which, status_code, conn->identity_digest);
 SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
 smartlist_free(which);
 return 0;
@@ -2878,7 +2878,7 @@ handle_response_fetch_microdesc(dir_connection_t *conn,
   now, which);
 if (smartlist_len(which)) {
   /* Mark remaining ones as failed. */
-  dir_microdesc_download_failed(which, status_code);
+  dir_microdesc_download_failed(which, status_code, conn->identity_digest);
 }
 if (mds && smartlist_len(mds)) {
   control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
@@ -5546,13 +5546,14 @@ dir_routerdesc_download_failed(smartlist_t *failed, int 
status_code,
* every 10 or 60 seconds (FOO_DESCRIPTOR_RETRY_INTERVAL) in main.c. */
 }
 
-/** Called when a connection to download microdescriptors has failed in whole
- * or in part. failed is a list of every microdesc digest we didn't
- * get. status_code is the http status code we received. Reschedule the
- * microdesc downloads as appropriate. */
+/** Called when a connection to download microdescriptors from relay with
+ * dir_id has failed in whole or in part. failed is a list
+ * of every microdesc digest we didn't get. status_code is the http
+ * status code we received. Reschedule the microdesc downloads as
+ * appropriate. */
 static void
 dir_microdesc_download_failed(smartlist_t *failed,
-  int status_code)
+  int status_code, const char *dir_id)
 {
   networkstatus_t *consensus
 = networkstatus_get_latest_consensus_by_flavor(FLAV_MICRODESC);
@@ -5563,17 +5564,26 @@ dir_microdesc_download_failed(smartlist_t *failed,
 
   if (! consensus)
 return;
+
+  /* We failed to fetch a microdescriptor from 'dir_id', note it down
+   * so that we don't try the same relay next time... */
+  microdesc_note_outdated_dirserver(dir_id);
+
   SMARTLIST_FOREACH_BEGIN(failed, const char *, d) {
 

[tor-commits] [tor/maint-0.3.2] Fix a wide comment

2017-11-17 Thread nickm
commit 9fbc835f10e9fba6a9b0c6643a41aee9c8aa05c2
Author: Nick Mathewson 
Date:   Fri Nov 17 09:57:15 2017 -0500

Fix a wide comment
---
 src/or/scheduler.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index dabac386d..cbf51447b 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -258,9 +258,10 @@ select_scheduler(void)
   /* We should only log this once in most cases. If it was the kernel
* losing support for kist that caused scheduler_can_use_kist() to
* return false, then this flag makes sure we only log this message
-   * once. If it was the consensus that switched from "yes use kist" to
-   * "no don't use kist", then we still set the flag so we log once, 
but
-   * we unset the flag elsewhere if we ever can_use_kist() again.
+   * once. If it was the consensus that switched from "yes use kist"
+   * to "no don't use kist", then we still set the flag so we log
+   * once, but we unset the flag elsewhere if we ever can_use_kist()
+   * again.
*/
   have_logged_kist_suddenly_disabled = 1;
   log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "



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


[tor-commits] [tor/maint-0.3.2] Skip dirserver restrictions in small networks.

2017-11-17 Thread nickm
commit c400ffc2e88dab54b070a856717fb0ee6fe096cb
Author: George Kadianakis 
Date:   Mon Nov 13 22:26:22 2017 +0200

Skip dirserver restrictions in small networks.
---
 src/or/entrynodes.c | 42 ++
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index f2ca7aac2..1cc24d8d6 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1472,12 +1472,45 @@ guard_create_exit_restriction(const uint8_t *exit_id)
   return rst;
 }
 
-/** Allocate and return an outdated md guard restriction. */
+/** If we have less than these many configured bridges, don't set dirserver
+ *  restrictions because we might blacklist all of them. */
+#define TOO_FEW_BRIDGES_FOR_RESTRICTION 10
+
+/** Return true if we should set md dirserver restrictions. We might not want
+ *  to set those if our network is too restricted, since we don't want to
+ *  blacklist all our nodes. */
+static int
+should_set_md_dirserver_restriction(void)
+{
+  const guard_selection_t *gs = get_guard_selection_info();
+
+  /* Don't set a restriction if we are on a restricted guard selection */
+  if (gs->type == GS_TYPE_RESTRICTED) {
+return 0;
+  }
+
+  /* Don't set restriction if we are using bridges and have too few of those */
+  if (gs->type == GS_TYPE_BRIDGE && gs->sampled_entry_guards) {
+int num_sampled_guards = smartlist_len(gs->sampled_entry_guards);
+if (num_sampled_guards < TOO_FEW_BRIDGES_FOR_RESTRICTION) {
+  return 0;
+}
+  }
+
+  return 1;
+}
+
+/** Allocate and return an outdated md guard restriction. Return NULL if no
+ *  such restriction is needed. */
 STATIC entry_guard_restriction_t *
 guard_create_dirserver_md_restriction(void)
 {
   entry_guard_restriction_t *rst = NULL;
 
+  if (!should_set_md_dirserver_restriction()) {
+return NULL;
+  }
+
   rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
   rst->type = RST_OUTDATED_MD_DIRSERVER;
 
@@ -1504,13 +1537,6 @@ guard_obeys_exit_restriction(const entry_guard_t *guard,
 static int
 guard_obeys_md_dirserver_restriction(const entry_guard_t *guard)
 {
-  /* Don't enforce dirserver restrictions for bridges since we might not have
-   * many of those. Be willing to try them over and over again for now. */
-  /* XXX: Improvement might be possible here */
-  if (guard->bridge_addr) {
-return 1;
-  }
-
   /* If this guard is an outdated dirserver, don't use it. */
   if (microdesc_relay_is_outdated_dirserver(guard->identity)) {
 log_info(LD_GENERAL, "Skipping %s dirserver: outdated",



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


[tor-commits] [tor/maint-0.3.2] Introduce new guard restriction and use it to skip outdated dirs.

2017-11-17 Thread nickm
commit f61e3090fb2975ad8c2a5e138b87c62428c5f46b
Author: George Kadianakis 
Date:   Mon Nov 6 19:38:47 2017 +0200

Introduce new guard restriction and use it to skip outdated dirs.
---
 changes/bug23817|  3 ++
 src/or/directory.c  |  4 +--
 src/or/entrynodes.c | 95 ++---
 src/or/entrynodes.h | 37 +++--
 4 files changed, 116 insertions(+), 23 deletions(-)

diff --git a/changes/bug23817 b/changes/bug23817
new file mode 100644
index 0..474094279
--- /dev/null
+++ b/changes/bug23817
@@ -0,0 +1,3 @@
+  o Minor bugfixes (descriptors):
+- Don't try fetching microdescriptors from relays that have failed to
+  deliver them in the past. Fixes bug 23817; bugfix on 0.3.0.1-alpha.
diff --git a/src/or/directory.c b/src/or/directory.c
index 129309ae4..aec8ef5bf 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -464,7 +464,7 @@ directory_pick_generic_dirserver(dirinfo_type_t type, int 
pds_flags,
 log_warn(LD_BUG, "Called when we have UseBridges set.");
 
   if (should_use_directory_guards(options)) {
-const node_t *node = guards_choose_dirguard(guard_state_out);
+const node_t *node = guards_choose_dirguard(dir_purpose, guard_state_out);
 if (node)
   rs = node->rs;
   } else {
@@ -598,7 +598,7 @@ directory_get_from_dirserver,(
* sort of dir fetch we'll be doing, so it won't return a bridge
* that can't answer our question.
*/
-  const node_t *node = guards_choose_dirguard(_state);
+  const node_t *node = guards_choose_dirguard(dir_purpose, _state);
   if (node && node->ri) {
 /* every bridge has a routerinfo. */
 routerinfo_t *ri = node->ri;
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 26f53cbfe..f2ca7aac2 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1460,6 +1460,70 @@ guard_in_node_family(const entry_guard_t *guard, const 
node_t *node)
   }
 }
 
+/* Allocate and return a new exit guard restriction (where exit_id is of
+ * size DIGEST_LEN) */
+STATIC entry_guard_restriction_t *
+guard_create_exit_restriction(const uint8_t *exit_id)
+{
+  entry_guard_restriction_t *rst = NULL;
+  rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
+  rst->type = RST_EXIT_NODE;
+  memcpy(rst->exclude_id, exit_id, DIGEST_LEN);
+  return rst;
+}
+
+/** Allocate and return an outdated md guard restriction. */
+STATIC entry_guard_restriction_t *
+guard_create_dirserver_md_restriction(void)
+{
+  entry_guard_restriction_t *rst = NULL;
+
+  rst = tor_malloc_zero(sizeof(entry_guard_restriction_t));
+  rst->type = RST_OUTDATED_MD_DIRSERVER;
+
+  return rst;
+}
+
+/* Return True if guard obeys the exit restriction rst. */
+static int
+guard_obeys_exit_restriction(const entry_guard_t *guard,
+ const entry_guard_restriction_t *rst)
+{
+  tor_assert(rst->type == RST_EXIT_NODE);
+
+  // Exclude the exit ID and all of its family.
+  const node_t *node = node_get_by_id((const char*)rst->exclude_id);
+  if (node && guard_in_node_family(guard, node))
+return 0;
+
+  return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN);
+}
+
+/** Return True if guard should be used as a dirserver for fetching
+ *  microdescriptors. */
+static int
+guard_obeys_md_dirserver_restriction(const entry_guard_t *guard)
+{
+  /* Don't enforce dirserver restrictions for bridges since we might not have
+   * many of those. Be willing to try them over and over again for now. */
+  /* XXX: Improvement might be possible here */
+  if (guard->bridge_addr) {
+return 1;
+  }
+
+  /* If this guard is an outdated dirserver, don't use it. */
+  if (microdesc_relay_is_outdated_dirserver(guard->identity)) {
+log_info(LD_GENERAL, "Skipping %s dirserver: outdated",
+ hex_str(guard->identity, DIGEST_LEN));
+return 0;
+  }
+
+  log_debug(LD_GENERAL, "%s dirserver obeys md restrictions",
+hex_str(guard->identity, DIGEST_LEN));
+
+  return 1;
+}
+
 /**
  * Return true iff guard obeys the restrictions defined in rst.
  * (If rst is NULL, there are no restrictions.)
@@ -1472,13 +1536,14 @@ entry_guard_obeys_restriction(const entry_guard_t 
*guard,
   if (! rst)
 return 1; // No restriction?  No problem.
 
-  // Only one kind of restriction exists right now: excluding an exit
-  // ID and all of its family.
-  const node_t *node = node_get_by_id((const char*)rst->exclude_id);
-  if (node && guard_in_node_family(guard, node))
-return 0;
+  if (rst->type == RST_EXIT_NODE) {
+return guard_obeys_exit_restriction(guard, rst);
+  } else if (rst->type == RST_OUTDATED_MD_DIRSERVER) {
+return guard_obeys_md_dirserver_restriction(guard);
+  }
 
-  return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN);
+  tor_assert_nonfatal_unreached();
+  return 0;
 }
 
 /**
@@ -2105,7 +2170,7 @@ entry_guard_has_higher_priority(entry_guard_t *a, 
entry_guard_t *b)
 }
 
 /** Release all storage held 

[tor-commits] [translation/tor-launcher-properties_completed] Update translations for tor-launcher-properties_completed

2017-11-17 Thread translation
commit 31f6a59087e03cbc5b869644c1f7c10cac792d0b
Author: Translation commit bot 
Date:   Fri Nov 17 14:46:43 2017 +

Update translations for tor-launcher-properties_completed
---
 de/torlauncher.properties | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/de/torlauncher.properties b/de/torlauncher.properties
index 8406776a1..9b863d5bd 100644
--- a/de/torlauncher.properties
+++ b/de/torlauncher.properties
@@ -28,7 +28,8 @@ torlauncher.error_bridges_missing=Sie müssen eine oder 
mehrere Brücken eingebe
 torlauncher.error_default_bridges_type_missing=Sie müssen eine Transporttyp 
für die bereitgestellten Brücken auswählen.
 torlauncher.error_bridge_bad_default_type=Es sind keine bereitgestellten 
Brücken verfügbar, die den Transporttyp %S haben. Bitte passen Sie Ihre 
Einstellungen an.
 
-torlauncher.recommended_bridge=(empfohlen)
+torlauncher.bridge_suffix.meek-amazon=(funktioniert in China)
+torlauncher.bridge_suffix.meek-azure=(funktioniert in China)
 
 torlauncher.connect=Verbinden
 torlauncher.restart_tor=Tor neustarten

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


[tor-commits] [translation/tor-launcher-properties] Update translations for tor-launcher-properties

2017-11-17 Thread translation
commit fcdc7bf1f4c8f262d30c8d443dc2ca46b140d23f
Author: Translation commit bot 
Date:   Fri Nov 17 14:46:37 2017 +

Update translations for tor-launcher-properties
---
 de/torlauncher.properties | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/de/torlauncher.properties b/de/torlauncher.properties
index c198101bf..9b863d5bd 100644
--- a/de/torlauncher.properties
+++ b/de/torlauncher.properties
@@ -28,8 +28,8 @@ torlauncher.error_bridges_missing=Sie müssen eine oder 
mehrere Brücken eingebe
 torlauncher.error_default_bridges_type_missing=Sie müssen eine Transporttyp 
für die bereitgestellten Brücken auswählen.
 torlauncher.error_bridge_bad_default_type=Es sind keine bereitgestellten 
Brücken verfügbar, die den Transporttyp %S haben. Bitte passen Sie Ihre 
Einstellungen an.
 
-torlauncher.bridge_suffix.meek-amazon=(works in China)
-torlauncher.bridge_suffix.meek-azure=(works in China)
+torlauncher.bridge_suffix.meek-amazon=(funktioniert in China)
+torlauncher.bridge_suffix.meek-azure=(funktioniert in China)
 
 torlauncher.connect=Verbinden
 torlauncher.restart_tor=Tor neustarten

___
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

2017-11-17 Thread translation
commit c41d67e750a8765a6ecbc2085656b31ff0bf6f49
Author: Translation commit bot 
Date:   Fri Nov 17 14:46:59 2017 +

Update translations for tor-launcher-network-settings
---
 de/network-settings.dtd | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/de/network-settings.dtd b/de/network-settings.dtd
index 534b17dba..afc0a9556 100644
--- a/de/network-settings.dtd
+++ b/de/network-settings.dtd
@@ -1,7 +1,7 @@
 
-
-
-
+
+
+
 
 
 
@@ -9,7 +9,7 @@
 
 
 
-
+
 
 
 
@@ -25,9 +25,9 @@
 
 
 
-
+
 
-
+
 
 
 
@@ -38,16 +38,16 @@
 
 
 
-
-
-
-
-
-
+
+
+
+
+
+
 
 
 
-
+
 
 
 
@@ -55,4 +55,4 @@
 
 
 
-
+

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


[tor-commits] [tor/release-0.3.2] Use less jargon in Scheduler sec. of man page

2017-11-17 Thread nickm
commit 8b2c01a46f4353deaa37d129bd21f32b4d990d1d
Author: Matt Traudt 
Date:   Thu Nov 16 14:32:17 2017 -0500

Use less jargon in Scheduler sec. of man page
---
 changes/ticket24254 |  2 +-
 doc/tor.1.txt   | 36 +---
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/changes/ticket24254 b/changes/ticket24254
index 80dd74125..98d5d6bac 100644
--- a/changes/ticket24254
+++ b/changes/ticket24254
@@ -1,3 +1,3 @@
   o Documentation:
 Add notes in man page regarding OS support for the various scheduler types.
-Closes ticket 24254.
+Attempt to use less jargon in the scheduler section. Closes ticket 24254.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f627659f5..fc285ebe1 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -791,29 +791,35 @@ GENERAL OPTIONS
 restarting Tor. (Default: 0)
 
 [[Schedulers]] **Schedulers** **KIST**|**KISTLite**|**Vanilla**::
-Specify the scheduler type that tor should use to handle outbound data on
-channels. This is an ordered list by priority which means that the first
-value will be tried first and if unavailable, the second one is tried and
-so on. It is possible to change thse values at runtime.
+Specify the scheduler type that tor should use. The scheduler is
+responsible for moving data around within a Tor process. This is an ordered
+list by priority which means that the first value will be tried first and 
if
+unavailable, the second one is tried and so on. It is possible to change
+these values at runtime. This option mostly effects relays, and most
+operators should leave it set to its default value.
 (Default: KIST,KISTLite,Vanilla)
  +
 The possible scheduler types are:
  +
-**KIST**: Kernel Informed Socket Transport. Tor will use the kernel tcp
-information stack per-socket to make an informed decision on if it should
-send or not the data. As implemented, KIST will only work on Linux kernel
-version 2.6.39 or higher.
+**KIST**: Kernel-Informed Socket Transport. Tor will use TCP information
+from the kernel to make informed decisions regarding how much data to send
+and when to send it. KIST also handles traffic in batches (see
+KISTSchedRunInterval) in order to improve traffic prioritization decisions.
+As implemented, KIST will only work on Linux kernel version 2.6.39 or
+higher.
  +
-**KISTLite**: Same as KIST but without kernel support which means that tor
-will use all the same mecanics as KIST but without the TCP information the
-kernel can provide. KISTLite will work on all kernels and operating
-systems.
+**KISTLite**: Same as KIST but without kernel support. Tor will use all
+the same mechanics as with KIST, including the batching, but its decisions
+regarding how much data to send will not be as good. KISTLite will work on
+all kernels and operating systems, and the majority of the benefits of KIST
+are still realized with KISTLite.
  +
-**Vanilla**: The scheduler that tor has always used that is do as much as
-possible or AMAP. Vanilla will work on all kernels and operating systems.
+**Vanilla**: The scheduler that Tor used before KIST was implemented. It
+sends as much data as possible, as soon as possible. Vanilla will work on
+all kernels and operating systems.
 
 [[KISTSchedRunInterval]] **KISTSchedRunInterval** __NUM__ **msec**::
-If KIST or KISTLite is used in Schedulers option, this control at which
+If KIST or KISTLite is used in the Schedulers option, this controls at 
which
 interval the scheduler tick is. If the value is 0 msec, the value is taken
 from the consensus if possible else it will fallback to the default 10
 msec. Maximum possible value is 100 msec. (Default: 0 msec)



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


[tor-commits] [tor/master] Only log about lost KIST support once

2017-11-17 Thread nickm
commit b98614f1af6ed10aa0e3cd00d5baf57fb534f574
Author: Matt Traudt 
Date:   Thu Nov 16 14:38:39 2017 -0500

Only log about lost KIST support once
---
 changes/ticket24158 |  3 +++
 src/or/scheduler.c  | 24 ++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/changes/ticket24158 b/changes/ticket24158
new file mode 100644
index 0..3cdc06afa
--- /dev/null
+++ b/changes/ticket24158
@@ -0,0 +1,3 @@
+  o Minor bugfixes (logging):
+Only log about no longer having KIST support once. Fixes bug 24158; bugfix
+on 0.3.2
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index 1438dc60f..dabac386d 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -171,6 +171,8 @@ STATIC smartlist_t *channels_pending = NULL;
  */
 STATIC struct event *run_sched_ev = NULL;
 
+static int have_logged_kist_suddenly_disabled = 0;
+
 /*
  * Scheduling system static function definitions
  *
@@ -252,13 +254,31 @@ select_scheduler(void)
 case SCHEDULER_KIST:
   if (!scheduler_can_use_kist()) {
 #ifdef HAVE_KIST_SUPPORT
-log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "
- "the consensus or no kernel support.");
+if (!have_logged_kist_suddenly_disabled) {
+  /* We should only log this once in most cases. If it was the kernel
+   * losing support for kist that caused scheduler_can_use_kist() to
+   * return false, then this flag makes sure we only log this message
+   * once. If it was the consensus that switched from "yes use kist" to
+   * "no don't use kist", then we still set the flag so we log once, 
but
+   * we unset the flag elsewhere if we ever can_use_kist() again.
+   */
+  have_logged_kist_suddenly_disabled = 1;
+  log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "
+   "the consensus or no kernel support.");
+}
 #else /* !(defined(HAVE_KIST_SUPPORT)) */
 log_info(LD_SCHED, "Scheduler type KIST not built in");
 #endif /* defined(HAVE_KIST_SUPPORT) */
 continue;
   }
+  /* This flag will only get set in one of two cases:
+   * 1 - the kernel lost support for kist. In that case, we don't expect to
+   * ever end up here
+   * 2 - the consensus went from "yes use kist" to "no don't use kist".
+   * We might end up here if the consensus changes back to "yes", in which
+   * case we might want to warn the user again if it goes back to "no"
+   * yet again. Thus we unset the flag */
+  have_logged_kist_suddenly_disabled = 0;
   new_scheduler = get_kist_scheduler();
   scheduler_kist_set_full_mode();
   goto end;



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


[tor-commits] [tor/master] Use less jargon in Scheduler sec. of man page

2017-11-17 Thread nickm
commit 8b2c01a46f4353deaa37d129bd21f32b4d990d1d
Author: Matt Traudt 
Date:   Thu Nov 16 14:32:17 2017 -0500

Use less jargon in Scheduler sec. of man page
---
 changes/ticket24254 |  2 +-
 doc/tor.1.txt   | 36 +---
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/changes/ticket24254 b/changes/ticket24254
index 80dd74125..98d5d6bac 100644
--- a/changes/ticket24254
+++ b/changes/ticket24254
@@ -1,3 +1,3 @@
   o Documentation:
 Add notes in man page regarding OS support for the various scheduler types.
-Closes ticket 24254.
+Attempt to use less jargon in the scheduler section. Closes ticket 24254.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f627659f5..fc285ebe1 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -791,29 +791,35 @@ GENERAL OPTIONS
 restarting Tor. (Default: 0)
 
 [[Schedulers]] **Schedulers** **KIST**|**KISTLite**|**Vanilla**::
-Specify the scheduler type that tor should use to handle outbound data on
-channels. This is an ordered list by priority which means that the first
-value will be tried first and if unavailable, the second one is tried and
-so on. It is possible to change thse values at runtime.
+Specify the scheduler type that tor should use. The scheduler is
+responsible for moving data around within a Tor process. This is an ordered
+list by priority which means that the first value will be tried first and 
if
+unavailable, the second one is tried and so on. It is possible to change
+these values at runtime. This option mostly effects relays, and most
+operators should leave it set to its default value.
 (Default: KIST,KISTLite,Vanilla)
  +
 The possible scheduler types are:
  +
-**KIST**: Kernel Informed Socket Transport. Tor will use the kernel tcp
-information stack per-socket to make an informed decision on if it should
-send or not the data. As implemented, KIST will only work on Linux kernel
-version 2.6.39 or higher.
+**KIST**: Kernel-Informed Socket Transport. Tor will use TCP information
+from the kernel to make informed decisions regarding how much data to send
+and when to send it. KIST also handles traffic in batches (see
+KISTSchedRunInterval) in order to improve traffic prioritization decisions.
+As implemented, KIST will only work on Linux kernel version 2.6.39 or
+higher.
  +
-**KISTLite**: Same as KIST but without kernel support which means that tor
-will use all the same mecanics as KIST but without the TCP information the
-kernel can provide. KISTLite will work on all kernels and operating
-systems.
+**KISTLite**: Same as KIST but without kernel support. Tor will use all
+the same mechanics as with KIST, including the batching, but its decisions
+regarding how much data to send will not be as good. KISTLite will work on
+all kernels and operating systems, and the majority of the benefits of KIST
+are still realized with KISTLite.
  +
-**Vanilla**: The scheduler that tor has always used that is do as much as
-possible or AMAP. Vanilla will work on all kernels and operating systems.
+**Vanilla**: The scheduler that Tor used before KIST was implemented. It
+sends as much data as possible, as soon as possible. Vanilla will work on
+all kernels and operating systems.
 
 [[KISTSchedRunInterval]] **KISTSchedRunInterval** __NUM__ **msec**::
-If KIST or KISTLite is used in Schedulers option, this control at which
+If KIST or KISTLite is used in the Schedulers option, this controls at 
which
 interval the scheduler tick is. If the value is 0 msec, the value is taken
 from the consensus if possible else it will fallback to the default 10
 msec. Maximum possible value is 100 msec. (Default: 0 msec)



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


[tor-commits] [tor/release-0.3.2] Only log about lost KIST support once

2017-11-17 Thread nickm
commit b98614f1af6ed10aa0e3cd00d5baf57fb534f574
Author: Matt Traudt 
Date:   Thu Nov 16 14:38:39 2017 -0500

Only log about lost KIST support once
---
 changes/ticket24158 |  3 +++
 src/or/scheduler.c  | 24 ++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/changes/ticket24158 b/changes/ticket24158
new file mode 100644
index 0..3cdc06afa
--- /dev/null
+++ b/changes/ticket24158
@@ -0,0 +1,3 @@
+  o Minor bugfixes (logging):
+Only log about no longer having KIST support once. Fixes bug 24158; bugfix
+on 0.3.2
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index 1438dc60f..dabac386d 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -171,6 +171,8 @@ STATIC smartlist_t *channels_pending = NULL;
  */
 STATIC struct event *run_sched_ev = NULL;
 
+static int have_logged_kist_suddenly_disabled = 0;
+
 /*
  * Scheduling system static function definitions
  *
@@ -252,13 +254,31 @@ select_scheduler(void)
 case SCHEDULER_KIST:
   if (!scheduler_can_use_kist()) {
 #ifdef HAVE_KIST_SUPPORT
-log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "
- "the consensus or no kernel support.");
+if (!have_logged_kist_suddenly_disabled) {
+  /* We should only log this once in most cases. If it was the kernel
+   * losing support for kist that caused scheduler_can_use_kist() to
+   * return false, then this flag makes sure we only log this message
+   * once. If it was the consensus that switched from "yes use kist" to
+   * "no don't use kist", then we still set the flag so we log once, 
but
+   * we unset the flag elsewhere if we ever can_use_kist() again.
+   */
+  have_logged_kist_suddenly_disabled = 1;
+  log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "
+   "the consensus or no kernel support.");
+}
 #else /* !(defined(HAVE_KIST_SUPPORT)) */
 log_info(LD_SCHED, "Scheduler type KIST not built in");
 #endif /* defined(HAVE_KIST_SUPPORT) */
 continue;
   }
+  /* This flag will only get set in one of two cases:
+   * 1 - the kernel lost support for kist. In that case, we don't expect to
+   * ever end up here
+   * 2 - the consensus went from "yes use kist" to "no don't use kist".
+   * We might end up here if the consensus changes back to "yes", in which
+   * case we might want to warn the user again if it goes back to "no"
+   * yet again. Thus we unset the flag */
+  have_logged_kist_suddenly_disabled = 0;
   new_scheduler = get_kist_scheduler();
   scheduler_kist_set_full_mode();
   goto end;



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


[tor-commits] [tor/master] Add notes about OS support for our scheduler types

2017-11-17 Thread nickm
commit 3537f7801dbf6f72e641e7fe1430db755ee5b920
Author: Matt Traudt 
Date:   Thu Nov 16 09:21:12 2017 -0500

Add notes about OS support for our scheduler types
---
 changes/ticket24254 | 3 +++
 doc/tor.1.txt   | 8 +---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/changes/ticket24254 b/changes/ticket24254
new file mode 100644
index 0..80dd74125
--- /dev/null
+++ b/changes/ticket24254
@@ -0,0 +1,3 @@
+  o Documentation:
+Add notes in man page regarding OS support for the various scheduler types.
+Closes ticket 24254.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f05246433..f627659f5 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -801,14 +801,16 @@ GENERAL OPTIONS
  +
 **KIST**: Kernel Informed Socket Transport. Tor will use the kernel tcp
 information stack per-socket to make an informed decision on if it should
-send or not the data. (Only available on Linux)
+send or not the data. As implemented, KIST will only work on Linux kernel
+version 2.6.39 or higher.
  +
 **KISTLite**: Same as KIST but without kernel support which means that tor
 will use all the same mecanics as KIST but without the TCP information the
-kernel can provide.
+kernel can provide. KISTLite will work on all kernels and operating
+systems.
  +
 **Vanilla**: The scheduler that tor has always used that is do as much as
-possible or AMAP.
+possible or AMAP. Vanilla will work on all kernels and operating systems.
 
 [[KISTSchedRunInterval]] **KISTSchedRunInterval** __NUM__ **msec**::
 If KIST or KISTLite is used in Schedulers option, this control at which



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


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

2017-11-17 Thread nickm
commit 94dce246ee97884a546113827404a45d0f16c648
Merge: cfacd4424 b98614f1a
Author: Nick Mathewson 
Date:   Fri Nov 17 09:26:11 2017 -0500

Merge branch 'maint-0.3.2'

 changes/ticket24158 |  3 +++
 changes/ticket24254 |  3 +++
 doc/tor.1.txt   | 34 +-
 src/or/scheduler.c  | 24 ++--
 4 files changed, 49 insertions(+), 15 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.3.2] Add notes about OS support for our scheduler types

2017-11-17 Thread nickm
commit 3537f7801dbf6f72e641e7fe1430db755ee5b920
Author: Matt Traudt 
Date:   Thu Nov 16 09:21:12 2017 -0500

Add notes about OS support for our scheduler types
---
 changes/ticket24254 | 3 +++
 doc/tor.1.txt   | 8 +---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/changes/ticket24254 b/changes/ticket24254
new file mode 100644
index 0..80dd74125
--- /dev/null
+++ b/changes/ticket24254
@@ -0,0 +1,3 @@
+  o Documentation:
+Add notes in man page regarding OS support for the various scheduler types.
+Closes ticket 24254.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f05246433..f627659f5 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -801,14 +801,16 @@ GENERAL OPTIONS
  +
 **KIST**: Kernel Informed Socket Transport. Tor will use the kernel tcp
 information stack per-socket to make an informed decision on if it should
-send or not the data. (Only available on Linux)
+send or not the data. As implemented, KIST will only work on Linux kernel
+version 2.6.39 or higher.
  +
 **KISTLite**: Same as KIST but without kernel support which means that tor
 will use all the same mecanics as KIST but without the TCP information the
-kernel can provide.
+kernel can provide. KISTLite will work on all kernels and operating
+systems.
  +
 **Vanilla**: The scheduler that tor has always used that is do as much as
-possible or AMAP.
+possible or AMAP. Vanilla will work on all kernels and operating systems.
 
 [[KISTSchedRunInterval]] **KISTSchedRunInterval** __NUM__ **msec**::
 If KIST or KISTLite is used in Schedulers option, this control at which



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


[tor-commits] [tor/maint-0.3.2] Use less jargon in Scheduler sec. of man page

2017-11-17 Thread nickm
commit 8b2c01a46f4353deaa37d129bd21f32b4d990d1d
Author: Matt Traudt 
Date:   Thu Nov 16 14:32:17 2017 -0500

Use less jargon in Scheduler sec. of man page
---
 changes/ticket24254 |  2 +-
 doc/tor.1.txt   | 36 +---
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/changes/ticket24254 b/changes/ticket24254
index 80dd74125..98d5d6bac 100644
--- a/changes/ticket24254
+++ b/changes/ticket24254
@@ -1,3 +1,3 @@
   o Documentation:
 Add notes in man page regarding OS support for the various scheduler types.
-Closes ticket 24254.
+Attempt to use less jargon in the scheduler section. Closes ticket 24254.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f627659f5..fc285ebe1 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -791,29 +791,35 @@ GENERAL OPTIONS
 restarting Tor. (Default: 0)
 
 [[Schedulers]] **Schedulers** **KIST**|**KISTLite**|**Vanilla**::
-Specify the scheduler type that tor should use to handle outbound data on
-channels. This is an ordered list by priority which means that the first
-value will be tried first and if unavailable, the second one is tried and
-so on. It is possible to change thse values at runtime.
+Specify the scheduler type that tor should use. The scheduler is
+responsible for moving data around within a Tor process. This is an ordered
+list by priority which means that the first value will be tried first and 
if
+unavailable, the second one is tried and so on. It is possible to change
+these values at runtime. This option mostly effects relays, and most
+operators should leave it set to its default value.
 (Default: KIST,KISTLite,Vanilla)
  +
 The possible scheduler types are:
  +
-**KIST**: Kernel Informed Socket Transport. Tor will use the kernel tcp
-information stack per-socket to make an informed decision on if it should
-send or not the data. As implemented, KIST will only work on Linux kernel
-version 2.6.39 or higher.
+**KIST**: Kernel-Informed Socket Transport. Tor will use TCP information
+from the kernel to make informed decisions regarding how much data to send
+and when to send it. KIST also handles traffic in batches (see
+KISTSchedRunInterval) in order to improve traffic prioritization decisions.
+As implemented, KIST will only work on Linux kernel version 2.6.39 or
+higher.
  +
-**KISTLite**: Same as KIST but without kernel support which means that tor
-will use all the same mecanics as KIST but without the TCP information the
-kernel can provide. KISTLite will work on all kernels and operating
-systems.
+**KISTLite**: Same as KIST but without kernel support. Tor will use all
+the same mechanics as with KIST, including the batching, but its decisions
+regarding how much data to send will not be as good. KISTLite will work on
+all kernels and operating systems, and the majority of the benefits of KIST
+are still realized with KISTLite.
  +
-**Vanilla**: The scheduler that tor has always used that is do as much as
-possible or AMAP. Vanilla will work on all kernels and operating systems.
+**Vanilla**: The scheduler that Tor used before KIST was implemented. It
+sends as much data as possible, as soon as possible. Vanilla will work on
+all kernels and operating systems.
 
 [[KISTSchedRunInterval]] **KISTSchedRunInterval** __NUM__ **msec**::
-If KIST or KISTLite is used in Schedulers option, this control at which
+If KIST or KISTLite is used in the Schedulers option, this controls at 
which
 interval the scheduler tick is. If the value is 0 msec, the value is taken
 from the consensus if possible else it will fallback to the default 10
 msec. Maximum possible value is 100 msec. (Default: 0 msec)



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


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

2017-11-17 Thread nickm
commit 330ccb699ed445f661fe04cad7917d7346ad1615
Merge: b2e191001 b98614f1a
Author: Nick Mathewson 
Date:   Fri Nov 17 09:26:11 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/ticket24158 |  3 +++
 changes/ticket24254 |  3 +++
 doc/tor.1.txt   | 34 +-
 src/or/scheduler.c  | 24 ++--
 4 files changed, 49 insertions(+), 15 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.3.2] Add notes about OS support for our scheduler types

2017-11-17 Thread nickm
commit 3537f7801dbf6f72e641e7fe1430db755ee5b920
Author: Matt Traudt 
Date:   Thu Nov 16 09:21:12 2017 -0500

Add notes about OS support for our scheduler types
---
 changes/ticket24254 | 3 +++
 doc/tor.1.txt   | 8 +---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/changes/ticket24254 b/changes/ticket24254
new file mode 100644
index 0..80dd74125
--- /dev/null
+++ b/changes/ticket24254
@@ -0,0 +1,3 @@
+  o Documentation:
+Add notes in man page regarding OS support for the various scheduler types.
+Closes ticket 24254.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f05246433..f627659f5 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -801,14 +801,16 @@ GENERAL OPTIONS
  +
 **KIST**: Kernel Informed Socket Transport. Tor will use the kernel tcp
 information stack per-socket to make an informed decision on if it should
-send or not the data. (Only available on Linux)
+send or not the data. As implemented, KIST will only work on Linux kernel
+version 2.6.39 or higher.
  +
 **KISTLite**: Same as KIST but without kernel support which means that tor
 will use all the same mecanics as KIST but without the TCP information the
-kernel can provide.
+kernel can provide. KISTLite will work on all kernels and operating
+systems.
  +
 **Vanilla**: The scheduler that tor has always used that is do as much as
-possible or AMAP.
+possible or AMAP. Vanilla will work on all kernels and operating systems.
 
 [[KISTSchedRunInterval]] **KISTSchedRunInterval** __NUM__ **msec**::
 If KIST or KISTLite is used in Schedulers option, this control at which



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


[tor-commits] [tor/maint-0.3.2] Only log about lost KIST support once

2017-11-17 Thread nickm
commit b98614f1af6ed10aa0e3cd00d5baf57fb534f574
Author: Matt Traudt 
Date:   Thu Nov 16 14:38:39 2017 -0500

Only log about lost KIST support once
---
 changes/ticket24158 |  3 +++
 src/or/scheduler.c  | 24 ++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/changes/ticket24158 b/changes/ticket24158
new file mode 100644
index 0..3cdc06afa
--- /dev/null
+++ b/changes/ticket24158
@@ -0,0 +1,3 @@
+  o Minor bugfixes (logging):
+Only log about no longer having KIST support once. Fixes bug 24158; bugfix
+on 0.3.2
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index 1438dc60f..dabac386d 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -171,6 +171,8 @@ STATIC smartlist_t *channels_pending = NULL;
  */
 STATIC struct event *run_sched_ev = NULL;
 
+static int have_logged_kist_suddenly_disabled = 0;
+
 /*
  * Scheduling system static function definitions
  *
@@ -252,13 +254,31 @@ select_scheduler(void)
 case SCHEDULER_KIST:
   if (!scheduler_can_use_kist()) {
 #ifdef HAVE_KIST_SUPPORT
-log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "
- "the consensus or no kernel support.");
+if (!have_logged_kist_suddenly_disabled) {
+  /* We should only log this once in most cases. If it was the kernel
+   * losing support for kist that caused scheduler_can_use_kist() to
+   * return false, then this flag makes sure we only log this message
+   * once. If it was the consensus that switched from "yes use kist" to
+   * "no don't use kist", then we still set the flag so we log once, 
but
+   * we unset the flag elsewhere if we ever can_use_kist() again.
+   */
+  have_logged_kist_suddenly_disabled = 1;
+  log_notice(LD_SCHED, "Scheduler type KIST has been disabled by "
+   "the consensus or no kernel support.");
+}
 #else /* !(defined(HAVE_KIST_SUPPORT)) */
 log_info(LD_SCHED, "Scheduler type KIST not built in");
 #endif /* defined(HAVE_KIST_SUPPORT) */
 continue;
   }
+  /* This flag will only get set in one of two cases:
+   * 1 - the kernel lost support for kist. In that case, we don't expect to
+   * ever end up here
+   * 2 - the consensus went from "yes use kist" to "no don't use kist".
+   * We might end up here if the consensus changes back to "yes", in which
+   * case we might want to warn the user again if it goes back to "no"
+   * yet again. Thus we unset the flag */
+  have_logged_kist_suddenly_disabled = 0;
   new_scheduler = get_kist_scheduler();
   scheduler_kist_set_full_mode();
   goto end;

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


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

2017-11-17 Thread nickm
commit b2e1910017ca19783871877456205aa4a0bee4a6
Merge: 00aeecb39 85778dc92
Author: Nick Mathewson 
Date:   Fri Nov 17 09:23:07 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

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


[tor-commits] [tor/release-0.3.2] Merge remote-tracking branch 'dgoulet/bug23861_032_01' into maint-0.3.2

2017-11-17 Thread nickm
commit 85778dc92d652e4781812659590099ae9232e175
Merge: 3a364309a 380a95116
Author: Nick Mathewson 
Date:   Fri Nov 17 09:23:04 2017 -0500

Merge remote-tracking branch 'dgoulet/bug23861_032_01' into maint-0.3.2

 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)



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


[tor-commits] [tor/maint-0.3.2] Merge remote-tracking branch 'dgoulet/bug23861_032_01' into maint-0.3.2

2017-11-17 Thread nickm
commit 85778dc92d652e4781812659590099ae9232e175
Merge: 3a364309a 380a95116
Author: Nick Mathewson 
Date:   Fri Nov 17 09:23:04 2017 -0500

Merge remote-tracking branch 'dgoulet/bug23861_032_01' into maint-0.3.2

 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

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


[tor-commits] [tor/master] relay: Avoid extra LOG_NOTICE for every new descriptor batch

2017-11-17 Thread nickm
commit 380a95116a0e582eca0cc643eb0bca65c3820c86
Author: David Goulet 
Date:   Thu Nov 16 10:51:41 2017 -0500

relay: Avoid extra LOG_NOTICE for every new descriptor batch

Commit 56c5e282a733912776f6dacbe4f5df66b4fb9606 suppressed that same log
statement in directory_info_has_arrived() for microdescriptors so do the 
same
for the descriptors. As the commit says, we already have the bootstrap
progress for this.

Fixes #23861

Signed-off-by: David Goulet 
---
 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug23861 b/changes/bug23861
new file mode 100644
index 0..c6f017640
--- /dev/null
+++ b/changes/bug23861
@@ -0,0 +1,5 @@
+  o Minor bugfixes (logging, relay):
+- Suppress a log notice when relay descriptors arrive. We already have a
+  bootstrap progress for this so no need to log notice everytime tor
+  receives relay descriptors. Microdescriptors behave the same. Fixes bug
+  23861; bugfix on 0.2.8.2-alpha.
diff --git a/src/or/directory.c b/src/or/directory.c
index 836f86298..b3dbb0d1e 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2889,7 +2889,7 @@ handle_response_fetch_desc(dir_connection_t *conn,
   conn->router_purpose,
   conn->base_.address)) {
 time_t now = approx_time();
-directory_info_has_arrived(now, 0, 0);
+directory_info_has_arrived(now, 0, 1);
   }
 }
   }



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


[tor-commits] [tor/release-0.3.2] relay: Avoid extra LOG_NOTICE for every new descriptor batch

2017-11-17 Thread nickm
commit 380a95116a0e582eca0cc643eb0bca65c3820c86
Author: David Goulet 
Date:   Thu Nov 16 10:51:41 2017 -0500

relay: Avoid extra LOG_NOTICE for every new descriptor batch

Commit 56c5e282a733912776f6dacbe4f5df66b4fb9606 suppressed that same log
statement in directory_info_has_arrived() for microdescriptors so do the 
same
for the descriptors. As the commit says, we already have the bootstrap
progress for this.

Fixes #23861

Signed-off-by: David Goulet 
---
 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug23861 b/changes/bug23861
new file mode 100644
index 0..c6f017640
--- /dev/null
+++ b/changes/bug23861
@@ -0,0 +1,5 @@
+  o Minor bugfixes (logging, relay):
+- Suppress a log notice when relay descriptors arrive. We already have a
+  bootstrap progress for this so no need to log notice everytime tor
+  receives relay descriptors. Microdescriptors behave the same. Fixes bug
+  23861; bugfix on 0.2.8.2-alpha.
diff --git a/src/or/directory.c b/src/or/directory.c
index 836f86298..b3dbb0d1e 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2889,7 +2889,7 @@ handle_response_fetch_desc(dir_connection_t *conn,
   conn->router_purpose,
   conn->base_.address)) {
 time_t now = approx_time();
-directory_info_has_arrived(now, 0, 0);
+directory_info_has_arrived(now, 0, 1);
   }
 }
   }



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


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

2017-11-17 Thread nickm
commit cfacd4424009a78b6a737cd17fdf2fec60b77374
Merge: eb793c31c 85778dc92
Author: Nick Mathewson 
Date:   Fri Nov 17 09:23:07 2017 -0500

Merge branch 'maint-0.3.2'

 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

___
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/bug23861_032_01' into maint-0.3.2

2017-11-17 Thread nickm
commit 85778dc92d652e4781812659590099ae9232e175
Merge: 3a364309a 380a95116
Author: Nick Mathewson 
Date:   Fri Nov 17 09:23:04 2017 -0500

Merge remote-tracking branch 'dgoulet/bug23861_032_01' into maint-0.3.2

 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)



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


[tor-commits] [tor/maint-0.3.2] relay: Avoid extra LOG_NOTICE for every new descriptor batch

2017-11-17 Thread nickm
commit 380a95116a0e582eca0cc643eb0bca65c3820c86
Author: David Goulet 
Date:   Thu Nov 16 10:51:41 2017 -0500

relay: Avoid extra LOG_NOTICE for every new descriptor batch

Commit 56c5e282a733912776f6dacbe4f5df66b4fb9606 suppressed that same log
statement in directory_info_has_arrived() for microdescriptors so do the 
same
for the descriptors. As the commit says, we already have the bootstrap
progress for this.

Fixes #23861

Signed-off-by: David Goulet 
---
 changes/bug23861   | 5 +
 src/or/directory.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug23861 b/changes/bug23861
new file mode 100644
index 0..c6f017640
--- /dev/null
+++ b/changes/bug23861
@@ -0,0 +1,5 @@
+  o Minor bugfixes (logging, relay):
+- Suppress a log notice when relay descriptors arrive. We already have a
+  bootstrap progress for this so no need to log notice everytime tor
+  receives relay descriptors. Microdescriptors behave the same. Fixes bug
+  23861; bugfix on 0.2.8.2-alpha.
diff --git a/src/or/directory.c b/src/or/directory.c
index 836f86298..b3dbb0d1e 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2889,7 +2889,7 @@ handle_response_fetch_desc(dir_connection_t *conn,
   conn->router_purpose,
   conn->base_.address)) {
 time_t now = approx_time();
-directory_info_has_arrived(now, 0, 0);
+directory_info_has_arrived(now, 0, 1);
   }
 }
   }



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


[tor-commits] [webwml/staging] Fix dropdown top link

2017-11-17 Thread hiro
commit 4d9fe21e8e2b241d73a1ff581382d5d4684c409b
Author: hiromipaw 
Date:   Fri Nov 17 15:01:22 2017 +0100

Fix dropdown top link
---
 css/layout.css | 1 +
 css/layout.min.css | 2 +-
 include/dlhead.wmi | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/css/layout.css b/css/layout.css
index 46a32d37..33b30c00 100644
--- a/css/layout.css
+++ b/css/layout.css
@@ -1337,6 +1337,7 @@ p.blogDate {
 background-color: #f9f9f9;
 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
 z-index: 1;
+margin: 48px 0 0 0;
 }
 
 /* Links inside the dropdown */
diff --git a/css/layout.min.css b/css/layout.min.css
index e13dc744..4bdb092e 100644
--- a/css/layout.min.css
+++ b/css/layout.min.css
@@ -1 +1 @@
-@charset "UTF-8";body{background:#fff}#wrap{width:960px;margin:0 
auto}.left{float:left}.right{float:right}.twenty{width:20%}.thirty{width:30%}.forty{width:40%}.fifty{width:50%}.sixty{width:60%}.hundred{width:100%}.nopad{padding:0}.toppad{padding-top:10px}.toptwenty{margin-top:20px}.topforty{margin-top:40px}.hidden{display:none}#header{width:960px;height:97px;margin-bottom:23px;position:relative}h1#logo{margin:0;float:left}h1#logo
 a,h1#logo a:visited{background:url(../images/tor-logo.jpg) left top 
no-repeat;text-indent:-px;overflow:hidden;width:150px;height:97px;display:block}#nav{position:absolute;top:30px;left:130px;float:right}#nav
 ul{height:50px;float:right;margin-bottom:0}#nav ul 
li{float:left;display:inline;width:auto}#calltoaction{height:30px;float:right;margin-top:100px;margin-right:5px;text-align:center}#calltoaction
 ul{padding:0;margin:0;height:30px;list-style:none;float:right}#calltoaction ul 
li{list-style:none;display:inline;float:none;width:100px;margin-left:0}#callt
 oaction ul li a:link,#calltoaction ul li 
a:visited{display:block;background:url(../images/cta-buttons.jpg) top center 
no-repeat #885ca4;padding:4px 
8px;color:#fff;font-weight:bold;text-decoration:none;font-size:13px;line-height:22px;height:22px;width:84px;float:left;text-shadow:1px
 1px 0 #111}#calltoaction ul li:hover 
a{background:url(../images/cta-buttons.jpg) bottom center no-repeat 
#ff9800;font-weight:bold;text-shadow:1px 1px 0 #111}#calltoaction ul 
li:first-child a:link,#calltoaction ul li:first-child a:visited,#calltoaction 
ul li:hover:first-child 
a{-webkit-border-top-left-radius:7px;-webkit-border-bottom-left-radius:7px;-moz-border-radius-topleft:7px;-moz-border-radius-bottomleft:7px;border-top-left-radius:7px;border-bottom-left-radius:7px}#calltoaction
 ul li:first-child a:link,#calltoaction ul li:first-child 
a:visited{background:url(../images/cta-buttons.jpg) top left no-repeat 
#885ca4}#calltoaction ul li:hover:first-child 
a{background:url(../images/cta-buttons.jpg) bottom le
 ft no-repeat #ff9800}#calltoaction ul li:last-child a:link,#calltoaction ul 
li:last-child a:visited,#calltoaction ul li:hover:last-child 
a{-webkit-border-top-right-radius:7px;-webkit-border-bottom-right-radius:7px;-moz-border-radius-topright:7px;-moz-border-radius-bottomright:7px;border-top-right-radius:7px;border-bottom-right-radius:7px}#calltoaction
 ul li:last-child a:link,#calltoaction ul li:last-child 
a:visited{background:url(../images/cta-buttons.jpg) top right no-repeat 
#885ca4;color:#fff}#calltoaction ul li:hover:last-child 
a{background:url(../images/cta-buttons.jpg) bottom right no-repeat 
#ff9800}#banner{background:url(../images/bg-banner.jpg) left top 
no-repeat;height:200px;width:600px;padding:23px 
15px;margin-bottom:15px}#download a:link,#download a:visited{margin:-17px 0 
0;background:url(../images/button-download.png) left top 
no-repeat;width:257px;height:79px;float:left;padding:35px 0 0 
80px;text-decoration:none}#download a 
.download-tor{background:url(../images/button-d
 ownload-arrow.png) right center no-repeat;font-family:"Arial 
Narrow",Arial,sans-serif;color:#fff;font-size:2.167em;letter-spacing:1px;padding-right:25px}#download
 a .version{color:#bda5cc;font-size:1.167em;line-height:1.167em}#download a 
.info{color:#bda5cc;font-size:.833em;line-height:.833em}#download 
a:hover{background-position:0 -114px}#download a:hover .version,#download 
a:hover .info{color:#f1c6a1}#banner ul{background:#387520 
url(../images/banner-gradient.jpg) left top repeat-x;border:1px solid 
#366b32;width:180px;float:right;margin:0 15px 0 0;padding:10px 10px 10px 
30px}#banner ul li{list-style:url(../images/white-bullet.png) 
outside;padding:5px 0}#content{width:960px}#content 
img{max-width:710px}#breadcrumbs{padding:0 0 10px 5px}#home 
#maincol{float:left;width:620px;margin-right:20px}#maincol{float:right;width:710px;margin-bottom:20px}#dow-don-left,#maincol-left{float:left;width:710px;margin-bottom:20px}#maincol
 .topforty .icon img{border:0}.subcol{width:280px;float:left;mar
 gin:0 0 25px}#content .first{margin-right:20px}#home 

[tor-commits] [onionoo/master] Bump version to 4.3-1.7.0-dev.

2017-11-17 Thread karsten
commit 022c89b919076e2d91677044b3de50a800fa98b4
Author: Karsten Loesing 
Date:   Fri Nov 17 14:49:47 2017 +0100

Bump version to 4.3-1.7.0-dev.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index b4ef4d2..dd2967f 100644
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
   
   
   
+value="${onionoo.protocol.version}-1.7.0-dev"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/release] Add tests for "unreachable_or_addresses" field.

2017-11-17 Thread karsten
commit 550d60e01d4e44137739fc6d27c16863793d5a7f
Author: Karsten Loesing 
Date:   Thu Nov 16 21:33:56 2017 +0100

Add tests for "unreachable_or_addresses" field.
---
 .../onionoo/writer/DetailsDocumentWriterTest.java  | 100 +
 1 file changed, 100 insertions(+)

diff --git 
a/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java 
b/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java
new file mode 100644
index 000..3356a9c
--- /dev/null
+++ b/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java
@@ -0,0 +1,100 @@
+package org.torproject.onionoo.writer;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.torproject.onionoo.docs.DetailsDocument;
+import org.torproject.onionoo.docs.DetailsStatus;
+import org.torproject.onionoo.docs.DocumentStoreFactory;
+import org.torproject.onionoo.docs.DummyDocumentStore;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.TreeSet;
+
+public class DetailsDocumentWriterTest {
+
+  private DummyDocumentStore documentStore;
+
+  @Before
+  public void createDummyDocumentStore() {
+this.documentStore = new DummyDocumentStore();
+DocumentStoreFactory.setDocumentStore(this.documentStore);
+  }
+
+  @Test
+  public void testNoDetailsStatuses() {
+DetailsDocumentWriter writer = new DetailsDocumentWriter();
+writer.writeDocuments();
+assertEquals("Without statuses, no documents should be written.", 0,
+this.documentStore.getPerformedStoreOperations());
+  }
+
+  private static final String GABELMOO_FINGERPRINT =
+  "F2044413DAC2E02E3D6BCF4735A19BCA1DE97281";
+
+  private static final String GABELMOO_OR_ADDRESS =
+  "[2001:638:a000:4140:::189]:443]";
+
+  @Test
+  public void testAdvertisedAndReachableOrAddress() {
+DetailsStatus status = new DetailsStatus();
+status.setRelay(true);
+status.setAdvertisedOrAddresses(Arrays.asList(GABELMOO_OR_ADDRESS));
+status.setOrAddressesAndPorts(new TreeSet<>(Arrays.asList(
+GABELMOO_OR_ADDRESS)));
+this.documentStore.addDocument(status, GABELMOO_FINGERPRINT);
+DetailsDocumentWriter writer = new DetailsDocumentWriter();
+writer.writeDocuments();
+assertEquals("One document should be written.", 1,
+this.documentStore.getPerformedStoreOperations());
+DetailsDocument document = this.documentStore.getDocument(
+DetailsDocument.class, GABELMOO_FINGERPRINT);
+assertNotNull("There should be a document for the given fingerprint.",
+document);
+assertNull("Document should not contain any unreachable OR addresses.",
+document.getUnreachableOrAddresses());
+  }
+
+  @Test
+  public void testUnadvertisedButSomehowReachableOrAddress() {
+DetailsStatus status = new DetailsStatus();
+status.setRelay(true);
+status.setOrAddressesAndPorts(new TreeSet<>(Arrays.asList(
+GABELMOO_OR_ADDRESS)));
+this.documentStore.addDocument(status, GABELMOO_FINGERPRINT);
+DetailsDocumentWriter writer = new DetailsDocumentWriter();
+writer.writeDocuments();
+assertEquals("One document should be written.", 1,
+this.documentStore.getPerformedStoreOperations());
+DetailsDocument document = this.documentStore.getDocument(
+DetailsDocument.class, GABELMOO_FINGERPRINT);
+assertNotNull("There should be a document for the given fingerprint.",
+document);
+assertNull("Document should not contain unreachable OR addresses.",
+document.getUnreachableOrAddresses());
+  }
+
+  @Test
+  public void testAdvertisedButUnreachableOrAddress() {
+DetailsStatus status = new DetailsStatus();
+status.setRelay(true);
+status.setAdvertisedOrAddresses(Arrays.asList(GABELMOO_OR_ADDRESS));
+this.documentStore.addDocument(status, GABELMOO_FINGERPRINT);
+DetailsDocumentWriter writer = new DetailsDocumentWriter();
+writer.writeDocuments();
+assertEquals("One document should be written.", 1,
+this.documentStore.getPerformedStoreOperations());
+DetailsDocument document = this.documentStore.getDocument(
+DetailsDocument.class, GABELMOO_FINGERPRINT);
+assertNotNull("There should be a document for the given fingerprint.",
+document);
+assertEquals("Document should contain one unreachable OR address.",
+Arrays.asList(GABELMOO_OR_ADDRESS),
+document.getUnreachableOrAddresses());
+  }
+}
+



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


[tor-commits] [onionoo/release] Prepare for 4.3-1.7.0 release.

2017-11-17 Thread karsten
commit 5b43b4d7f53603831fcbbad45321b12969f13046
Author: Karsten Loesing 
Date:   Fri Nov 17 11:33:20 2017 +0100

Prepare for 4.3-1.7.0 release.
---
 CERT | 20 ++--
 CHANGELOG.md |  2 +-
 build.xml|  4 ++--
 .../torproject/onionoo/server/ResponseBuilder.java   |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/CERT b/CERT
index d94c0c3..ca92db0 100644
--- a/CERT
+++ b/CERT
@@ -1,8 +1,8 @@
 -BEGIN CERTIFICATE-
-MIIDaTCCAlGgAwIBAgIEZTniETANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJV
+MIIDaTCCAlGgAwIBAgIEPrK+4DANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJV
 UzELMAkGA1UECBMCV0ExEDAOBgNVBAcTB1NlYXR0bGUxHTAbBgNVBAoTFFRoZSBU
-b3IgUHJvamVjdCwgSW5jMRgwFgYDVQQDEw9LYXJzdGVuIExvZXNpbmcwHhcNMTcw
-ODE3MTg1MDQ0WhcNMTcxMTE1MTg1MDQ0WjBlMQswCQYDVQQGEwJVUzELMAkGA1UE
+b3IgUHJvamVjdCwgSW5jMRgwFgYDVQQDEw9LYXJzdGVuIExvZXNpbmcwHhcNMTcx
+MTE3MTA0MDQ5WhcNMTgwMjE1MTA0MDQ5WjBlMQswCQYDVQQGEwJVUzELMAkGA1UE
 CBMCV0ExEDAOBgNVBAcTB1NlYXR0bGUxHTAbBgNVBAoTFFRoZSBUb3IgUHJvamVj
 dCwgSW5jMRgwFgYDVQQDEw9LYXJzdGVuIExvZXNpbmcwggEiMA0GCSqGSIb3DQEB
 AQUAA4IBDwAwggEKAoIBAQChXn+IUp+o6G+k4ffxk3TkxZb3iXfiG7byNsG63olU
@@ -11,11 +11,11 @@ 
Qw+VAhKTcEIv4yiR0BWapQyR07pgmKirYVjN6s6ef8NJzUptpxLlaYJ3ZfQfc4aE
 MXzScgaccwDFIWQ661lzLGCfeSxxa3Xy4wWsGwzNzLITYrrABcbg7yogLo2btNvD
 oEwGL3/baQdhl0dra6biVCZr9ydn3Hg57S55pUU0rBY25id78zUO8xrfNHw54wwX
 lOblGt75OOkahP/ZZSBxxoiknJ6y5VQV8y+noA4vigXFAgMBAAGjITAfMB0GA1Ud
-DgQWBBSeh60M+/wMYyYhlxtuff2Hk9n7bzANBgkqhkiG9w0BAQsFAAOCAQEAbsAc
-gwl5KJH3pVKw4b+ACCOMgW+27MisCFbT1Izq2Wx+JcLMt3N//MoIpYOZWhsIeazW
-/NE0fNbkLi0IYA0F1nUC9pHl44Hd8Gjfqa/YQUi9ALtgsY7l6W0sceW8WnZ8bu8J
-DfrqnmB0bD2xc9ZjOn58al8dVjVWs95M87D9WCRU6LiaKFj5c45wciABQsTmC0qD
-pyHYOaSGtXxXKDw5pAntdtHkCbowV5tDi/QQ8Tg7i5O7xwSh71Q7TZiNFMpLomBL
-QllHfTZryFmoHyGn5MfngBUVCVHig5nXmk0dUMGuLiK4789dkgiPRz0vpB5Yf8Yy
-CCE2jB6VBi2g5fMx0w==
+DgQWBBSeh60M+/wMYyYhlxtuff2Hk9n7bzANBgkqhkiG9w0BAQsFAAOCAQEAIqRy
+T4uMqw1WwZ8CtJx5kSs/or+5025bGK6V2dY/jYapZcbyG7sq3KVFAqLik8Yn7a0D
+dfbmtR7r2jbkWhYppa7MGSQ6SMG6nxas05l8yf9ShDnNLtJoay8JyGPeucaFyEwV
+VxwN9/I4M4chrrvBzpMB/1U3oJxlKR+nssh4w55DoUijk3vHn01+20EPU9uNJrsr
+mXhcrJLU/4R952ZMLxtiBfNP7vaxLpQctNqZxEfa9/rm0pLlfd2t62BWf8kkGqEy
+Ke4WdNpQwk3WKjFlKWcvsF6ztJJlwA+qHk4IB9PynVRNggWimBrxWigbeBL8qpML
+A5xMtX/MHDXreWGaKA==
 -END CERTIFICATE-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c48075e..1b7c400 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-# Changes in version 4.3-1.7.0 - 2017-1?-??
+# Changes in version 4.3-1.7.0 - 2017-11-17
 
  * Medium changes
- Support quoted qualified search terms.
diff --git a/build.xml b/build.xml
index 3e70421..b4ef4d2 100644
--- a/build.xml
+++ b/build.xml
@@ -8,9 +8,9 @@
 
   
   
-  
+  
   
+value="${onionoo.protocol.version}-1.7.0"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/release] Re-schedule next major version.

2017-11-17 Thread karsten
commit a641e1009bcefa8420f9a36b7b24a8a25b85e1ba
Author: Karsten Loesing 
Date:   Fri Nov 17 11:28:54 2017 +0100

Re-schedule next major version.

We said we'd announce new major versions 1 month in advance. Today
we're going to put out a release to include this date for the first
time. Re-scheduling next major version for in 1 month from today.
---
 src/main/java/org/torproject/onionoo/server/ResponseBuilder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java 
b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index 12885c5..eda71c1 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -125,7 +125,7 @@ public class ResponseBuilder {
 
   private static final String PROTOCOL_VERSION = "4.2";
 
-  private static final String NEXT_MAJOR_VERSION_SCHEDULED = "2017-11-30";
+  private static final String NEXT_MAJOR_VERSION_SCHEDULED = "2017-12-17";
 
   private void writeRelays(List relays, PrintWriter pw) {
 this.write(pw, "{\"version\":\"%s\",\n", PROTOCOL_VERSION);



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


[tor-commits] [onionoo/release] Increase test timeout from 100 to 200ms.

2017-11-17 Thread karsten
commit efa4cd87935e7ce0a6979506b53a44c32b932c2b
Author: Karsten Loesing 
Date:   Mon Oct 30 17:00:24 2017 +0100

Increase test timeout from 100 to 200ms.

The testCountryDeDe typically requires around 80 to 100ms to complete,
which makes our test timeout of 100ms somewhat optimistic. The reason
is that it's the first test method that is run in this test class, and
it takes some time to initialize the test environment. This is just a
hotfix, but it's also not really a serious problem, so maybe it'll
just do.
---
 src/test/java/org/torproject/onionoo/server/ResourceServletTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java 
b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index 1588f8a..e41eecc 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -1104,7 +1104,7 @@ public class ResourceServletTest {
 null);
   }
 
-  @Test(timeout = 100)
+  @Test(timeout = 200)
   public void testCountryDeDe() {
 this.assertSummaryDocument(
 "/summary?country=de=de", 1, new String[] { "TorkaZ" }, 0,



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


[tor-commits] [onionoo/release] Update metrics-base.

2017-11-17 Thread karsten
commit 06206010ec6061dedc4477f49cf762f64fad1901
Author: Karsten Loesing 
Date:   Fri Nov 3 16:16:33 2017 +0100

Update metrics-base.
---
 src/build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/build b/src/build
index 4b34756..23c6e0b 16
--- a/src/build
+++ b/src/build
@@ -1 +1 @@
-Subproject commit 4b34756ddd71ccaf0fc30e5f5bf0a813a297d4a3
+Subproject commit 23c6e0be5fab9463f137615053ef412e4da2315e



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


[tor-commits] [onionoo/release] Add "unreachable_or_addresses" field.

2017-11-17 Thread karsten
commit 7aca1ca996bcfd75a275a799fd42a29c8cb0080b
Author: Karsten Loesing 
Date:   Wed Oct 18 09:20:33 2017 +0200

Add "unreachable_or_addresses" field.

Implements #21637.
---
 CHANGELOG.md   |  2 ++
 src/main/java/org/torproject/onionoo/docs/DetailsDocument.java | 10 ++
 src/main/java/org/torproject/onionoo/docs/DetailsStatus.java   | 10 ++
 .../torproject/onionoo/updater/NodeDetailsStatusUpdater.java   |  1 +
 .../org/torproject/onionoo/writer/DetailsDocumentWriter.java   | 10 ++
 5 files changed, 33 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 76243ef..c48075e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@
- Skip unrecognized descriptors when importing archives rather than
  aborting the entire import.
- Add new "host_name" parameter to filter by host name.
+   - Add new "unreachable_or_addresses" field with declared but
+ unreachable OR addresses.
 
 
 # Changes in version 4.2-1.6.1 - 2017-10-26
diff --git a/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java 
b/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java
index 97fc703..bde3cae 100644
--- a/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java
@@ -473,5 +473,15 @@ public class DetailsDocument extends Document {
   public Boolean getMeasured() {
 return this.measured;
   }
+
+  private List unreachable_or_addresses;
+
+  public void setUnreachableOrAddresses(List unreachableOrAddresses) {
+this.unreachable_or_addresses = unreachableOrAddresses;
+  }
+
+  public List getUnreachableOrAddresses() {
+return this.unreachable_or_addresses;
+  }
 }
 
diff --git a/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java 
b/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
index faec117..77ff75f 100644
--- a/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
@@ -530,5 +530,15 @@ public class DetailsStatus extends Document {
   public String getHostName() {
 return unescapeJson(this.host_name);
   }
+
+  private List advertised_or_addresses;
+
+  public void setAdvertisedOrAddresses(List advertisedOrAddresses) {
+this.advertised_or_addresses = advertisedOrAddresses;
+  }
+
+  public List getAdvertisedOrAddresses() {
+return this.advertised_or_addresses;
+  }
 }
 
diff --git 
a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java 
b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
index 73e826a..fa3f3af 100644
--- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -199,6 +199,7 @@ public class NodeDetailsStatusUpdater implements 
DescriptorListener,
 }
 detailsStatus.setHibernating(descriptor.isHibernating() ? true :
 null);
+detailsStatus.setAdvertisedOrAddresses(descriptor.getOrAddresses());
 this.documentStore.store(detailsStatus, fingerprint);
   }
 
diff --git 
a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java 
b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
index e3f638d..9538cba 100644
--- a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
@@ -155,6 +155,16 @@ public class DetailsDocumentWriter implements 
DocumentWriter {
   exitAddressesWithoutOrAddresses));
 }
 detailsDocument.setMeasured(detailsStatus.getMeasured());
+List unreachableOrAddresses = new ArrayList<>();
+if (null != detailsStatus.getAdvertisedOrAddresses()) {
+  unreachableOrAddresses.addAll(detailsStatus.getAdvertisedOrAddresses());
+}
+if (null != detailsStatus.getOrAddressesAndPorts()) {
+  unreachableOrAddresses.removeAll(detailsStatus.getOrAddressesAndPorts());
+}
+if (!unreachableOrAddresses.isEmpty()) {
+  detailsDocument.setUnreachableOrAddresses(unreachableOrAddresses);
+}
 this.documentStore.store(detailsDocument, fingerprint);
   }
 



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


[tor-commits] [onionoo/release] Support quoted qualified search terms.

2017-11-17 Thread karsten
commit 75981fe7d03091c78f901e1589288be4a27ce56c
Author: Karsten Loesing 
Date:   Thu Oct 19 14:46:28 2017 +0200

Support quoted qualified search terms.

With this patch, the "search" parameter does not only accept unquoted
qualified search terms like `search=contact:John Doe` where "John"
would be looked up in the contact line and "Doe" in the nickname or
base64-encoded fingerprint. It also accepts quoted qualified search
terms like `search=contact:"John Doe"` where "John Doe" would be
looked up in the contact line. It further accepts escaped double
quotes (\") within quoted qualified search terms.

Implements #21366.
---
 CHANGELOG.md   |  8 -
 .../torproject/onionoo/server/ResourceServlet.java | 38 --
 .../onionoo/server/ResourceServletTest.java| 36 +++-
 3 files changed, 77 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca17fa7..74f29b7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,10 @@
-# Changes in version 4.2-1.6.1 - 2017-10-2?
+# Changes in version 4.3-1.7.0 - 2017-1?-??
+
+ * Medium changes
+   - Support quoted qualified search terms.
+
+
+# Changes in version 4.2-1.6.1 - 2017-10-26
 
  * Medium changes
- Fix two NullPointerExceptions caused by accessing optional parts
diff --git a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java 
b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
index 31244c2..2fff913 100644
--- a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
+++ b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
@@ -3,6 +3,8 @@
 
 package org.torproject.onionoo.server;
 
+import org.apache.commons.lang3.StringUtils;
+
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.ArrayList;
@@ -169,6 +171,12 @@ public class ResourceServlet extends HttpServlet {
   }
   if (!parameterMap.containsKey(parameterKey)) {
 String parameterValue = parts[1];
+if (parameterValue.startsWith("\"")
+&& parameterValue.endsWith("\"")) {
+  parameterValue = parameterValue
+  .substring(1, parameterValue.length() - 1)
+  .replaceAll("\"", "\"");
+}
 parameterMap.put(parameterKey, parameterValue);
   }
 } else {
@@ -388,7 +396,7 @@ public class ResourceServlet extends HttpServlet {
   + "^[0-9a-zA-Z+/]{1,27}$|" /* Base64 fingerprint. */
   + "^[0-9a-zA-Z\\.]{1,19}$|" /* Nickname or IPv4 address. */
   + ipv6AddressPatternString + "|" /* IPv6 address. */
-  + "^[a-zA-Z_]+:\\p{Graph}+$" /* Qualified search term. */);
+  + "^[a-zA-Z_]+:\"?[\\p{Graph} ]+\"?$"); /* Qualified search term. */
 
   protected static String[] parseSearchParameters(String queryString) {
 Matcher searchQueryStringMatcher = searchQueryStringPattern.matcher(
@@ -398,15 +406,39 @@ public class ResourceServlet extends HttpServlet {
   return null;
 }
 String parameter = searchQueryStringMatcher.group(1);
-String[] searchParameters =
+String[] spaceSeparatedParts =
 parameter.replaceAll("%20", " ").split(" ");
+List searchParameters = new ArrayList<>();
+StringBuilder doubleQuotedSearchTerm = null;
+for (String spaceSeparatedPart : spaceSeparatedParts) {
+  if ((StringUtils.countMatches(spaceSeparatedPart, '"')
+  - StringUtils.countMatches(spaceSeparatedPart, "\\\"")) % 2 == 0) {
+if (null == doubleQuotedSearchTerm) {
+  searchParameters.add(spaceSeparatedPart);
+} else {
+  doubleQuotedSearchTerm.append(' ').append(spaceSeparatedPart);
+}
+  } else {
+if (null == doubleQuotedSearchTerm) {
+  doubleQuotedSearchTerm = new StringBuilder(spaceSeparatedPart);
+} else {
+  doubleQuotedSearchTerm.append(' ').append(spaceSeparatedPart);
+  searchParameters.add(doubleQuotedSearchTerm.toString());
+  doubleQuotedSearchTerm = null;
+}
+  }
+}
+if (null != doubleQuotedSearchTerm) {
+  /* Opening double quote is not followed by closing double quote. */
+  return null;
+}
 for (String searchParameter : searchParameters) {
   if (!searchParameterPattern.matcher(searchParameter).matches()) {
 /* Illegal search term. */
 return null;
   }
 }
-return searchParameters;
+return searchParameters.toArray(new String[0]);
   }
 
   private static Pattern fingerprintParameterPattern =
diff --git 
a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java 
b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index 303cf21..1588f8a 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ 

[tor-commits] [onionoo/release] Schedule next major version.

2017-11-17 Thread karsten
commit e58c47f5e6c114c2c636e76ba612543c74a204c1
Author: Karsten Loesing 
Date:   Fri Nov 3 16:20:17 2017 +0100

Schedule next major version.

Optimistically schedule the next major version for end of this month
for removing $ from family fingerprints. That's a rather small
backward-incompatible change, so it should be fine to reduce the
notification period to a bit under four weeks. But just in case we
want more time we can always push that back by a week or two. At least
we're now saying that there will be a major version update soon.
---
 src/main/java/org/torproject/onionoo/server/ResponseBuilder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java 
b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index c0b2772..12885c5 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -125,7 +125,7 @@ public class ResponseBuilder {
 
   private static final String PROTOCOL_VERSION = "4.2";
 
-  private static final String NEXT_MAJOR_VERSION_SCHEDULED = null;
+  private static final String NEXT_MAJOR_VERSION_SCHEDULED = "2017-11-30";
 
   private void writeRelays(List relays, PrintWriter pw) {
 this.write(pw, "{\"version\":\"%s\",\n", PROTOCOL_VERSION);



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


[tor-commits] [onionoo/release] Use full variable names in SummaryDocument.

2017-11-17 Thread karsten
commit 0c9e9b812f2e068cae896e823c92a20c829f3519
Author: Karsten Loesing 
Date:   Mon Oct 30 17:25:33 2017 +0100

Use full variable names in SummaryDocument.
---
 .../torproject/onionoo/docs/SummaryDocument.java   | 147 +
 1 file changed, 90 insertions(+), 57 deletions(-)

diff --git a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java 
b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
index f33100d..cca5ab9 100644
--- a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
@@ -3,6 +3,8 @@
 
 package org.torproject.onionoo.docs;
 
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
 import org.apache.commons.codec.DecoderException;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.binary.Hex;
@@ -16,20 +18,23 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.regex.Pattern;
 
-@SuppressWarnings("checkstyle:membername")
 public class SummaryDocument extends Document {
 
-  private boolean t;
+  @Expose
+  @SerializedName("t")
+  private boolean isRelay;
 
   public void setRelay(boolean isRelay) {
-this.t = isRelay;
+this.isRelay = isRelay;
   }
 
   public boolean isRelay() {
-return this.t;
+return this.isRelay;
   }
 
-  private String f;
+  @Expose
+  @SerializedName("f")
+  private String fingerprint;
 
   /** Sets the fingerprint to the given 40 hex characters and clears
* SHA1-hashed and base64 fingerprints, so that they are re-computed at
@@ -42,14 +47,14 @@ public class SummaryDocument extends Document {
 + "' is not a valid fingerprint.");
   }
 }
-this.f = fingerprint;
+this.fingerprint = fingerprint;
 this.hashedFingerprint = null;
 this.base64Fingerprint = null;
 this.fingerprintSortedHexBlocks = null;
   }
 
   public String getFingerprint() {
-return this.f;
+return this.fingerprint;
   }
 
   private transient String hashedFingerprint = null;
@@ -57,10 +62,10 @@ public class SummaryDocument extends Document {
   /** Returns the SHA1-hashed fingerprint, or null if no
* fingerprint is set. */
   public String getHashedFingerprint() {
-if (this.hashedFingerprint == null && this.f != null) {
+if (this.hashedFingerprint == null && this.fingerprint != null) {
   try {
 this.hashedFingerprint = DigestUtils.sha1Hex(Hex.decodeHex(
-this.f.toCharArray())).toUpperCase();
+this.fingerprint.toCharArray())).toUpperCase();
   } catch (DecoderException e) {
 /* Format tested in setFingerprint(). */
   }
@@ -73,10 +78,10 @@ public class SummaryDocument extends Document {
   /** Returns the base64-encoded fingerprint, or null if no
* fingerprint is set. */
   public String getBase64Fingerprint() {
-if (this.base64Fingerprint == null && this.f != null) {
+if (this.base64Fingerprint == null && this.fingerprint != null) {
   try {
 this.base64Fingerprint = Base64.encodeBase64String(Hex.decodeHex(
-this.f.toCharArray())).replaceAll("=", "");
+this.fingerprint.toCharArray())).replaceAll("=", "");
   } catch (DecoderException e) {
 /* Format tested in setFingerprint(). */
   }
@@ -90,8 +95,8 @@ public class SummaryDocument extends Document {
* characters from the fingerprint, or null if no
* fingerprint is set. */
   public String[] getFingerprintSortedHexBlocks() {
-if (this.fingerprintSortedHexBlocks == null && this.f != null) {
-  String fingerprint = this.f.toUpperCase();
+if (this.fingerprintSortedHexBlocks == null && this.fingerprint != null) {
+  String fingerprint = this.fingerprint.toUpperCase();
   String[] fingerprintSortedHexBlocks =
   new String[fingerprint.length() / 4];
   for (int i = 0; i < fingerprint.length(); i += 4) {
@@ -104,29 +109,33 @@ public class SummaryDocument extends Document {
 return this.fingerprintSortedHexBlocks;
   }
 
-  private String n;
+  @Expose
+  @SerializedName("n")
+  private String nickname;
 
   @SuppressWarnings("checkstyle:javadocmethod")
   public void setNickname(String nickname) {
 if (nickname == null || nickname.equals("Unnamed")) {
-  this.n = null;
+  this.nickname = null;
 } else {
-  this.n = nickname;
+  this.nickname = nickname;
 }
   }
 
   public String getNickname() {
-return this.n == null ? "Unnamed" : this.n;
+return this.nickname == null ? "Unnamed" : this.nickname;
   }
 
-  private String[] ad;
+  @Expose
+  @SerializedName("ad")
+  private String[] addresses;
 
   public void setAddresses(List addresses) {
-this.ad = this.collectionToStringArray(addresses);
+this.addresses = this.collectionToStringArray(addresses);
   }
 
   public List getAddresses() {
-return this.stringArrayToList(this.ad);
+return 

[tor-commits] [onionoo/release] Bump version to 4.2-1.6.1-dev.

2017-11-17 Thread karsten
commit 0cb09d1ebfd76f797a3bb530e10a22350d1c4a5a
Author: Karsten Loesing 
Date:   Thu Oct 26 21:52:01 2017 +0200

Bump version to 4.2-1.6.1-dev.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index 25477df..3e70421 100644
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
   
   
   
+value="${onionoo.protocol.version}-1.6.1-dev"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [onionoo/release] Add new "host_name" parameter to filter by host name.

2017-11-17 Thread karsten
commit d5d0edc9aab3d301b228c2b177daf172d93827b5
Author: Karsten Loesing 
Date:   Tue Oct 17 14:48:26 2017 +0200

Add new "host_name" parameter to filter by host name.

Implements #16553.
---
 CHANGELOG.md   |  1 +
 .../org/torproject/onionoo/docs/DocumentStore.java |  3 +-
 .../org/torproject/onionoo/docs/NodeStatus.java| 15 
 .../torproject/onionoo/docs/SummaryDocument.java   | 13 +++-
 .../org/torproject/onionoo/server/NodeIndex.java   | 10 +++
 .../org/torproject/onionoo/server/NodeIndexer.java | 11 +++
 .../torproject/onionoo/server/RequestHandler.java  | 26 +++
 .../torproject/onionoo/server/ResourceServlet.java | 22 +-
 .../onionoo/updater/NodeDetailsStatusUpdater.java  |  1 +
 .../onionoo/writer/SummaryDocumentWriter.java  |  4 +-
 .../onionoo/docs/SummaryDocumentTest.java  |  3 +-
 .../onionoo/server/ResourceServletTest.java| 79 --
 .../server/SummaryDocumentComparatorTest.java  |  3 +-
 13 files changed, 179 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12b0741..76243ef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- Support quoted qualified search terms.
- Skip unrecognized descriptors when importing archives rather than
  aborting the entire import.
+   - Add new "host_name" parameter to filter by host name.
 
 
 # Changes in version 4.2-1.6.1 - 2017-10-26
diff --git a/src/main/java/org/torproject/onionoo/docs/DocumentStore.java 
b/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
index 7819d0f..57d4165 100644
--- a/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
+++ b/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
@@ -439,10 +439,11 @@ public class DocumentStore {
 long lastSeenMillis = -1L;
 long consensusWeight = -1L;
 long firstSeenMillis = -1L;
+String hostName = null;
 SummaryDocument summaryDocument = new SummaryDocument(isRelay,
 nickname, fingerprint, addresses, lastSeenMillis, running,
 relayFlags, consensusWeight, countryCode, firstSeenMillis,
-asNumber, contact, family, family, version);
+asNumber, contact, family, family, version, hostName);
 return summaryDocument;
   }
 
diff --git a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java 
b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
index 24546dd..3271ccc 100644
--- a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
@@ -368,6 +368,16 @@ public class NodeStatus extends Document {
 
   /* Reverse DNS lookup result */
 
+  private String hostName;
+
+  public void setHostName(String hostName) {
+this.hostName = hostName;
+  }
+
+  public String getHostName() {
+return this.hostName;
+  }
+
   private long lastRdnsLookup = -1L;
 
   public void setLastRdnsLookup(long lastRdnsLookup) {
@@ -561,6 +571,9 @@ public class NodeStatus extends Document {
   if (parts.length >= 24 && !parts[23].isEmpty()) {
 nodeStatus.setVersion(parts[23]);
   }
+  if (parts.length >= 25 && !parts[24].isEmpty()) {
+nodeStatus.setHostName(parts[24]);
+  }
   return nodeStatus;
 } catch (NumberFormatException e) {
   log.error("Number format exception while parsing node "
@@ -627,6 +640,8 @@ public class NodeStatus extends Document {
 .append(StringUtils.join(this.getIndirectFamily(), ";"));
 sb.append("\t")
 .append((this.getVersion() != null ? this.getVersion() : ""));
+sb.append("\t")
+.append((this.getHostName() != null ? this.getHostName() : ""));
 return sb.toString();
   }
 }
diff --git a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java 
b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
index 527f91d..f33100d 100644
--- a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
@@ -279,6 +279,16 @@ public class SummaryDocument extends Document {
 return this.v;
   }
 
+  private String h;
+
+  public void setHostName(String hostName) {
+this.h = hostName;
+  }
+
+  public String getHostName() {
+return this.h;
+  }
+
   /* The familyFingerprints parameter can go away after September 8, 2015.
* See above. */
   /** Instantiates a summary document with all given properties. */
@@ -287,7 +297,7 @@ public class SummaryDocument extends Document {
   boolean running, SortedSet relayFlags, long consensusWeight,
   String countryCode, long firstSeenMillis, String asNumber,
   String contact, SortedSet familyFingerprints,
-  SortedSet effectiveFamily, String version) {
+  SortedSet effectiveFamily, String version, String hostName) {
 this.setRelay(isRelay);
 this.setNickname(nickname);
 this.setFingerprint(fingerprint);
@@ -303,6 +313,7 @@ public class 

[tor-commits] [onionoo/release] Skip unrecognized descriptors when importing archives.

2017-11-17 Thread karsten
commit ffc949ea54ce294c87b48b3ee8d08198a9e5d9b7
Author: Karsten Loesing 
Date:   Fri Nov 3 22:33:02 2017 +0100

Skip unrecognized descriptors when importing archives.
---
 CHANGELOG.md   | 2 ++
 src/main/java/org/torproject/onionoo/updater/DescriptorSource.java | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74f29b7..12b0741 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
 
  * Medium changes
- Support quoted qualified search terms.
+   - Skip unrecognized descriptors when importing archives rather than
+ aborting the entire import.
 
 
 # Changes in version 4.2-1.6.1 - 2017-10-26
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java 
b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
index d32727f..07ae4f8 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
@@ -170,9 +170,8 @@ public class DescriptorSource {
   if (descriptorType == null) {
 log.warn("Unrecognized descriptor in "
 + this.inArchiveDir.getAbsolutePath() + " with annotations "
-+ descriptor.getAnnotations() + ".  Not reading any further"
-+ "archived descriptors.");
-break;
++ descriptor.getAnnotations() + ".  Skipping descriptor.");
+continue;
   }
   for (DescriptorListener descriptorListener :
   this.descriptorListeners.get(descriptorType)) {



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


[tor-commits] [onionoo/master] Re-schedule next major version.

2017-11-17 Thread karsten
commit a641e1009bcefa8420f9a36b7b24a8a25b85e1ba
Author: Karsten Loesing 
Date:   Fri Nov 17 11:28:54 2017 +0100

Re-schedule next major version.

We said we'd announce new major versions 1 month in advance. Today
we're going to put out a release to include this date for the first
time. Re-scheduling next major version for in 1 month from today.
---
 src/main/java/org/torproject/onionoo/server/ResponseBuilder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java 
b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index 12885c5..eda71c1 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -125,7 +125,7 @@ public class ResponseBuilder {
 
   private static final String PROTOCOL_VERSION = "4.2";
 
-  private static final String NEXT_MAJOR_VERSION_SCHEDULED = "2017-11-30";
+  private static final String NEXT_MAJOR_VERSION_SCHEDULED = "2017-12-17";
 
   private void writeRelays(List relays, PrintWriter pw) {
 this.write(pw, "{\"version\":\"%s\",\n", PROTOCOL_VERSION);



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


[tor-commits] [onionoo/master] Prepare for 4.3-1.7.0 release.

2017-11-17 Thread karsten
commit 5b43b4d7f53603831fcbbad45321b12969f13046
Author: Karsten Loesing 
Date:   Fri Nov 17 11:33:20 2017 +0100

Prepare for 4.3-1.7.0 release.
---
 CERT | 20 ++--
 CHANGELOG.md |  2 +-
 build.xml|  4 ++--
 .../torproject/onionoo/server/ResponseBuilder.java   |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/CERT b/CERT
index d94c0c3..ca92db0 100644
--- a/CERT
+++ b/CERT
@@ -1,8 +1,8 @@
 -BEGIN CERTIFICATE-
-MIIDaTCCAlGgAwIBAgIEZTniETANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJV
+MIIDaTCCAlGgAwIBAgIEPrK+4DANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJV
 UzELMAkGA1UECBMCV0ExEDAOBgNVBAcTB1NlYXR0bGUxHTAbBgNVBAoTFFRoZSBU
-b3IgUHJvamVjdCwgSW5jMRgwFgYDVQQDEw9LYXJzdGVuIExvZXNpbmcwHhcNMTcw
-ODE3MTg1MDQ0WhcNMTcxMTE1MTg1MDQ0WjBlMQswCQYDVQQGEwJVUzELMAkGA1UE
+b3IgUHJvamVjdCwgSW5jMRgwFgYDVQQDEw9LYXJzdGVuIExvZXNpbmcwHhcNMTcx
+MTE3MTA0MDQ5WhcNMTgwMjE1MTA0MDQ5WjBlMQswCQYDVQQGEwJVUzELMAkGA1UE
 CBMCV0ExEDAOBgNVBAcTB1NlYXR0bGUxHTAbBgNVBAoTFFRoZSBUb3IgUHJvamVj
 dCwgSW5jMRgwFgYDVQQDEw9LYXJzdGVuIExvZXNpbmcwggEiMA0GCSqGSIb3DQEB
 AQUAA4IBDwAwggEKAoIBAQChXn+IUp+o6G+k4ffxk3TkxZb3iXfiG7byNsG63olU
@@ -11,11 +11,11 @@ 
Qw+VAhKTcEIv4yiR0BWapQyR07pgmKirYVjN6s6ef8NJzUptpxLlaYJ3ZfQfc4aE
 MXzScgaccwDFIWQ661lzLGCfeSxxa3Xy4wWsGwzNzLITYrrABcbg7yogLo2btNvD
 oEwGL3/baQdhl0dra6biVCZr9ydn3Hg57S55pUU0rBY25id78zUO8xrfNHw54wwX
 lOblGt75OOkahP/ZZSBxxoiknJ6y5VQV8y+noA4vigXFAgMBAAGjITAfMB0GA1Ud
-DgQWBBSeh60M+/wMYyYhlxtuff2Hk9n7bzANBgkqhkiG9w0BAQsFAAOCAQEAbsAc
-gwl5KJH3pVKw4b+ACCOMgW+27MisCFbT1Izq2Wx+JcLMt3N//MoIpYOZWhsIeazW
-/NE0fNbkLi0IYA0F1nUC9pHl44Hd8Gjfqa/YQUi9ALtgsY7l6W0sceW8WnZ8bu8J
-DfrqnmB0bD2xc9ZjOn58al8dVjVWs95M87D9WCRU6LiaKFj5c45wciABQsTmC0qD
-pyHYOaSGtXxXKDw5pAntdtHkCbowV5tDi/QQ8Tg7i5O7xwSh71Q7TZiNFMpLomBL
-QllHfTZryFmoHyGn5MfngBUVCVHig5nXmk0dUMGuLiK4789dkgiPRz0vpB5Yf8Yy
-CCE2jB6VBi2g5fMx0w==
+DgQWBBSeh60M+/wMYyYhlxtuff2Hk9n7bzANBgkqhkiG9w0BAQsFAAOCAQEAIqRy
+T4uMqw1WwZ8CtJx5kSs/or+5025bGK6V2dY/jYapZcbyG7sq3KVFAqLik8Yn7a0D
+dfbmtR7r2jbkWhYppa7MGSQ6SMG6nxas05l8yf9ShDnNLtJoay8JyGPeucaFyEwV
+VxwN9/I4M4chrrvBzpMB/1U3oJxlKR+nssh4w55DoUijk3vHn01+20EPU9uNJrsr
+mXhcrJLU/4R952ZMLxtiBfNP7vaxLpQctNqZxEfa9/rm0pLlfd2t62BWf8kkGqEy
+Ke4WdNpQwk3WKjFlKWcvsF6ztJJlwA+qHk4IB9PynVRNggWimBrxWigbeBL8qpML
+A5xMtX/MHDXreWGaKA==
 -END CERTIFICATE-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c48075e..1b7c400 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-# Changes in version 4.3-1.7.0 - 2017-1?-??
+# Changes in version 4.3-1.7.0 - 2017-11-17
 
  * Medium changes
- Support quoted qualified search terms.
diff --git a/build.xml b/build.xml
index 3e70421..b4ef4d2 100644
--- a/build.xml
+++ b/build.xml
@@ -8,9 +8,9 @@
 
   
   
-  
+  
   
+value="${onionoo.protocol.version}-1.7.0"/>
   
   
   https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Use memset() on intro1_data in hs_circ_send_introduce1()

2017-11-17 Thread nickm
commit b8addf97463d9338558ec7c0b97b48eaa476fc55
Author: Neel Chauhan 
Date:   Thu Nov 16 12:58:37 2017 -0500

Use memset() on intro1_data in hs_circ_send_introduce1()
---
 src/or/hs_circuit.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index 9e7709504..7f5bbdaaf 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -1101,6 +1101,11 @@ hs_circ_send_introduce1(origin_circuit_t *intro_circ,
   tor_assert(ip);
   tor_assert(subcredential);
 
+  /* It is undefined behavior in hs_cell_introduce1_data_clear() if intro1_data
+   * has been declared on the stack but not initialized. Here, we set it to 0.
+   */
+  memset(_data, 0, sizeof(hs_cell_introduce1_data_t));
+
   /* This takes various objects in order to populate the introduce1 data
* object which is used to build the content of the cell. */
   const node_t *exit_node = build_state_get_exit_node(rend_circ->build_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 error message for exit_node in hs_circ_send_introduce1()

2017-11-17 Thread nickm
commit eb793c31cf9230a2bb4bda554379056f044f5473
Author: Neel Chauhan 
Date:   Thu Nov 16 13:13:31 2017 -0500

Add error message for exit_node in hs_circ_send_introduce1()
---
 src/or/hs_circuit.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index 7f5bbdaaf..a232a40c8 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -1109,6 +1109,11 @@ hs_circ_send_introduce1(origin_circuit_t *intro_circ,
   /* This takes various objects in order to populate the introduce1 data
* object which is used to build the content of the cell. */
   const node_t *exit_node = build_state_get_exit_node(rend_circ->build_state);
+  if (exit_node == NULL) {
+log_info(LD_REND, "Unable to get rendezvous point for circuit %u. "
+ "Failing.", TO_CIRCUIT(intro_circ)->n_circ_id);
+goto done;
+  }
   setup_introduce1_data(ip, exit_node, subcredential, _data);
   /* If we didn't get any link specifiers, it's because our node was
* bad. */

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


[tor-commits] [tor/master] Add smartlist_add() to get_lspecs_from_node)

2017-11-17 Thread nickm
commit 27d34f36e07b876321a03fbb59533b72b807b679
Author: Neel Chauhan 
Date:   Thu Nov 16 12:37:39 2017 -0500

Add smartlist_add() to get_lspecs_from_node)
---
 src/or/hs_circuit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index 26fe22eb7..9e7709504 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -617,6 +617,7 @@ get_lspecs_from_node(const node_t *node, smartlist_t 
*lspecs)
 link_specifier_set_un_ipv6_port(ls, ap.port);
 /* Sixteen bytes IPv6 and two bytes port. */
 link_specifier_set_ls_len(ls, addr_len + sizeof(ap.port));
+smartlist_add(lspecs, ls);
   }
 }
 



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


[tor-commits] [webwml/staging] Fix dropdown padding and language nav

2017-11-17 Thread hiro
commit 101d5558dcc93fe5202c31461c4d5ed443e1e8f8
Author: hiromipaw 
Date:   Fri Nov 17 14:37:54 2017 +0100

Fix dropdown padding and language nav
---
 css/layout.css | 5 -
 css/layout.min.css | 2 +-
 include/dlhead.wmi | 4 ++--
 include/navigation.wmi | 1 +
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/css/layout.css b/css/layout.css
index d56ffdb3..46a32d37 100644
--- a/css/layout.css
+++ b/css/layout.css
@@ -1315,7 +1315,7 @@ p.blogDate {
 /* Style The Dropdown Button */
 .dropbtn {
 background-color: white;
-padding: 0px;
+padding: 16px 0 0 0;
 font-size: 100%;
 border: none;
 cursor: pointer;
@@ -1325,6 +1325,9 @@ p.blogDate {
 .dropdown {
 position: relative;
 display: inline-block;
+padding: 0;
+margin-top: -16px;
+top: 0;
 }
 
 /* Dropdown Content (Hidden by Default) */
diff --git a/css/layout.min.css b/css/layout.min.css
index 9811d53e..e13dc744 100644
--- a/css/layout.min.css
+++ b/css/layout.min.css
@@ -1 +1 @@
-@charset "UTF-8";body{background:#fff}#wrap{width:960px;margin:0 
auto}.left{float:left}.right{float:right}.twenty{width:20%}.thirty{width:30%}.forty{width:40%}.fifty{width:50%}.sixty{width:60%}.hundred{width:100%}.nopad{padding:0}.toppad{padding-top:10px}.toptwenty{margin-top:20px}.topforty{margin-top:40px}.hidden{display:none}#header{width:960px;height:97px;margin-bottom:23px;position:relative}h1#logo{margin:0;float:left}h1#logo
 a,h1#logo a:visited{background:url(../images/tor-logo.jpg) left top 
no-repeat;text-indent:-px;overflow:hidden;width:150px;height:97px;display:block}#nav{position:absolute;top:30px;left:130px;float:right}#nav
 ul{height:50px;float:right;margin-bottom:0}#nav ul 
li{float:left;display:inline;width:auto}#calltoaction{height:30px;float:right;margin-top:100px;margin-right:5px;text-align:center}#calltoaction
 ul{padding:0;margin:0;height:30px;list-style:none;float:right}#calltoaction ul 
li{list-style:none;display:inline;float:none;width:100px;margin-left:0}#callt
 oaction ul li a:link,#calltoaction ul li 
a:visited{display:block;background:url(../images/cta-buttons.jpg) top center 
no-repeat #885ca4;padding:4px 
8px;color:#fff;font-weight:bold;text-decoration:none;font-size:13px;line-height:22px;height:22px;width:84px;float:left;text-shadow:1px
 1px 0 #111}#calltoaction ul li:hover 
a{background:url(../images/cta-buttons.jpg) bottom center no-repeat 
#ff9800;font-weight:bold;text-shadow:1px 1px 0 #111}#calltoaction ul 
li:first-child a:link,#calltoaction ul li:first-child a:visited,#calltoaction 
ul li:hover:first-child 
a{-webkit-border-top-left-radius:7px;-webkit-border-bottom-left-radius:7px;-moz-border-radius-topleft:7px;-moz-border-radius-bottomleft:7px;border-top-left-radius:7px;border-bottom-left-radius:7px}#calltoaction
 ul li:first-child a:link,#calltoaction ul li:first-child 
a:visited{background:url(../images/cta-buttons.jpg) top left no-repeat 
#885ca4}#calltoaction ul li:hover:first-child 
a{background:url(../images/cta-buttons.jpg) bottom le
 ft no-repeat #ff9800}#calltoaction ul li:last-child a:link,#calltoaction ul 
li:last-child a:visited,#calltoaction ul li:hover:last-child 
a{-webkit-border-top-right-radius:7px;-webkit-border-bottom-right-radius:7px;-moz-border-radius-topright:7px;-moz-border-radius-bottomright:7px;border-top-right-radius:7px;border-bottom-right-radius:7px}#calltoaction
 ul li:last-child a:link,#calltoaction ul li:last-child 
a:visited{background:url(../images/cta-buttons.jpg) top right no-repeat 
#885ca4;color:#fff}#calltoaction ul li:hover:last-child 
a{background:url(../images/cta-buttons.jpg) bottom right no-repeat 
#ff9800}#banner{background:url(../images/bg-banner.jpg) left top 
no-repeat;height:200px;width:600px;padding:23px 
15px;margin-bottom:15px}#download a:link,#download a:visited{margin:-17px 0 
0;background:url(../images/button-download.png) left top 
no-repeat;width:257px;height:79px;float:left;padding:35px 0 0 
80px;text-decoration:none}#download a 
.download-tor{background:url(../images/button-d
 ownload-arrow.png) right center no-repeat;font-family:"Arial 
Narrow",Arial,sans-serif;color:#fff;font-size:2.167em;letter-spacing:1px;padding-right:25px}#download
 a .version{color:#bda5cc;font-size:1.167em;line-height:1.167em}#download a 
.info{color:#bda5cc;font-size:.833em;line-height:.833em}#download 
a:hover{background-position:0 -114px}#download a:hover .version,#download 
a:hover .info{color:#f1c6a1}#banner ul{background:#387520 
url(../images/banner-gradient.jpg) left top repeat-x;border:1px solid 
#366b32;width:180px;float:right;margin:0 15px 0 0;padding:10px 10px 10px 
30px}#banner ul li{list-style:url(../images/white-bullet.png) 
outside;padding:5px 0}#content{width:960px}#content 
img{max-width:710px}#breadcrumbs{padding:0 0 10px 5px}#home 

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

2017-11-17 Thread nickm
commit 00aeecb397a65b3687a01fbe7b33773ccbbac158
Merge: b9826ba45 3a364309a
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:56 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)

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


[tor-commits] [tor/release-0.3.2] Fix a traceback when closing a blocked connection "immediately".

2017-11-17 Thread nickm
commit 95238eb9174f0cfee9d313ce15b4f9b471f3d0e5
Author: Nick Mathewson 
Date:   Thu Nov 16 11:45:15 2017 -0500

Fix a traceback when closing a blocked connection "immediately".

When we close a connection via connection_close_immediately, we kill
its events immediately. But if it had been blocked on bandwidth
read/write, we could try to re-add its (nonexistent) events later
from connection_bucket_refill -- if we got to that callback before
we swept the marked connections.

Fixes bug 24167.  Fortunately, this hasn't been a crash bug since we
introduced connection_check_event in 0.2.9.10, and backported it.

This is a bugfix on commit 89d422914a0c3cb, I believe, which
appeared in Tor 0.1.0.1-rc.
---
 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)

diff --git a/changes/bug24167 b/changes/bug24167
new file mode 100644
index 0..fd0d87eff
--- /dev/null
+++ b/changes/bug24167
@@ -0,0 +1,7 @@
+  o Minor bugfixes (network layer):
+- When closing a connection via close_connection_immediately(), we
+  mark it as "not blocked on bandwidth", to prevent later calls
+  from trying to unblock it, and give it permission to read. This
+  fixes a backtrace warning that can happen on relays under various
+  circumstances. Fixes bug 24167; bugfix on 0.1.0.1-rc.
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 276dca281..61f4f5aa6 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -721,6 +721,10 @@ connection_close_immediate(connection_t *conn)
 
   connection_unregister_events(conn);
 
+  /* Prevent the event from getting unblocked. */
+  conn->read_blocked_on_bw =
+conn->write_blocked_on_bw = 0;
+
   if (SOCKET_OK(conn->s))
 tor_close_socket(conn->s);
   conn->s = TOR_INVALID_SOCKET;



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


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

2017-11-17 Thread nickm
commit 368dc1003eeb58ad11e1eb13904ef7f79ef019d1
Merge: 4ef70ff38 3a364309a
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:56 2017 -0500

Merge branch 'maint-0.3.2'

 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)

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


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

2017-11-17 Thread nickm
commit 3a364309ace5bc0b75b724484d6b27d84ec6a8b1
Merge: 057101581 95238eb91
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:52 2017 -0500

Merge branch 'bug24167_025' into maint-0.3.2

 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)




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


[tor-commits] [tor/master] Fix a traceback when closing a blocked connection "immediately".

2017-11-17 Thread nickm
commit 95238eb9174f0cfee9d313ce15b4f9b471f3d0e5
Author: Nick Mathewson 
Date:   Thu Nov 16 11:45:15 2017 -0500

Fix a traceback when closing a blocked connection "immediately".

When we close a connection via connection_close_immediately, we kill
its events immediately. But if it had been blocked on bandwidth
read/write, we could try to re-add its (nonexistent) events later
from connection_bucket_refill -- if we got to that callback before
we swept the marked connections.

Fixes bug 24167.  Fortunately, this hasn't been a crash bug since we
introduced connection_check_event in 0.2.9.10, and backported it.

This is a bugfix on commit 89d422914a0c3cb, I believe, which
appeared in Tor 0.1.0.1-rc.
---
 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)

diff --git a/changes/bug24167 b/changes/bug24167
new file mode 100644
index 0..fd0d87eff
--- /dev/null
+++ b/changes/bug24167
@@ -0,0 +1,7 @@
+  o Minor bugfixes (network layer):
+- When closing a connection via close_connection_immediately(), we
+  mark it as "not blocked on bandwidth", to prevent later calls
+  from trying to unblock it, and give it permission to read. This
+  fixes a backtrace warning that can happen on relays under various
+  circumstances. Fixes bug 24167; bugfix on 0.1.0.1-rc.
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 276dca281..61f4f5aa6 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -721,6 +721,10 @@ connection_close_immediate(connection_t *conn)
 
   connection_unregister_events(conn);
 
+  /* Prevent the event from getting unblocked. */
+  conn->read_blocked_on_bw =
+conn->write_blocked_on_bw = 0;
+
   if (SOCKET_OK(conn->s))
 tor_close_socket(conn->s);
   conn->s = TOR_INVALID_SOCKET;



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


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

2017-11-17 Thread nickm
commit 3a364309ace5bc0b75b724484d6b27d84ec6a8b1
Merge: 057101581 95238eb91
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:52 2017 -0500

Merge branch 'bug24167_025' into maint-0.3.2

 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)

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


[tor-commits] [tor/maint-0.3.2] Fix a traceback when closing a blocked connection "immediately".

2017-11-17 Thread nickm
commit 95238eb9174f0cfee9d313ce15b4f9b471f3d0e5
Author: Nick Mathewson 
Date:   Thu Nov 16 11:45:15 2017 -0500

Fix a traceback when closing a blocked connection "immediately".

When we close a connection via connection_close_immediately, we kill
its events immediately. But if it had been blocked on bandwidth
read/write, we could try to re-add its (nonexistent) events later
from connection_bucket_refill -- if we got to that callback before
we swept the marked connections.

Fixes bug 24167.  Fortunately, this hasn't been a crash bug since we
introduced connection_check_event in 0.2.9.10, and backported it.

This is a bugfix on commit 89d422914a0c3cb, I believe, which
appeared in Tor 0.1.0.1-rc.
---
 changes/bug24167| 7 +++
 src/or/connection.c | 4 
 2 files changed, 11 insertions(+)

diff --git a/changes/bug24167 b/changes/bug24167
new file mode 100644
index 0..fd0d87eff
--- /dev/null
+++ b/changes/bug24167
@@ -0,0 +1,7 @@
+  o Minor bugfixes (network layer):
+- When closing a connection via close_connection_immediately(), we
+  mark it as "not blocked on bandwidth", to prevent later calls
+  from trying to unblock it, and give it permission to read. This
+  fixes a backtrace warning that can happen on relays under various
+  circumstances. Fixes bug 24167; bugfix on 0.1.0.1-rc.
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 276dca281..61f4f5aa6 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -721,6 +721,10 @@ connection_close_immediate(connection_t *conn)
 
   connection_unregister_events(conn);
 
+  /* Prevent the event from getting unblocked. */
+  conn->read_blocked_on_bw =
+conn->write_blocked_on_bw = 0;
+
   if (SOCKET_OK(conn->s))
 tor_close_socket(conn->s);
   conn->s = TOR_INVALID_SOCKET;



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


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

2017-11-17 Thread nickm
commit 0571015819317f6b52416d8023a99ee5a8f31dee
Merge: 0684e6c6f 2a98fcb84
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:01 2017 -0500

Merge branch 'ticket24097_032' into maint-0.3.2

 changes/ticket24097 | 4 
 src/or/dns.c| 5 +++--
 2 files changed, 7 insertions(+), 2 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 'ticket24097_032' into maint-0.3.2

2017-11-17 Thread nickm
commit 0571015819317f6b52416d8023a99ee5a8f31dee
Merge: 0684e6c6f 2a98fcb84
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:01 2017 -0500

Merge branch 'ticket24097_032' into maint-0.3.2

 changes/ticket24097 | 4 
 src/or/dns.c| 5 +++--
 2 files changed, 7 insertions(+), 2 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.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2017-11-17 Thread nickm
commit b9826ba4518852b9fa8057ab40921f3082916a03
Merge: 066904e75 057101581
Author: Nick Mathewson 
Date:   Fri Nov 17 08:35:04 2017 -0500

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/ticket24097 | 4 
 src/or/dns.c| 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

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


  1   2   >