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

2012-10-10 Thread translation
commit 4f963f868b3becd17ff4fe52dcada4dfe9325ae2
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 07:45:37 2012 +

Update translations for tails-persistence-setup
---
 it/it.po |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/it/it.po b/it/it.po
index 034efe6..b356578 100644
--- a/it/it.po
+++ b/it/it.po
@@ -4,13 +4,14 @@
 # 
 # Translators:
 #   fswitc...@hotmail.com, 2012.
+#   jan.reis...@unimi.it, 2012.
 msgid 
 msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-10-03 16:16+0200\n
-PO-Revision-Date: 2012-10-09 12:49+\n
-Last-Translator: spawned76 fswitc...@hotmail.com\n
+PO-Revision-Date: 2012-10-10 07:27+\n
+Last-Translator: jan jan.reis...@unimi.it\n
 Language-Team: Italian 
(http://www.transifex.com/projects/p/torproject/language/it/)\n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=UTF-8\n
@@ -64,7 +65,7 @@ msgstr Portachiavi GNOME
 
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:100
 msgid Secrets stored by GNOME Keyring
-msgstr 
+msgstr Segreti contenuti in GNOME Keyring
 
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:108
 msgid Network Connections
@@ -92,12 +93,12 @@ msgstr Liste scaricate da APT
 
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:138
 msgid Dotfiles
-msgstr 
+msgstr Dotfiles
 
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:140
 msgid 
 Symlink into $HOME every file or directory found in the `dotfiles' directory
-msgstr 
+msgstr Crea un symlink in $HOME per ogni file o cartella dentro la cartella 
`dotfiles'
 
 #: ../lib/Tails/Persistence/Setup.pm:259
 msgid 

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


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

2012-10-10 Thread translation
commit 5b1f37b126ed946189311b8475b73d4ae8d9812d
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 07:45:39 2012 +

Update translations for tails-persistence-setup_completed
---
 it/it.po |  320 ++
 1 files changed, 320 insertions(+), 0 deletions(-)

diff --git a/it/it.po b/it/it.po
new file mode 100644
index 000..b356578
--- /dev/null
+++ b/it/it.po
@@ -0,0 +1,320 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Tails developers
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+#   fswitc...@hotmail.com, 2012.
+#   jan.reis...@unimi.it, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-10-03 16:16+0200\n
+PO-Revision-Date: 2012-10-10 07:27+\n
+Last-Translator: jan jan.reis...@unimi.it\n
+Language-Team: Italian 
(http://www.transifex.com/projects/p/torproject/language/it/)\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: it\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:48
+msgid Personal Data
+msgstr Dati Personali
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:50
+msgid Keep files stored in the `Persistent' directory
+msgstr Mantieni i files in una directory 'Persistent'
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:58
+msgid GnuPG
+msgstr GnuPG
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:60
+msgid GnuPG keyrings and configuration
+msgstr Portachiavi GnuPG e configurazione
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:68
+msgid SSH Client
+msgstr Client SSH
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:70
+msgid SSH keys, configuration and known hosts
+msgstr Chiavi SSH, configurazione e hosts conosciuti 
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:78
+msgid Pidgin
+msgstr Pidgin
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:80
+msgid Pidgin profiles and OTR keyring
+msgstr Profili Pidgin e portachiavi OTR
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:88
+msgid Claws Mail
+msgstr Claws Mail
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:90
+msgid Claws Mail profiles and locally stored email
+msgstr Claws Mail profili e email locali
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:98
+msgid GNOME Keyring
+msgstr Portachiavi GNOME
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:100
+msgid Secrets stored by GNOME Keyring
+msgstr Segreti contenuti in GNOME Keyring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:108
+msgid Network Connections
+msgstr Connessioni di Rete
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:110
+msgid Configuration of network devices and connections
+msgstr Configurazione dei dispositivi e delle connessioni di rete
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:118
+msgid APT Packages
+msgstr Pacchetti APT
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:120
+msgid Packages downloaded by APT
+msgstr Pacchetti scaricati da APT
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:128
+msgid APT Lists
+msgstr Liste APT
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:130
+msgid Lists downloaded by APT
+msgstr Liste scaricate da APT
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:138
+msgid Dotfiles
+msgstr Dotfiles
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:140
+msgid 
+Symlink into $HOME every file or directory found in the `dotfiles' directory
+msgstr Crea un symlink in $HOME per ogni file o cartella dentro la cartella 
`dotfiles'
+
+#: ../lib/Tails/Persistence/Setup.pm:259
+msgid 
+The device Tails is running from cannot be found. Maybe you used the `toram'
+ option?
+msgstr Il dispositivo su cui Tails è in esecuzione non può essere trovato. 
Forse hai utilitzzato l'opzione 'toram' ?
+
+#: ../lib/Tails/Persistence/Setup.pm:284
+msgid 'Unparseable partition path.'
+msgstr 'Percorso della partizione non valido'
+
+#: ../lib/Tails/Persistence/Setup.pm:298
+msgid Setup Tails persistent volume
+msgstr Configura volume persistente Tails
+
+#: ../lib/Tails/Persistence/Setup.pm:442
+#, perl-format
+msgid Device %s already has a persistent volume.
+msgstr Il dispositivo %s ha già un volume persistente
+
+#: ../lib/Tails/Persistence/Setup.pm:450
+#, perl-format
+msgid Device %s has not enough unallocated space.
+msgstr Il dispositivo %s non ha abbastanza spazio libero
+
+#: ../lib/Tails/Persistence/Setup.pm:458 ../lib/Tails/Persistence/Setup.pm:472
+#, perl-format
+msgid Device %s has no persistent volume.
+msgstr Il dispositivo %s non ha un volume persistente
+
+#: ../lib/Tails/Persistence/Setup.pm:464
+msgid 
+Cannot delete the persistent volume while in use. You should restart Tails 
+without persistence.
+msgstr Impossibile cancellare un volume 

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

2012-10-10 Thread translation
commit 3694d3498b596479043dbf6d3039279129d53f4e
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 12:45:07 2012 +

Update translations for tsum
---
 eu/short-user-manual_eu_noimg.xhtml |  131 +++
 1 files changed, 131 insertions(+), 0 deletions(-)

diff --git a/eu/short-user-manual_eu_noimg.xhtml 
b/eu/short-user-manual_eu_noimg.xhtml
new file mode 100644
index 000..e2de448
--- /dev/null
+++ b/eu/short-user-manual_eu_noimg.xhtml
@@ -0,0 +1,131 @@
+html xmlns=http://www.w3.org/1999/xhtml;
+  head
+meta http-equiv=Content-Type content=text/html; charset=utf-8/
+title/
+  /head
+  body
+h1 id=the-short-user-manualErabiltzaile Eskuliburu Laburra/h1
+pThis user manual contains information about how to download Tor, how to 
use it, and what to do if Tor is unable to connect to the network. If you can't 
find the answer to your question in this document, email 
h...@rt.torproject.org./p
+pPlease note that we are providing support on a voluntary basis, and we 
get a lot of emails every single day. There is no need to worry if we don't get 
back to you straight away./p
+h2 id=how-tor-worksHow Tor works/h2
+pTor is a network of virtual tunnels that allows you to improve your 
privacy and security on the Internet. Tor works by sending your traffic through 
three random servers (also known as emrelays/em) in the Tor network, before 
the traffic is sent out onto the public Internet./p
+pThe image above illustrates a user browsing to different websites over 
Tor. The green monitors represent relays in the Tor network, while the three 
keys represent the layers of encryption between the user and each relay./p
+pTor will anonymize the origin of your traffic, and it will encrypt 
everything between you and the Tor network. Tor will also encrypt your traffic 
inside the Tor network, but it cannot encrypt your traffic between the Tor 
network and its final destination./p
+pIf you are communicating sensitive information, for example when 
logging on to a website with a username and password, make sure that you are 
using HTTPS (e.g. stronghttps/strong://torproject.org/, not 
stronghttp/strong://torproject.org/)./p
+h2 id=how-to-download-torTor nola deskargatu/h2
+pThe bundle we recommend to most users is the a 
href=https://www.torproject.org/projects/torbrowser.html;Tor Browser 
Bundle/a. This bundle contains a browser preconfigured to safely browse the 
Internet through Tor, and requires no installation. You download the bundle, 
extract the archive, and start Tor./p
+pThere are two different ways to get hold of the Tor software. You can 
either browse to the a href=https://www.torproject.org/;Tor Project 
website/a and download it there, or you can use GetTor, the email 
autoresponder./p
+h3 id=how-to-get-tor-via-emailHow to get Tor via email/h3
+pTo receive the English Tor Browser Bundle for Windows, send an email to 
get...@torproject.org with strongwindows/strong in the body of the message. 
You can leave the subject blank./p
+pYou can also request the Tor Browser Bundle for Mac OS X (write 
strongmacos-i386/strong), and Linux (write stronglinux-i386/strong for 
32-bit systems or stronglinux-x86_64/strong for 64-bit systems)./p
+pIf you want a translated version of Tor, write stronghelp/strong 
instead. You will then receive an email with instructions and a list of 
available languages./p
+pstrongNote/strong: The Tor Browser Bundles for Linux and Mac OS X 
are rather large, and you will not be able to receive any of these bundles with 
a Gmail, Hotmail or Yahoo account. If you cannot receive the bundle you want, 
send an email to h...@rt.torproject.org and we will give you a list of website 
mirrors to use./p
+h3 id=tor-for-smartphonesTor for smartphones/h3
+pYou can get Tor on your Android device by installing the package named 
emOrbot/em. For information about how to download and install Orbot, please 
see the a href=https://www.torproject.org/docs/android.html.en;Tor Project 
website/a./p
+pWe also have experimental packages for a 
href=https://www.torproject.org/docs/N900.html.en;Nokia Maemo/N900/a and a 
href=http://sid77.slackware.it/ios/;Apple iOS/a./p
+h3 id=how-to-verify-that-you-have-the-right-versionHow to verify that 
you have the right version/h3
+pBefore running the Tor Browser Bundle, you should make sure that you 
have the right version./p
+pThe software you receive is accompanied by a file with the same name as 
the bundle and the extension strong.asc/strong. This .asc file is a GPG 
signature, and will allow you to verify the file you've downloaded is exactly 
the one that we intended you to get./p
+pBefore you can verify the signature, you will have to download and 
install GnuPG:/p
+pstrongWindows/strong: a 
href=http://gpg4win.org/download.html;http://gpg4win.org/download.html/abr/strongMac
 OS X/strong: a 

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

2012-10-10 Thread translation
commit fda3a2ca195408987a5822ca8ef3d287133ee7e5
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 12:45:39 2012 +

Update translations for tails-persistence-setup
---
 eu/eu.po |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/eu/eu.po b/eu/eu.po
index 5ded490..b4b5f0e 100644
--- a/eu/eu.po
+++ b/eu/eu.po
@@ -9,7 +9,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-10-03 16:16+0200\n
-PO-Revision-Date: 2012-10-09 14:54+\n
+PO-Revision-Date: 2012-10-10 12:19+\n
 Last-Translator: Antxon Baldarra balda...@euskalerria.org\n
 Language-Team: LANGUAGE l...@li.org\n
 MIME-Version: 1.0\n
@@ -182,7 +182,7 @@ msgstr 
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:54
 msgid Persistence wizard - Persistent volume creation
-msgstr 
+msgstr Iraunkortasun morroia - Euskarri iraunkorren sorkuntza
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:57
 msgid Choose a passphrase to protect the persistent volume

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


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

2012-10-10 Thread translation
commit f3287468bddbfb47bad7f093ffca43e4e6121c5d
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 13:15:06 2012 +

Update translations for orbot
---
 values-fa/strings.xml |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/values-fa/strings.xml b/values-fa/strings.xml
index fead2b6..4cbbb18 100644
--- a/values-fa/strings.xml
+++ b/values-fa/strings.xml
@@ -75,6 +75,7 @@
   string name=wizard_tips_otrchatربات پرچونه - کلاینت 
گفتگوی امن برای اندروید/string
   string name=wizard_tips_proxyتنظیمات پروکسی - 
یادگیری تنظیم اپلیکیشن ها برای کار با ربات 
پیازی/string
   string name=wizard_tips_duckgoاپلیکیشن موتور جستجوی 
داک داک گو/string
+  string name=wizard_tips_twitterتوییتر از \http proxy 
\localhost:8118 پشتیبانی می کند/string
   string name=wizard_proxy_help_infoتنظیمات پروکسی/string
   string name=wizard_proxy_help_msgاگر اپلیکشین آندروید 
مورد استفاده شما قابلیت کار با HTTP و یا SOCKS 
پروکسی دارد می توانید تنظیمش کنید تا به 
ربات پیازی وصل شود و از تور استفاده کند. 
تنظیمات سرویس دهنده 127.0.0.1 و یا \سرویس-ده 
محلی\ است. برای HTTP تنظیمات پورت 8118 است. برای 
SOCKS، پروکسی مناسب، 9050 است. شما می بایست SOCKS4A  
و یا  در صورت امکان از socks5 استفاده کنید. در 
صورت نیاز به اطلاعات بیشتر در مورد انتقالده 
اندروید، می توانید به FAQ (سوالهای معمول) در 
http://tinyurl.com/proxyandroid مراجعه کنید./string
   string name=wizard_finalربات پیازی آماده استفاده 
میباشد!/string

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


[tor-commits] [translation/liveusb-creator] Update translations for liveusb-creator

2012-10-10 Thread translation
commit 535896d6d0ece024e5bf53b9ec5c1f8bf7c39e9b
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 14:15:36 2012 +

Update translations for liveusb-creator
---
 nl/nl.po |   41 +
 1 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
index d909730..66758cc 100644
--- a/nl/nl.po
+++ b/nl/nl.po
@@ -4,13 +4,14 @@
 # 
 # Translators:
 # Geert Warrink geert.warr...@onsnet.nu, 2009-2010.
+# Richard E. van der Luit nip...@fedoraproject.org, 2012.
 msgid 
 msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-04-13 14:16+0200\n
-PO-Revision-Date: 2012-10-03 18:09+\n
-Last-Translator: Tor Project tor-assista...@torproject.org\n
+PO-Revision-Date: 2012-10-10 14:15+\n
+Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
 Language-Team: LANGUAGE l...@li.org\n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=UTF-8\n
@@ -31,7 +32,7 @@ msgstr Downloaden %s...
 #: ../liveusb/gui.py:197
 #, python-format
 msgid Device is too small: it must be at least %s MiB.
-msgstr 
+msgstr Apparaat heeft te weinig opslagcapaciteit: tenminste %s MiB is 
vereist.
 
 #: ../liveusb/gui.py:226
 msgid 
@@ -42,7 +43,7 @@ msgstr Fout: Kan het label niet zetten of de UUID van jouw 
apparaat niet verkri
 #: ../liveusb/gui.py:276
 #, python-format
 msgid Installation complete! (%s)
-msgstr 
+msgstr Installatie afgerond! (%s)
 
 #: ../liveusb/gui.py:281
 msgid LiveUSB creation failed!
@@ -53,11 +54,11 @@ msgid 
 Warning: This tool needs to be run as an Administrator. To do this, right 
 click on the icon and open the Properties. Under the Compatibility tab, 
 check the \Run this program as an administrator\ box.
-msgstr 
+msgstr Waarschuwing: Deze tool moet als beheerder worden gestart. Om dat te 
doen, klik met rechter muisknop op het icoon en open Eigenschappen. onder de 
Compatibiliteit tab, check de \Start dit programma als beheerder\ box.
 
 #: ../liveusb/gui.py:413
 msgid Unable to find any USB drive
-msgstr 
+msgstr Kan geen USB apparaten vinden
 
 #: ../liveusb/gui.py:521
 msgid 
@@ -68,23 +69,23 @@ msgstr 
 #: ../liveusb/gui.py:528
 #, python-format
 msgid No free space on device %(device)s
-msgstr 
+msgstr Er is niet genoeg vrije ruimte op apparaat %(device)s
 
 #: ../liveusb/gui.py:533
 msgid Partition is FAT16; Restricting overlay size to 2G
-msgstr 
+msgstr Partitie is FAT16; Overlay size wordt beperkt tot 2G
 
 #: ../liveusb/gui.py:577
 msgid Persistent Storage
-msgstr 
+msgstr Duurzame geheugenruimte
 
 #: ../liveusb/gui.py:586
 msgid Installation complete!
-msgstr 
+msgstr Installatie afgerond!
 
 #: ../liveusb/gui.py:587
 msgid Installation was completed. Press OK to close this program.
-msgstr 
+msgstr Installatie is afgerond. Klik op OK om dit programma af te sluiten.
 
 #: ../liveusb/gui.py:610
 msgid 
@@ -101,7 +102,7 @@ msgstr 
 
 #: ../liveusb/gui.py:638
 msgid Unable to mount device
-msgstr 
+msgstr Kan apparaat niet aankoppelen
 
 #: ../liveusb/gui.py:644
 msgid Warning: All data on the selected drive will be lost.
@@ -109,11 +110,11 @@ msgstr 
 
 #: ../liveusb/gui.py:646 ../liveusb/gui.py:663
 msgid Press 'Next' if you wish to continue.
-msgstr 
+msgstr Druk op 'Verder' als je verder wilt gaan.
 
 #: ../liveusb/gui.py:648 ../liveusb/gui.py:665
 msgid Next
-msgstr 
+msgstr Verder
 
 #: ../liveusb/gui.py:658
 msgid 
@@ -136,7 +137,7 @@ msgstr Download mislukte: 
 
 #: ../liveusb/gui.py:722
 msgid You can try again to resume your download
-msgstr Je kunt opnieuw proberen jouw download voort te zetten
+msgstr Je kunt opnieuw proberen je download voort te zetten
 
 #: ../liveusb/gui.py:728
 msgid Select Live ISO
@@ -146,22 +147,22 @@ msgstr Selecteer Live ISO
 msgid 
 The selected file is unreadable.Please fix its permissions or select another
  file.
-msgstr 
+msgstr Het geselecteerde bestand is niet leesbaar. Verander bestandspermissie 
of selecteer een ander bestand.
 
 #: ../liveusb/gui.py:737
 msgid 
 Unable to use the selected file.  You may have better luck if you move your 
 ISO to the root of your drive (ie: C:\\)
-msgstr 
+msgstr Kan geselecteerd bestand niet gebruiken.  Je kunt meer geluk hebben 
als je jouw ISO verplaatst naar het hoogste niveau van jouw schijf (b.v.: C:\\)
 
 #: ../liveusb/gui.py:743
 #, python-format
 msgid %(filename)s selected
-msgstr 
+msgstr %(filename)s geselecteerd
 
 #: ../liveusb/creator.py:91
 msgid You must run this application as root
-msgstr 
+msgstr Deze applicatie moet gestart worden als beheerder
 
 #: ../liveusb/creator.py:130
 msgid 
@@ -170,7 +171,7 @@ msgstr 
 
 #: ../liveusb/creator.py:132
 msgid Verifying ISO MD5 checksum
-msgstr 
+msgstr Verifiëren ISO MD5 checksum
 
 #: ../liveusb/creator.py:137
 msgid ISO MD5 checksum verification failed

___
tor-commits mailing list
tor-commits@lists.torproject.org

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

2012-10-10 Thread translation
commit ce77f6c5e993cb8da894d2c86e85576d46c56fad
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 14:15:39 2012 +

Update translations for tails-greeter
---
 nl/nl.po |  137 ++
 1 files changed, 137 insertions(+), 0 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
new file mode 100644
index 000..e8d804e
--- /dev/null
+++ b/nl/nl.po
@@ -0,0 +1,137 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Richard E. van der Luit nip...@fedoraproject.org, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-06-01 15:10+0200\n
+PO-Revision-Date: 2012-10-10 13:58+\n
+Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
+Language-Team: LANGUAGE l...@li.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: nl\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+
+#: ../glade/persistencewindow.glade.h:1 ../glade/optionswindow.glade.h:1
+#: ../GdmGreeter/persistencewindow.py:128
+msgid Login
+msgstr Login
+
+#: ../glade/persistencewindow.glade.h:2 ../glade/optionswindow.glade.h:2
+msgid Welcome to Tails
+msgstr Welkom bij Tails
+
+#: ../glade/persistencewindow.glade.h:3
+msgid Use persistence?
+msgstr Persistentie gebruiken?
+
+#: ../glade/persistencewindow.glade.h:4
+msgid Yes
+msgstr Ja
+
+#: ../glade/persistencewindow.glade.h:5
+msgid No
+msgstr Nee
+
+#: ../glade/persistencewindow.glade.h:6
+msgid Passphrase:
+msgstr Wachtzin:
+
+#: ../glade/persistencewindow.glade.h:7
+msgid Read-Only?
+msgstr Read-Only?
+
+#: ../glade/persistencewindow.glade.h:8 ../glade/optionswindow.glade.h:8
+#: ../glade/langpanel.glade.h:1
+msgid  
+msgstr  
+
+#: ../glade/persistencewindow.glade.h:9
+msgid More options?
+msgstr Meer opties?
+
+#: ../glade/optionswindow.glade.h:3
+msgid Administration password
+msgstr Beheerderswachtwoord
+
+#: ../glade/optionswindow.glade.h:4
+msgid 
+Enter an administration password in case you need to perform administration 
tasks.\n
+Otherwise it will be disabled for better security.
+msgstr Voer een beheerderswachtwoord in wanneer je beheerstaken moet kunnen 
uitvoeren.\nNiets ingevuld zal beheer worden uitgeschakeld voor betere 
veiligheid.
+
+#: ../glade/optionswindow.glade.h:6
+msgid Password:
+msgstr Wachtwoord:
+
+#: ../glade/optionswindow.glade.h:7
+msgid Verify Password:
+msgstr Wachtwoord verifiëren:
+
+#: ../glade/optionswindow.glade.h:9
+msgid Windows Camouflage
+msgstr Windows Camouflage
+
+#: ../glade/optionswindow.glade.h:10
+msgid 
+This option makes Tails look more like Microsoft Windows XP. This may be 
+useful in public places in order to avoid attracting suspicion.
+msgstr Deze optie zorgt ervoor dat Tails meer op Microsoft Windows XP lijkt. 
Dit kan handig zijn om op openbare plekken geen verdenking te wekken. 
+
+#: ../glade/optionswindow.glade.h:11
+msgid Activate Microsoft Windows XP Camouflage
+msgstr Activeer Microsoft Windows XP Camouflage
+
+#: ../glade/langpanel.glade.h:2 ../GdmGreeter/langpanel.py:42
+msgid Language
+msgstr Taal
+
+#: ../glade/langpanel.glade.h:3
+msgid Locale
+msgstr Locale
+
+#: ../glade/langpanel.glade.h:4
+msgid Layout
+msgstr Layout
+
+#: ../GdmGreeter/optionswindow.py:68
+msgid iPasswords do not match/i
+msgstr iWachtwoorden zijn niet gelijk/i
+
+#: ../GdmGreeter/persistence.py:59
+#, python-format
+msgid 
+live-persist failed with return code %(returncode)s:\n
+%(stderr)s
+msgstr live-persist lukte niet, return code %(returncode)s:\n%(stderr)s
+
+#: ../GdmGreeter/persistence.py:99
+#, python-format
+msgid 
+cryptsetup failed with return code %(returncode)s:\n
+%(stdout)s\n
+%(stderr)s
+msgstr cryptsetup lukte niet, return code 
%(returncode)s:\n%(stdout)s\n%(stderr)s
+
+#: ../GdmGreeter/persistence.py:124
+#, python-format
+msgid 
+live-persist failed with return code %(returncode)s:\n
+%(stdout)s\n
+%(stderr)s
+msgstr live-persist lukte niet, return code 
%(returncode)s:\n%(stdout)s\n%(stderr)s
+
+#: ../GdmGreeter/persistencewindow.py:94
+msgid iWrong passphrase. Please try again./i
+msgstr iVerkeerd wachtwoord. Probeer opnieuw./i
+
+#: ../GdmGreeter/langpanel.py:124 ../GdmGreeter/langpanel.py:148
+#: ../GdmGreeter/langpanel.py:181
+msgid Other...
+msgstr Anders...

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


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

2012-10-10 Thread translation
commit 2cd25c9e9eb80017e563a52434947a0d0d7e9119
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 14:15:40 2012 +

Update translations for tails-greeter_completed
---
 nl/nl.po |  137 ++
 1 files changed, 137 insertions(+), 0 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
new file mode 100644
index 000..e8d804e
--- /dev/null
+++ b/nl/nl.po
@@ -0,0 +1,137 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Richard E. van der Luit nip...@fedoraproject.org, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-06-01 15:10+0200\n
+PO-Revision-Date: 2012-10-10 13:58+\n
+Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
+Language-Team: LANGUAGE l...@li.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: nl\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+
+#: ../glade/persistencewindow.glade.h:1 ../glade/optionswindow.glade.h:1
+#: ../GdmGreeter/persistencewindow.py:128
+msgid Login
+msgstr Login
+
+#: ../glade/persistencewindow.glade.h:2 ../glade/optionswindow.glade.h:2
+msgid Welcome to Tails
+msgstr Welkom bij Tails
+
+#: ../glade/persistencewindow.glade.h:3
+msgid Use persistence?
+msgstr Persistentie gebruiken?
+
+#: ../glade/persistencewindow.glade.h:4
+msgid Yes
+msgstr Ja
+
+#: ../glade/persistencewindow.glade.h:5
+msgid No
+msgstr Nee
+
+#: ../glade/persistencewindow.glade.h:6
+msgid Passphrase:
+msgstr Wachtzin:
+
+#: ../glade/persistencewindow.glade.h:7
+msgid Read-Only?
+msgstr Read-Only?
+
+#: ../glade/persistencewindow.glade.h:8 ../glade/optionswindow.glade.h:8
+#: ../glade/langpanel.glade.h:1
+msgid  
+msgstr  
+
+#: ../glade/persistencewindow.glade.h:9
+msgid More options?
+msgstr Meer opties?
+
+#: ../glade/optionswindow.glade.h:3
+msgid Administration password
+msgstr Beheerderswachtwoord
+
+#: ../glade/optionswindow.glade.h:4
+msgid 
+Enter an administration password in case you need to perform administration 
tasks.\n
+Otherwise it will be disabled for better security.
+msgstr Voer een beheerderswachtwoord in wanneer je beheerstaken moet kunnen 
uitvoeren.\nNiets ingevuld zal beheer worden uitgeschakeld voor betere 
veiligheid.
+
+#: ../glade/optionswindow.glade.h:6
+msgid Password:
+msgstr Wachtwoord:
+
+#: ../glade/optionswindow.glade.h:7
+msgid Verify Password:
+msgstr Wachtwoord verifiëren:
+
+#: ../glade/optionswindow.glade.h:9
+msgid Windows Camouflage
+msgstr Windows Camouflage
+
+#: ../glade/optionswindow.glade.h:10
+msgid 
+This option makes Tails look more like Microsoft Windows XP. This may be 
+useful in public places in order to avoid attracting suspicion.
+msgstr Deze optie zorgt ervoor dat Tails meer op Microsoft Windows XP lijkt. 
Dit kan handig zijn om op openbare plekken geen verdenking te wekken. 
+
+#: ../glade/optionswindow.glade.h:11
+msgid Activate Microsoft Windows XP Camouflage
+msgstr Activeer Microsoft Windows XP Camouflage
+
+#: ../glade/langpanel.glade.h:2 ../GdmGreeter/langpanel.py:42
+msgid Language
+msgstr Taal
+
+#: ../glade/langpanel.glade.h:3
+msgid Locale
+msgstr Locale
+
+#: ../glade/langpanel.glade.h:4
+msgid Layout
+msgstr Layout
+
+#: ../GdmGreeter/optionswindow.py:68
+msgid iPasswords do not match/i
+msgstr iWachtwoorden zijn niet gelijk/i
+
+#: ../GdmGreeter/persistence.py:59
+#, python-format
+msgid 
+live-persist failed with return code %(returncode)s:\n
+%(stderr)s
+msgstr live-persist lukte niet, return code %(returncode)s:\n%(stderr)s
+
+#: ../GdmGreeter/persistence.py:99
+#, python-format
+msgid 
+cryptsetup failed with return code %(returncode)s:\n
+%(stdout)s\n
+%(stderr)s
+msgstr cryptsetup lukte niet, return code 
%(returncode)s:\n%(stdout)s\n%(stderr)s
+
+#: ../GdmGreeter/persistence.py:124
+#, python-format
+msgid 
+live-persist failed with return code %(returncode)s:\n
+%(stdout)s\n
+%(stderr)s
+msgstr live-persist lukte niet, return code 
%(returncode)s:\n%(stdout)s\n%(stderr)s
+
+#: ../GdmGreeter/persistencewindow.py:94
+msgid iWrong passphrase. Please try again./i
+msgstr iVerkeerd wachtwoord. Probeer opnieuw./i
+
+#: ../GdmGreeter/langpanel.py:124 ../GdmGreeter/langpanel.py:148
+#: ../GdmGreeter/langpanel.py:181
+msgid Other...
+msgstr Anders...

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


[tor-commits] [translation/liveusb-creator] Update translations for liveusb-creator

2012-10-10 Thread translation
commit d60f8b3a6a733a3f7f422acc6cda3f13264bcd4c
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:15:36 2012 +

Update translations for liveusb-creator
---
 nl/nl.po |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
index b6d7f5f..991e826 100644
--- a/nl/nl.po
+++ b/nl/nl.po
@@ -10,7 +10,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-04-13 14:16+0200\n
-PO-Revision-Date: 2012-10-10 14:45+\n
+PO-Revision-Date: 2012-10-10 14:57+\n
 Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
 Language-Team: LANGUAGE l...@li.org\n
 MIME-Version: 1.0\n
@@ -64,7 +64,7 @@ msgstr Kan geen USB apparaten vinden
 msgid 
 Device is not yet mounted, so we cannot determine the amount of free space.
   Setting a maximum limit of 8G for the persistent storage.
-msgstr 
+msgstr Apparaat is nog niet aangekoppeld, dus de hoeveelheid vrije ruimte 
erop kan niet worden vastgesteld.  Een maximumlimiet van 8G voor duurzame 
opslag wordt ingesteld.
 
 #: ../liveusb/gui.py:528
 #, python-format
@@ -336,7 +336,7 @@ msgstr Verwijderen %(file)s
 #: ../liveusb/creator.py:1017
 #, python-format
 msgid %s already bootable
-msgstr 
+msgstr %s is al bootable
 
 #: ../liveusb/creator.py:1037
 msgid Unable to find partition
@@ -345,34 +345,34 @@ msgstr Kan geen partitie vinden
 #: ../liveusb/creator.py:1060
 #, python-format
 msgid Formatting %(device)s as FAT32
-msgstr 
+msgstr Formatteren %(device)s als FAT32
 
 #: ../liveusb/creator.py:1109
 #, python-format
 msgid Resetting Master Boot Record of %s
-msgstr 
+msgstr Resetten Master Boot Record van %s
 
 #: ../liveusb/creator.py:1112
 msgid 
 Unable to reset MBR.  You may not have the `syslinux` package installed.
-msgstr 
+msgstr Niet in staat de MBR te resetten. Mogelijk is het `syslinux` pakket 
niet geïnstalleerd.
 
 #: ../liveusb/creator.py:1115
 msgid Drive is a loopback, skipping MBR reset
-msgstr 
+msgstr Station is een loopback, MBR-reset wordt overgeslagen
 
 #: ../liveusb/creator.py:1119 ../liveusb/creator.py:1382
 #, python-format
 msgid Calculating the SHA1 of %s
-msgstr 
+msgstr SHA1 berekenen van %s
 
 #: ../liveusb/creator.py:1143
 msgid Synchronizing data on disk...
-msgstr 
+msgstr Data synchroniseren op schijf...
 
 #: ../liveusb/creator.py:1195
 msgid Error probing device
-msgstr 
+msgstr Fout bij proben apparaat
 
 #: ../liveusb/creator.py:1197
 msgid Unable to find any removable device
@@ -393,14 +393,14 @@ msgstr Niet ondersteund bestandssysteem: %s\nMaak een 
back-up en formatteer jou
 #: ../liveusb/creator.py:1277
 msgid 
 Unable to get Win32_LogicalDisk; win32com query did not return any results
-msgstr 
+msgstr Niet in staat Win32_LogicalDisk te verkrijgen; win32com query gaf geen 
zoekresultaat
 
 #: ../liveusb/creator.py:1330
 msgid Cannot find
-msgstr 
+msgstr Niet gevonden:
 
 #: ../liveusb/creator.py:1331
 msgid 
 Make sure to extract the entire liveusb-creator zip file before running this
  program.
-msgstr 
+msgstr Wees er zeker van dat het hele liveusb-creator zip bestand is 
uitgepakt voordat je dit programma draait.

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


[tor-commits] [translation/liveusb-creator_completed] Update translations for liveusb-creator_completed

2012-10-10 Thread translation
commit 1455108fdbc7656b4ca7a1fb96b64e6d40938699
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:15:38 2012 +

Update translations for liveusb-creator_completed
---
 nl/nl.po |  406 ++
 1 files changed, 406 insertions(+), 0 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
new file mode 100644
index 000..991e826
--- /dev/null
+++ b/nl/nl.po
@@ -0,0 +1,406 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Geert Warrink geert.warr...@onsnet.nu, 2009-2010.
+# Richard E. van der Luit nip...@fedoraproject.org, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-04-13 14:16+0200\n
+PO-Revision-Date: 2012-10-10 14:57+\n
+Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
+Language-Team: LANGUAGE l...@li.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: nl\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+
+#: ../liveusb/gui.py:80
+#, python-format
+msgid Unknown release: %s
+msgstr Onbekende vrijgave: %s
+
+#: ../liveusb/gui.py:84
+#, python-format
+msgid Downloading %s...
+msgstr Downloaden %s...
+
+#: ../liveusb/gui.py:197
+#, python-format
+msgid Device is too small: it must be at least %s MiB.
+msgstr Apparaat heeft te weinig opslagcapaciteit: tenminste %s MiB is 
vereist.
+
+#: ../liveusb/gui.py:226
+msgid 
+Error: Cannot set the label or obtain the UUID of your device.  Unable to 
+continue.
+msgstr Fout: Kan het label niet zetten of de UUID van jouw apparaat niet 
verkrijgen.  Kan niet verder gaan.
+
+#: ../liveusb/gui.py:276
+#, python-format
+msgid Installation complete! (%s)
+msgstr Installatie afgerond! (%s)
+
+#: ../liveusb/gui.py:281
+msgid LiveUSB creation failed!
+msgstr LiveUSB aanmaken faalde!
+
+#: ../liveusb/gui.py:388
+msgid 
+Warning: This tool needs to be run as an Administrator. To do this, right 
+click on the icon and open the Properties. Under the Compatibility tab, 
+check the \Run this program as an administrator\ box.
+msgstr Waarschuwing: Deze tool moet als beheerder worden gestart. Om dat te 
doen, klik met rechter muisknop op het icoon en open Eigenschappen. onder de 
Compatibiliteit tab, check de \Start dit programma als beheerder\ box.
+
+#: ../liveusb/gui.py:413
+msgid Unable to find any USB drive
+msgstr Kan geen USB apparaten vinden
+
+#: ../liveusb/gui.py:521
+msgid 
+Device is not yet mounted, so we cannot determine the amount of free space.
+  Setting a maximum limit of 8G for the persistent storage.
+msgstr Apparaat is nog niet aangekoppeld, dus de hoeveelheid vrije ruimte 
erop kan niet worden vastgesteld.  Een maximumlimiet van 8G voor duurzame 
opslag wordt ingesteld.
+
+#: ../liveusb/gui.py:528
+#, python-format
+msgid No free space on device %(device)s
+msgstr Er is niet genoeg vrije ruimte op apparaat %(device)s
+
+#: ../liveusb/gui.py:533
+msgid Partition is FAT16; Restricting overlay size to 2G
+msgstr Partitie is FAT16; Overlay size wordt beperkt tot 2G
+
+#: ../liveusb/gui.py:577
+msgid Persistent Storage
+msgstr Duurzame geheugenruimte
+
+#: ../liveusb/gui.py:586
+msgid Installation complete!
+msgstr Installatie afgerond!
+
+#: ../liveusb/gui.py:587
+msgid Installation was completed. Press OK to close this program.
+msgstr Installatie is afgerond. Klik op OK om dit programma af te sluiten.
+
+#: ../liveusb/gui.py:610
+msgid 
+The Master Boot Record on your device is blank. Pressing 'Create Live USB' 
+again will reset the MBR on this device.
+msgstr De Master Boot Record op dit apparaat is blanco. Nogmaals aanklikken 
van 'Creëer Live USB' zal de MBR op dit apparaat resetten.
+
+#: ../liveusb/gui.py:624
+msgid 
+Warning: The Master Boot Record on your device does not match your system's 
+syslinux MBR.  If you have trouble booting this stick, try running the 
+liveusb-creator with the --reset-mbr option.
+msgstr Waarschuwing: De Master Boot Record op dit apparaat komt niet overeen 
met de syslinux MBR van je systeem.  Indien er moeilijkheden zijn bij het 
booten van deze stick, draai dan  liveusb-creator  met optie  --reset-mbr 
+
+#: ../liveusb/gui.py:638
+msgid Unable to mount device
+msgstr Kan apparaat niet aankoppelen
+
+#: ../liveusb/gui.py:644
+msgid Warning: All data on the selected drive will be lost.
+msgstr Waarschuwing: Alle data op de geselecteerde schijf zal verloren gaan.
+
+#: ../liveusb/gui.py:646 ../liveusb/gui.py:663
+msgid Press 'Next' if you wish to continue.
+msgstr Druk op 'Verder' als je verder wilt gaan.
+
+#: ../liveusb/gui.py:648 ../liveusb/gui.py:665
+msgid Next
+msgstr Verder
+
+#: ../liveusb/gui.py:658
+msgid 
+Your device already contains a LiveOS.\n
+If you continue, this will be overwritten.
+msgstr Jouw apparaat 

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

2012-10-10 Thread translation
commit 2904cf35785dd2fd8a95190dbb79d1a2c49b08ea
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:15:39 2012 +

Update translations for tails-persistence-setup
---
 nl/nl.po |  319 ++
 1 files changed, 319 insertions(+), 0 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
new file mode 100644
index 000..dac5c5a
--- /dev/null
+++ b/nl/nl.po
@@ -0,0 +1,319 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Tails developers
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Richard E. van der Luit nip...@fedoraproject.org, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-10-03 16:16+0200\n
+PO-Revision-Date: 2012-10-10 15:15+\n
+Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
+Language-Team: LANGUAGE l...@li.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: nl\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:48
+msgid Personal Data
+msgstr Persoonlijke Data
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:50
+msgid Keep files stored in the `Persistent' directory
+msgstr Houd bestanden opgeslagen in de 'Duurzaam'-map
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:58
+msgid GnuPG
+msgstr GnuPG
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:60
+msgid GnuPG keyrings and configuration
+msgstr GnuPG sleutelring  en configuratie
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:68
+msgid SSH Client
+msgstr SSH Client
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:70
+msgid SSH keys, configuration and known hosts
+msgstr 
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:78
+msgid Pidgin
+msgstr Pidgin
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:80
+msgid Pidgin profiles and OTR keyring
+msgstr Pidgin-profielen en OTR-sleutelring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:88
+msgid Claws Mail
+msgstr Claws Mail
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:90
+msgid Claws Mail profiles and locally stored email
+msgstr Claws Mail-profielen en lokaal opgeslagen email
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:98
+msgid GNOME Keyring
+msgstr GNOME sleutelring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:100
+msgid Secrets stored by GNOME Keyring
+msgstr Secrets opgeslagen GNOME sleutelring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:108
+msgid Network Connections
+msgstr Netwerkconnecties
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:110
+msgid Configuration of network devices and connections
+msgstr Configuratie van netwerkapparaten en connecties
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:118
+msgid APT Packages
+msgstr APT-pakketten
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:120
+msgid Packages downloaded by APT
+msgstr Pakketten door APT gedownload
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:128
+msgid APT Lists
+msgstr APT-lijsten
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:130
+msgid Lists downloaded by APT
+msgstr Lijsten gedownload door APT
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:138
+msgid Dotfiles
+msgstr Puntbestanden
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:140
+msgid 
+Symlink into $HOME every file or directory found in the `dotfiles' directory
+msgstr Symlink naar $HOME elk bestand of map dat gevonden is in 
`puntbestanden'-map
+
+#: ../lib/Tails/Persistence/Setup.pm:259
+msgid 
+The device Tails is running from cannot be found. Maybe you used the `toram'
+ option?
+msgstr Het apparaat waarvan Tails is opgestart kan niet worden gevonden. 
Misschien heb je de optie 'toram' gebruikt?
+
+#: ../lib/Tails/Persistence/Setup.pm:284
+msgid 'Unparseable partition path.'
+msgstr 'Niet-parsebare partitie pad.'
+
+#: ../lib/Tails/Persistence/Setup.pm:298
+msgid Setup Tails persistent volume
+msgstr Instellingen Tails persistent volume
+
+#: ../lib/Tails/Persistence/Setup.pm:442
+#, perl-format
+msgid Device %s already has a persistent volume.
+msgstr Apparaat %s heeft al een persistent volume.
+
+#: ../lib/Tails/Persistence/Setup.pm:450
+#, perl-format
+msgid Device %s has not enough unallocated space.
+msgstr Apparaat %s heeft niet genoeg ongealloceerde ruimte.
+
+#: ../lib/Tails/Persistence/Setup.pm:458 ../lib/Tails/Persistence/Setup.pm:472
+#, perl-format
+msgid Device %s has no persistent volume.
+msgstr Apparaat %s heeft geen persistent volume.
+
+#: ../lib/Tails/Persistence/Setup.pm:464
+msgid 
+Cannot delete the persistent volume while in use. You should restart Tails 
+without persistence.
+msgstr Kan geen persistent volume verwijderen wanneer dat in gebruik is. Je 
dient Tails op te starten zonder persistentie.
+

[tor-commits] [translation/liveusb-creator] Update translations for liveusb-creator

2012-10-10 Thread translation
commit f492f4ea0422fbcc2971ac30cc54be2e3e0d4dd4
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:45:35 2012 +

Update translations for liveusb-creator
---
 nl/nl.po |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
index 991e826..ba75084 100644
--- a/nl/nl.po
+++ b/nl/nl.po
@@ -10,7 +10,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-04-13 14:16+0200\n
-PO-Revision-Date: 2012-10-10 14:57+\n
+PO-Revision-Date: 2012-10-10 15:42+\n
 Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
 Language-Team: LANGUAGE l...@li.org\n
 MIME-Version: 1.0\n
@@ -64,7 +64,7 @@ msgstr Kan geen USB apparaten vinden
 msgid 
 Device is not yet mounted, so we cannot determine the amount of free space.
   Setting a maximum limit of 8G for the persistent storage.
-msgstr Apparaat is nog niet aangekoppeld, dus de hoeveelheid vrije ruimte 
erop kan niet worden vastgesteld.  Een maximumlimiet van 8G voor duurzame 
opslag wordt ingesteld.
+msgstr Apparaat is nog niet aangekoppeld, dus de hoeveelheid vrije ruimte 
erop kan niet worden vastgesteld.  Een maximumlimiet van 8G voor persistente 
opslag wordt ingesteld.
 
 #: ../liveusb/gui.py:528
 #, python-format
@@ -77,7 +77,7 @@ msgstr Partitie is FAT16; Overlay size wordt beperkt tot 2G
 
 #: ../liveusb/gui.py:577
 msgid Persistent Storage
-msgstr Duurzame geheugenruimte
+msgstr Persistente opslag
 
 #: ../liveusb/gui.py:586
 msgid Installation complete!
@@ -125,7 +125,7 @@ msgstr Jouw apparaat bevat al een LiveOS.\nAls je 
doorgaat, wordt het overschre
 #: ../liveusb/gui.py:661
 msgid 
 Warning: Creating a new persistent overlay will delete your existing one.
-msgstr Waarschuwing: Het maken van een duurzame geheugenruimte zal jouw 
bestaande geheugenruimte verwijderen.
+msgstr Waarschuwing: Het maken van persistente geheugenruimte zal jouw 
bestaande geheugenruimte verwijderen.
 
 #: ../liveusb/gui.py:717
 msgid Download complete!
@@ -226,7 +226,7 @@ msgstr Er is niet genoeg vrije ruimte op het apparaat
 #: ../liveusb/creator.py:428
 #, python-format
 msgid Creating %sMB persistent overlay
-msgstr %sMb duurzame dataruimte aanmaken...
+msgstr %sMb persistente geheugenruimte aanmaken...
 
 #: ../liveusb/creator.py:487
 #, python-format

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


[tor-commits] [translation/liveusb-creator_completed] Update translations for liveusb-creator_completed

2012-10-10 Thread translation
commit 08cb2c1659685eb87f00b7dca2d40af061464c56
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:45:37 2012 +

Update translations for liveusb-creator_completed
---
 nl/nl.po |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
index 991e826..ba75084 100644
--- a/nl/nl.po
+++ b/nl/nl.po
@@ -10,7 +10,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-04-13 14:16+0200\n
-PO-Revision-Date: 2012-10-10 14:57+\n
+PO-Revision-Date: 2012-10-10 15:42+\n
 Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
 Language-Team: LANGUAGE l...@li.org\n
 MIME-Version: 1.0\n
@@ -64,7 +64,7 @@ msgstr Kan geen USB apparaten vinden
 msgid 
 Device is not yet mounted, so we cannot determine the amount of free space.
   Setting a maximum limit of 8G for the persistent storage.
-msgstr Apparaat is nog niet aangekoppeld, dus de hoeveelheid vrije ruimte 
erop kan niet worden vastgesteld.  Een maximumlimiet van 8G voor duurzame 
opslag wordt ingesteld.
+msgstr Apparaat is nog niet aangekoppeld, dus de hoeveelheid vrije ruimte 
erop kan niet worden vastgesteld.  Een maximumlimiet van 8G voor persistente 
opslag wordt ingesteld.
 
 #: ../liveusb/gui.py:528
 #, python-format
@@ -77,7 +77,7 @@ msgstr Partitie is FAT16; Overlay size wordt beperkt tot 2G
 
 #: ../liveusb/gui.py:577
 msgid Persistent Storage
-msgstr Duurzame geheugenruimte
+msgstr Persistente opslag
 
 #: ../liveusb/gui.py:586
 msgid Installation complete!
@@ -125,7 +125,7 @@ msgstr Jouw apparaat bevat al een LiveOS.\nAls je 
doorgaat, wordt het overschre
 #: ../liveusb/gui.py:661
 msgid 
 Warning: Creating a new persistent overlay will delete your existing one.
-msgstr Waarschuwing: Het maken van een duurzame geheugenruimte zal jouw 
bestaande geheugenruimte verwijderen.
+msgstr Waarschuwing: Het maken van persistente geheugenruimte zal jouw 
bestaande geheugenruimte verwijderen.
 
 #: ../liveusb/gui.py:717
 msgid Download complete!
@@ -226,7 +226,7 @@ msgstr Er is niet genoeg vrije ruimte op het apparaat
 #: ../liveusb/creator.py:428
 #, python-format
 msgid Creating %sMB persistent overlay
-msgstr %sMb duurzame dataruimte aanmaken...
+msgstr %sMb persistente geheugenruimte aanmaken...
 
 #: ../liveusb/creator.py:487
 #, python-format

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


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

2012-10-10 Thread translation
commit a0b59765f47b552c0dc7bc464c39858ba394b62f
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:45:38 2012 +

Update translations for tails-persistence-setup
---
 nl/nl.po |   66 +++---
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
index dac5c5a..a15b5ca 100644
--- a/nl/nl.po
+++ b/nl/nl.po
@@ -9,7 +9,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-10-03 16:16+0200\n
-PO-Revision-Date: 2012-10-10 15:15+\n
+PO-Revision-Date: 2012-10-10 15:38+\n
 Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
 Language-Team: LANGUAGE l...@li.org\n
 MIME-Version: 1.0\n
@@ -40,7 +40,7 @@ msgstr SSH Client
 
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:70
 msgid SSH keys, configuration and known hosts
-msgstr 
+msgstr SSH sleutels, configuratie en bekende hosts
 
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:78
 msgid Pidgin
@@ -97,7 +97,7 @@ msgstr Puntbestanden
 #: ../lib/Tails/Persistence/Configuration/Presets.pm:140
 msgid 
 Symlink into $HOME every file or directory found in the `dotfiles' directory
-msgstr Symlink naar $HOME elk bestand of map dat gevonden is in 
`puntbestanden'-map
+msgstr Symlink naar $HOME elk bestand of map dat gevonden is in de 
`puntbestanden'-map
 
 #: ../lib/Tails/Persistence/Setup.pm:259
 msgid 
@@ -107,7 +107,7 @@ msgstr Het apparaat waarvan Tails is opgestart kan niet 
worden gevonden. Missch
 
 #: ../lib/Tails/Persistence/Setup.pm:284
 msgid 'Unparseable partition path.'
-msgstr 'Niet-parsebare partitie pad.'
+msgstr 'Niet-parsebaar partitiepad.'
 
 #: ../lib/Tails/Persistence/Setup.pm:298
 msgid Setup Tails persistent volume
@@ -178,15 +178,15 @@ msgid 
 Any changes you have made will only take effect after restarting Tails.\n
 \n
 You may now close this application.
-msgstr 
+msgstr Veranderingen die je hebt gemaakt worden pas effectief na het 
herstarten van Tails.\n\nJe kan het programma nu afsluiten.
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:54
 msgid Persistence wizard - Persistent volume creation
-msgstr 
+msgstr Persistentie assistent - Persistent volume aanmaken
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:57
 msgid Choose a passphrase to protect the persistent volume
-msgstr 
+msgstr Kies een wachtzin om het persistente volume te beschermen
 
 #. TRANSLATORS: size, device vendor, device model
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:61
@@ -194,7 +194,7 @@ msgstr 
 msgid 
 A %s persistent volume will be created on the b%s %s/b device. Data on 
 this device will be stored in an encrypted form protected by a passphrase.
-msgstr 
+msgstr Een %s persistent volume zal worden aangemaakt op apparaat b%s 
%s/b. Data op dit apparaat zal versleuteld worden opgeslagen en worden 
beschermd met een wachtzin.
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:66
 msgid Create
@@ -206,7 +206,7 @@ msgid 
 understood. Tails can't help you if you use it wrong! See a 
 
href='file:///usr/share/doc/tails/website/doc/first_steps/persistence.en.html'Tails
  documentation about persistence/a to learn more.
-msgstr 
+msgstr bOpgepast!/b Persistentie gebruiken heeft consequenties die goed 
moeten worden begrepen. Tails kan je niet helpen als je het verkeerd toepast! 
Zie a 
href='file:///usr/share/doc/tails/website/doc/first_steps/persistence.en.html'Tails
 documentatie over persistentie/a om er meer over te weten te komen.
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:144
 msgid Passphrase:
@@ -214,55 +214,55 @@ msgstr Wachtzin:
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:154
 msgid Verify Passphrase:
-msgstr 
+msgstr Verifieer wachtzin:
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:167
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:231
 msgid Passphrase can't be empty
-msgstr 
+msgstr Wachtzin kan niet leeg zijn
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:222
 msgid Passphrases do not match
-msgstr 
+msgstr Wachtzinnen komen niet overeen
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:262
 #: ../lib/Tails/Persistence/Step/Configure.pm:189
 msgid Failed
-msgstr 
+msgstr Mislukt
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:269
 #: ../lib/Tails/Persistence/Step/Delete.pm:84
 msgid Correcting attributes on Tails system partition.
-msgstr 
+msgstr Corrigeren van attributen op Tails-systeempartitie.
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:272
 #: ../lib/Tails/Persistence/Step/Delete.pm:87
 msgid The attributes of the Tails system partition will be corrected.
-msgstr 
+msgstr De attributen van de Tails-systeempartitie zullen worden gecorrigeerd.
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:280
 msgid Mounting Tails persistence partition.
-msgstr 
+msgstr Aankoppelen Tails persistente partitie.
 
 #: ../lib/Tails/Persistence/Step/Bootstrap.pm:283
 msgid The Tails persistence partition will be 

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

2012-10-10 Thread translation
commit 04accbe966960ca427c1228b9f99a985590653a6
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 15:45:39 2012 +

Update translations for tails-persistence-setup_completed
---
 nl/nl.po |  319 ++
 1 files changed, 319 insertions(+), 0 deletions(-)

diff --git a/nl/nl.po b/nl/nl.po
new file mode 100644
index 000..a15b5ca
--- /dev/null
+++ b/nl/nl.po
@@ -0,0 +1,319 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Tails developers
+# This file is distributed under the same license as the PACKAGE package.
+# 
+# Translators:
+# Richard E. van der Luit nip...@fedoraproject.org, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-10-03 16:16+0200\n
+PO-Revision-Date: 2012-10-10 15:38+\n
+Last-Translator: Richard E. van der Luit nip...@fedoraproject.org\n
+Language-Team: LANGUAGE l...@li.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: nl\n
+Plural-Forms: nplurals=2; plural=(n != 1);\n
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:48
+msgid Personal Data
+msgstr Persoonlijke Data
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:50
+msgid Keep files stored in the `Persistent' directory
+msgstr Houd bestanden opgeslagen in de 'Duurzaam'-map
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:58
+msgid GnuPG
+msgstr GnuPG
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:60
+msgid GnuPG keyrings and configuration
+msgstr GnuPG sleutelring  en configuratie
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:68
+msgid SSH Client
+msgstr SSH Client
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:70
+msgid SSH keys, configuration and known hosts
+msgstr SSH sleutels, configuratie en bekende hosts
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:78
+msgid Pidgin
+msgstr Pidgin
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:80
+msgid Pidgin profiles and OTR keyring
+msgstr Pidgin-profielen en OTR-sleutelring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:88
+msgid Claws Mail
+msgstr Claws Mail
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:90
+msgid Claws Mail profiles and locally stored email
+msgstr Claws Mail-profielen en lokaal opgeslagen email
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:98
+msgid GNOME Keyring
+msgstr GNOME sleutelring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:100
+msgid Secrets stored by GNOME Keyring
+msgstr Secrets opgeslagen GNOME sleutelring
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:108
+msgid Network Connections
+msgstr Netwerkconnecties
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:110
+msgid Configuration of network devices and connections
+msgstr Configuratie van netwerkapparaten en connecties
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:118
+msgid APT Packages
+msgstr APT-pakketten
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:120
+msgid Packages downloaded by APT
+msgstr Pakketten door APT gedownload
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:128
+msgid APT Lists
+msgstr APT-lijsten
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:130
+msgid Lists downloaded by APT
+msgstr Lijsten gedownload door APT
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:138
+msgid Dotfiles
+msgstr Puntbestanden
+
+#: ../lib/Tails/Persistence/Configuration/Presets.pm:140
+msgid 
+Symlink into $HOME every file or directory found in the `dotfiles' directory
+msgstr Symlink naar $HOME elk bestand of map dat gevonden is in de 
`puntbestanden'-map
+
+#: ../lib/Tails/Persistence/Setup.pm:259
+msgid 
+The device Tails is running from cannot be found. Maybe you used the `toram'
+ option?
+msgstr Het apparaat waarvan Tails is opgestart kan niet worden gevonden. 
Misschien heb je de optie 'toram' gebruikt?
+
+#: ../lib/Tails/Persistence/Setup.pm:284
+msgid 'Unparseable partition path.'
+msgstr 'Niet-parsebaar partitiepad.'
+
+#: ../lib/Tails/Persistence/Setup.pm:298
+msgid Setup Tails persistent volume
+msgstr Instellingen Tails persistent volume
+
+#: ../lib/Tails/Persistence/Setup.pm:442
+#, perl-format
+msgid Device %s already has a persistent volume.
+msgstr Apparaat %s heeft al een persistent volume.
+
+#: ../lib/Tails/Persistence/Setup.pm:450
+#, perl-format
+msgid Device %s has not enough unallocated space.
+msgstr Apparaat %s heeft niet genoeg ongealloceerde ruimte.
+
+#: ../lib/Tails/Persistence/Setup.pm:458 ../lib/Tails/Persistence/Setup.pm:472
+#, perl-format
+msgid Device %s has no persistent volume.
+msgstr Apparaat %s heeft geen persistent volume.
+
+#: ../lib/Tails/Persistence/Setup.pm:464
+msgid 
+Cannot delete the persistent volume while in use. You should restart Tails 
+without persistence.
+msgstr Kan geen persistent volume verwijderen wanneer dat in gebruik is. 

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

2012-10-10 Thread translation
commit 871b0b9eeb12095c102ecde8a6d311aba5e9095b
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 16:15:29 2012 +

Update translations for torcheck
---
 lv/torcheck.po |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lv/torcheck.po b/lv/torcheck.po
index 80eaced..b72585c 100644
--- a/lv/torcheck.po
+++ b/lv/torcheck.po
@@ -8,7 +8,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2012-02-16 20:28+PDT\n
-PO-Revision-Date: 2012-09-30 19:42+\n
+PO-Revision-Date: 2012-10-10 16:12+\n
 Last-Translator: Ojars Balcers ojars.balc...@gmail.com\n
 Language-Team: Tor Translation tor-translat...@torproject.org\n
 MIME-Version: 1.0\n
@@ -19,21 +19,21 @@ msgstr 
 Plural-Forms: nplurals=3; plural=(n%10==1  n%100!=11 ? 0 : n != 0 ? 1 : 
2);\n
 
 msgid Congratulations. Your browser is configured to use Tor.
-msgstr 
+msgstr Apsveicam. Jūsu pārlūks ir nokonfigurēts lai izmantotu Tor.
 
 msgid 
 Please refer to the a href=\https://www.torproject.org/\;Tor website/a 
 for further information about using Tor safely.  You are now free to browse 
 the Internet anonymously.
-msgstr 
+msgstr Lūdzu apmeklējiet a href=\https://www.torproject.org/\;Tor 
mājaslapu/a , lai uzzinātu papildu informāciju par drošu Tor 
izmantošanu.  Jūs tagad varat anonīmi pārlūkot internetu.
 
 msgid There is a security update available for the Tor Browser Bundle.
-msgstr 
+msgstr Pārlūka Tor komplektam ir pieejams drošības jauninājums.
 
 msgid 
 a href=\https://www.torproject.org/download/download-easy.html\;Click 
 here to go to the download page/a
-msgstr 
+msgstr a 
href=\https://www.torproject.org/download/download-easy.html\;Noklikšķiniet 
te, lai pārietu uz lejupielādes lapu/a
 
 msgid Sorry. You are not using Tor.
 msgstr Atvainojiet! JÅ«s nelietojat Tor.
@@ -43,15 +43,15 @@ msgid 
 href=\https://www.torproject.org/\;Tor website/a and specifically the a
  href=\https://www.torproject.org/docs/faq#DoesntWork\;instructions for 
 configuring your Tor client/a.
-msgstr 
+msgstr Ja mēģinat izmantot Tor klientu, lūdzu apmeklējiet a 
href=\https://www.torproject.org/\;Tor mājaslapu/a un konkrēti a 
href=\https://www.torproject.org/docs/faq#DoesntWork\;instrukcijas Tor 
klienta konfigurēšanai/a.
 
 msgid Sorry, your query failed or an unexpected response was received.
-msgstr 
+msgstr Atvainojiet, vaicājums nesekmīgs vai saņemta negaidīta atbilde.
 
 msgid 
 A temporary service outage prevents us from determining if your source IP 
 address is a a href=\https://www.torproject.org/\;Tor/a node.
-msgstr 
+msgstr Pakalpojuma pagaidu nepieejamība mums liedz noteikt vai Jūsu 
izejošā IP adrese ir a href=\https://www.torproject.org/\;Tor/a mezgls.
 
 msgid Your IP address appears to be: 
-msgstr 
+msgstr Jūsu redzamā IP adrese ir:

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


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

2012-10-10 Thread translation
commit 9e31c7ee26f5a90f293eab3f4e04d76ab5c8068f
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 16:15:30 2012 +

Update translations for torcheck_completed
---
 lv/torcheck.po |   57 
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/lv/torcheck.po b/lv/torcheck.po
new file mode 100644
index 000..b72585c
--- /dev/null
+++ b/lv/torcheck.po
@@ -0,0 +1,57 @@
+# TorCheck gettext template
+# Copyright (C) 2008-2012 The Tor Project, Inc
+# 
+# Translators:
+# Ojars Balcers ojars.balc...@gmail.com, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2012-02-16 20:28+PDT\n
+PO-Revision-Date: 2012-10-10 16:12+\n
+Last-Translator: Ojars Balcers ojars.balc...@gmail.com\n
+Language-Team: Tor Translation tor-translat...@torproject.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Generated-By: pygettext.py 1.5\n
+Language: lv\n
+Plural-Forms: nplurals=3; plural=(n%10==1  n%100!=11 ? 0 : n != 0 ? 1 : 
2);\n
+
+msgid Congratulations. Your browser is configured to use Tor.
+msgstr Apsveicam. Jūsu pārlūks ir nokonfigurēts lai izmantotu Tor.
+
+msgid 
+Please refer to the a href=\https://www.torproject.org/\;Tor website/a 
+for further information about using Tor safely.  You are now free to browse 
+the Internet anonymously.
+msgstr Lūdzu apmeklējiet a href=\https://www.torproject.org/\;Tor 
mājaslapu/a , lai uzzinātu papildu informāciju par drošu Tor 
izmantošanu.  Jūs tagad varat anonīmi pārlūkot internetu.
+
+msgid There is a security update available for the Tor Browser Bundle.
+msgstr Pārlūka Tor komplektam ir pieejams drošības jauninājums.
+
+msgid 
+a href=\https://www.torproject.org/download/download-easy.html\;Click 
+here to go to the download page/a
+msgstr a 
href=\https://www.torproject.org/download/download-easy.html\;Noklikšķiniet 
te, lai pārietu uz lejupielādes lapu/a
+
+msgid Sorry. You are not using Tor.
+msgstr Atvainojiet! JÅ«s nelietojat Tor.
+
+msgid 
+If you are attempting to use a Tor client, please refer to the a 
+href=\https://www.torproject.org/\;Tor website/a and specifically the a
+ href=\https://www.torproject.org/docs/faq#DoesntWork\;instructions for 
+configuring your Tor client/a.
+msgstr Ja mēģinat izmantot Tor klientu, lūdzu apmeklējiet a 
href=\https://www.torproject.org/\;Tor mājaslapu/a un konkrēti a 
href=\https://www.torproject.org/docs/faq#DoesntWork\;instrukcijas Tor 
klienta konfigurēšanai/a.
+
+msgid Sorry, your query failed or an unexpected response was received.
+msgstr Atvainojiet, vaicājums nesekmīgs vai saņemta negaidīta atbilde.
+
+msgid 
+A temporary service outage prevents us from determining if your source IP 
+address is a a href=\https://www.torproject.org/\;Tor/a node.
+msgstr Pakalpojuma pagaidu nepieejamība mums liedz noteikt vai Jūsu 
izejošā IP adrese ir a href=\https://www.torproject.org/\;Tor/a mezgls.
+
+msgid Your IP address appears to be: 
+msgstr Jūsu redzamā IP adrese ir:

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


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

2012-10-10 Thread translation
commit a7f9ee6917cc113552f8b8ec60e391f44c7717d6
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 16:45:25 2012 +

Update translations for vidalia_installer
---
 lv/vidalia_lv.po |   84 +++---
 1 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/lv/vidalia_lv.po b/lv/vidalia_lv.po
index fbd01ce..6a2ed96 100755
--- a/lv/vidalia_lv.po
+++ b/lv/vidalia_lv.po
@@ -6,7 +6,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2008-07-12 05:29+\n
-PO-Revision-Date: 2012-09-30 19:26+\n
+PO-Revision-Date: 2012-10-10 16:44+\n
 Last-Translator: Ojars Balcers ojars.balc...@gmail.com\n
 Language-Team: translati...@vidalia-project.net\n
 MIME-Version: 1.0\n
@@ -17,7 +17,7 @@ msgstr 
 
 msgctxt BundleSetupCaption
 msgid ${BUNDLE_NAME} setup
-msgstr 
+msgstr ${BUNDLE_NAME} iestatīšana
 
 msgctxt BundleWelcomeText
 msgid 
@@ -36,7 +36,7 @@ msgstr 
 
 msgctxt BundleWelcomeTitle
 msgid Welcome to the ${BUNDLE_NAME} Setup Wizard
-msgstr 
+msgstr Sveicināti ${BUNDLE_NAME} Iestatīšanas vednī
 
 msgctxt BundleLinkText
 msgid ${TOR_NAME} installation documentation
@@ -48,23 +48,23 @@ msgid 
 Please see https://www.torproject.org/docs/tor-doc-windows to learn how to 
configure your applications to use Tor.\n
 \n
 If you installed Torbutton, you will need to restart Firefox.
-msgstr 
+msgstr Instalēšana ir pabeigta.\nLūdzu apmeklējiet 
https://www.torproject.org/docs/tor-doc-windows , lai uzzinātu kā konfigurēt 
lietotnes un izmantotu Tor.\n\nJa instalējāt Torbutton, vajadzēs 
pārstartēt Firefox'u.
 
 msgctxt BundleRunNow
 msgid Run installed components now
-msgstr 
+msgstr Tūliņ izpildīt instalētos komponentus
 
 msgctxt VidaliaGroupDesc
 msgid Vidalia is a GUI that helps you control, monitor, and configure Tor.
-msgstr 
+msgstr Vidalia ir GLS jeb grafiskā lietotāja saskarne, kura palīdz vadīt, 
uzraudzīt un konfigurēt Tor'u.
 
 msgctxt VidaliaUninstDesc
 msgid Remove ${VIDALIA_DESC}.
-msgstr 
+msgstr Noņemt ${VIDALIA_DESC}.
 
 msgctxt VidaliaSetupCaption
 msgid ${VIDALIA_NAME} setup
-msgstr 
+msgstr ${VIDALIA_NAME} iestatīšana
 
 msgctxt VidaliaWelcomeText
 msgid 
@@ -75,35 +75,35 @@ msgstr 
 
 msgctxt VidaliaWelcomeTitle
 msgid Welcome to the ${VIDALIA_NAME} Setup Wizard
-msgstr 
+msgstr Sveicināti ${VIDALIA_NAME} Iestatīšanas vednī
 
 msgctxt VidaliaLinkText
 msgid ${VIDALIA_NAME} homepage
-msgstr 
+msgstr ${VIDALIA_NAME} mājaslapa
 
 msgctxt VidaliaAppDesc
 msgid Vidalia is a GUI that helps you control, monitor, and configure Tor.
-msgstr 
+msgstr Vidalia ir GLS jeb grafiskā lietotāja saskarne, kura palīdz vadīt, 
uzraudzīt un konfigurēt Tor'u.
 
 msgctxt VidaliaStartup
 msgid Run At Startup
-msgstr 
+msgstr Izpildīt startēšanas laikā
 
 msgctxt VidaliaStartupDesc
 msgid Automatically run ${VIDALIA_NAME} at startup.
-msgstr 
+msgstr Automātiski izpildīt ${VIDALIA_NAME} startēšanas laikā.
 
 msgctxt VidaliaShortcuts
 msgid Add to Start Menu
-msgstr 
+msgstr Pievienot izvēlnei Sākt
 
 msgctxt VidaliaShortcutsDesc
 msgid Add ${VIDALIA_NAME} to your Start menu.
-msgstr 
+msgstr Pievienot ${VIDALIA_NAME} izvēlnei Sākt.
 
 msgctxt VidaliaRunNow
 msgid Run ${VIDALIA_NAME}
-msgstr 
+msgstr Izpildīt ${VIDALIA_NAME}
 
 msgctxt TorGroupDesc
 msgid 
@@ -113,111 +113,111 @@ msgstr 
 
 msgctxt TorUninstDesc
 msgid Remove ${TOR_DESC}.
-msgstr 
+msgstr Noņemt ${TOR_DESC}.
 
 msgctxt TorAppDesc
 msgid Install ${TOR_DESC}.
-msgstr 
+msgstr Instalēt ${TOR_DESC}.
 
 msgctxt TorAskOverwriteTorrc
 msgid 
 You already have a Tor configuration file.$\n
 $\n
 Do you want to overwrite it with the default sample configuration file?
-msgstr 
+msgstr Atrasta Tor'a konfigurācijas datne.$\n$\nVai vēlaties to 
pārrakstīt ar konfigurācijas noklusējuma paraugdatni?
 
 msgctxt TorDocumentation
 msgid Documentation
-msgstr 
+msgstr Dokumentācija
 
 msgctxt TorDocumentationDesc
 msgid Install ${TOR_NAME} documentation.
-msgstr 
+msgstr Instalēt ${TOR_NAME} dokumentāciju.
 
 msgctxt TorShortcuts
 msgid Add to Start Menu
-msgstr 
+msgstr Pievienot izvēlnei Sākt
 
 msgctxt TorShortcutsDesc
 msgid Add ${TOR_NAME} to your Start menu.
-msgstr 
+msgstr Pievienot ${TOR_NAME} izvēlnei Sākt.
 
 msgctxt PolipoGroupDesc
 msgid 
 Polipo is a caching web proxy that increases performance of web browsing 
 through Tor.
-msgstr 
+msgstr Polipo ir kešdarbes tīmekļa starpnieks, kurš uzlabo tīmekļa 
pārlūkošanas sniegumu, kad izmanto Tor.
 
 msgctxt PolipoUninstDesc
 msgid Remove ${POLIPO_DESC}.
-msgstr 
+msgstr Noņemt ${POLIPO_DESC}.
 
 msgctxt PolipoAppDesc
 msgid Install ${POLIPO_DESC}.
-msgstr 
+msgstr Instalēt ${POLIPO_DESC}.
 
 msgctxt PolipoShortcuts
 msgid Add to Start Menu
-msgstr 
+msgstr Pievienot izvēlnei Sākt
 
 msgctxt PolipoShortcutsDesc
 msgid Add ${POLIPO_NAME} to your Start menu.
-msgstr 

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

2012-10-10 Thread translation
commit b8309894a1afd9491ea64997476e9595c8df5b12
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 17:15:08 2012 +

Update translations for orbot
---
 values-lv/strings.xml |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/values-lv/strings.xml b/values-lv/strings.xml
index ae10920..3483816 100644
--- a/values-lv/strings.xml
+++ b/values-lv/strings.xml
@@ -25,6 +25,8 @@
   string name=menu_stopApturēt/string
   string name=menu_aboutPar/string
   string name=menu_wizardVednis/string
+  string name=main_layout_downloadLejupielāde (ātrums/kopā)/string
+  string name=main_layout_uploadAugšupielāde (ātrums/kopā)/string
   string name=button_helpPalīdzība/string
   string name=button_closeAizvērt/string
   string name=button_aboutPar/string
@@ -130,12 +132,16 @@
   string name=setting_up_port_based_transparent_proxying_Iestata portu 
nodrošinātu pārredzamu starpniekošanu.../string
   string name=bridge_errorTilta kļūda/string
   string name=errorKļūda/string
+  string name=your_relay_settings_caused_an_exception_JÅ«su retranslatora 
iestatījumi izraisīja izņēmuma situāciju!/string
   string name=exit_nodesIzejas mezgli/string
   string name=enter_exit_nodesIevadiet izejas mezglus/string
   string name=exclude_nodesNeiekļautie mezgli/string
+  string name=enter_exclude_nodesIevadīt Neiekļaujamos mezglus/string
+  string name=strict_nodesPrecīzie mezgli/string
   string name=bridgesTilti/string
   string name=use_bridgesLietot tiltus/string
   string name=bridges_obfuscatedAizmiglotie tilti/string
+  string name=ip_address_and_port_of_bridgesTiltu ports un IP 
addrese/string
   string name=enter_bridge_addressesIevadiet tiltu adreses/string
   string name=relaysRetranslatori/string
   string name=relayingRetranslēšana/string

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


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

2012-10-10 Thread translation
commit adc312abaadf0b367185d3451c3ee9016a0cc0cb
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 17:15:28 2012 +

Update translations for vidalia_installer
---
 lv/vidalia_lv.po |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lv/vidalia_lv.po b/lv/vidalia_lv.po
index 6a2ed96..96c12aa 100755
--- a/lv/vidalia_lv.po
+++ b/lv/vidalia_lv.po
@@ -6,7 +6,7 @@ msgstr 
 Project-Id-Version: The Tor Project\n
 Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
 POT-Creation-Date: 2008-07-12 05:29+\n
-PO-Revision-Date: 2012-10-10 16:44+\n
+PO-Revision-Date: 2012-10-10 17:08+\n
 Last-Translator: Ojars Balcers ojars.balc...@gmail.com\n
 Language-Team: translati...@vidalia-project.net\n
 MIME-Version: 1.0\n
@@ -32,7 +32,7 @@ msgid 
 If you have previously installed Tor, Vidalia, Polipo, or Firefox, please 
make sure they are not running before continuing this installation.\n
 \n
 $_CLICK
-msgstr 
+msgstr Vednis palīdzēs instalēt Tor, Vidalia, Polipo, un Torbutton.\n\nTor 
ir sistēma anonīmai interneta izmantošanai. Tā ļauj anonīmi pārlūkot 
tīmekli un publicēt tanī, kā arī anonīmi veikt tūlītējo ziņapmaiņu, 
lietot IRC jeb terzēšanas retranslēšanu internetā, un piedāvā citas 
iespējas. Vidalia ir GLS jeb grafiskā lietotāja saskarne, kas palīdz 
vadīt, uzraudzīt un konfigurēt Tor'u.\n\nPolipo ir kešdarbes tīmekļa 
starpnieks, kurš uzlabo tīmekļa pārlūkošanas sniegumu, kad izmanto 
Tor.\n\nTorbutton ir Firefox'a paplašinājums, kurš sniedz iespēju ātri 
iespējot un atspējot anonīmu tīmekļa pārlūkošanu.\n\nJa agrāk jau esat 
instalējis Tor, Vidalia, Polipo, vai Firefox, lūdzu, pirms turpiniet šo 
instalēšanu, pārliecinaties, ka lietotnes nedarbojas.\n\n$_CLICK
 
 msgctxt BundleWelcomeTitle
 msgid Welcome to the ${BUNDLE_NAME} Setup Wizard
@@ -71,7 +71,7 @@ msgid 
 This wizard will guide you through the installation of Vidalia, a GUI that 
helps you control, monitor, and configure Tor.\n
 \n
 $_CLICK
-msgstr 
+msgstr Vednis palīdzēs instalēt Vidalia, kura ir GLS jeb grafiskā 
lietotāja saskarne, kas palīdz vadīt, uzraudzīt un konfigurēt 
Tor'u.\n\n$_CLICK
 
 msgctxt VidaliaWelcomeTitle
 msgid Welcome to the ${VIDALIA_NAME} Setup Wizard
@@ -109,7 +109,7 @@ msgctxt TorGroupDesc
 msgid 
 Tor is a system for using the Internet anonymously, helping you anonymize 
 Web browsing and publishing, instant messaging, IRC, and more.
-msgstr 
+msgstr Tor ir sistēma anonīmai interneta izmantošanai. Tā ļauj anonīmi 
pārlūkot tīmekli un publicēt tanī, kā arī anonīmi veikt tūlītējo 
ziņapmaiņu, lietot IRC jeb terzēšanas retranslēšanu internetā, un 
piedāvā arī citas iespējas.
 
 msgctxt TorUninstDesc
 msgid Remove ${TOR_DESC}.
@@ -228,7 +228,7 @@ msgid 
 \n
 If you would like to install Firefox, please press Cancel, then go\n
 to the Firefox download page at
-msgstr 
+msgstr Tīmekļa pārlūks Mozilla Firefox nav instalēts uz šī 
datora.\nTor strādā arī ar citiem pārlūkiem, tādiem kā Internet 
Explorer, tomēr to vieglāk lietot ar Firefox'u, kurš sekmīgāk sargā Jūsu 
anonimitāti.\n\nJa vēlaties instalēt Firefox, lūdzu nospiediet Atcelt, tad 
dodieties uz Firefox lejupielādes lapu, kura pieejama tīmekļa vietnē 
 
 msgctxt FirefoxWarningPageLowerText
 msgid 
@@ -237,4 +237,4 @@ msgid 
 \n
 Or, if you would prefer to install Tor without Firefox, simply\n
 press Next to continue.
-msgstr Kad esat pabeidzis instalēt Firefox'u, variet vēlreiz izpildīt 
Tor'a instalēšanas programmu.\n\nVai arī gadījumā, ja vēlaties instalēt 
Tor bez Firefox'a, lai turpinātu spiediet Tālāk.
+msgstr Kad esat pabeidzis instalēt Firefox'u, variet vēlreiz izpildīt 
Tor'a instalēšanas programmu.\n\nVai arī gadījumā, ja vēlaties instalēt 
Tor bez Firefox'a, tad, lai turpinātu, spiediet Tālāk.

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


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

2012-10-10 Thread translation
commit 399a99e2d55a5d4b019bc27eb8fb35dbb14e9d60
Author: Translation commit bot translat...@torproject.org
Date:   Wed Oct 10 17:15:29 2012 +

Update translations for vidalia_installer_completed
---
 lv/vidalia_lv.po |  240 ++
 1 files changed, 240 insertions(+), 0 deletions(-)

diff --git a/lv/vidalia_lv.po b/lv/vidalia_lv.po
new file mode 100644
index 000..96c12aa
--- /dev/null
+++ b/lv/vidalia_lv.po
@@ -0,0 +1,240 @@
+# 
+# Translators:
+# Ojars Balcers ojars.balc...@gmail.com, 2012.
+msgid 
+msgstr 
+Project-Id-Version: The Tor Project\n
+Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n;
+POT-Creation-Date: 2008-07-12 05:29+\n
+PO-Revision-Date: 2012-10-10 17:08+\n
+Last-Translator: Ojars Balcers ojars.balc...@gmail.com\n
+Language-Team: translati...@vidalia-project.net\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+Language: lv\n
+Plural-Forms: nplurals=3; plural=(n%10==1  n%100!=11 ? 0 : n != 0 ? 1 : 
2);\n
+
+msgctxt BundleSetupCaption
+msgid ${BUNDLE_NAME} setup
+msgstr ${BUNDLE_NAME} iestatīšana
+
+msgctxt BundleWelcomeText
+msgid 
+This wizard will guide you through the installation of Tor, Vidalia, Polipo, 
and Torbutton.\n
+\n
+Tor is a system for using the Internet anonymously, helping you anonymize Web 
browsing and publishing, instant messaging, IRC, and more. Vidalia is a GUI 
that helps you control, monitor, and configure Tor.\n
+\n
+Polipo is a caching web proxy that helps increase performance of browsing the 
web through Tor.\n
+\n
+Torbutton is a Firefox extension that allows you to quickly enable or disable 
anonymous web browsing.\n
+\n
+If you have previously installed Tor, Vidalia, Polipo, or Firefox, please 
make sure they are not running before continuing this installation.\n
+\n
+$_CLICK
+msgstr Vednis palīdzēs instalēt Tor, Vidalia, Polipo, un Torbutton.\n\nTor 
ir sistēma anonīmai interneta izmantošanai. Tā ļauj anonīmi pārlūkot 
tīmekli un publicēt tanī, kā arī anonīmi veikt tūlītējo ziņapmaiņu, 
lietot IRC jeb terzēšanas retranslēšanu internetā, un piedāvā citas 
iespējas. Vidalia ir GLS jeb grafiskā lietotāja saskarne, kas palīdz 
vadīt, uzraudzīt un konfigurēt Tor'u.\n\nPolipo ir kešdarbes tīmekļa 
starpnieks, kurš uzlabo tīmekļa pārlūkošanas sniegumu, kad izmanto 
Tor.\n\nTorbutton ir Firefox'a paplašinājums, kurš sniedz iespēju ātri 
iespējot un atspējot anonīmu tīmekļa pārlūkošanu.\n\nJa agrāk jau esat 
instalējis Tor, Vidalia, Polipo, vai Firefox, lūdzu, pirms turpiniet šo 
instalēšanu, pārliecinaties, ka lietotnes nedarbojas.\n\n$_CLICK
+
+msgctxt BundleWelcomeTitle
+msgid Welcome to the ${BUNDLE_NAME} Setup Wizard
+msgstr Sveicināti ${BUNDLE_NAME} Iestatīšanas vednī
+
+msgctxt BundleLinkText
+msgid ${TOR_NAME} installation documentation
+msgstr ${TOR_NAME} instalācijas dokumentācija
+
+msgctxt BundleFinishText
+msgid 
+Installation is complete.\n
+Please see https://www.torproject.org/docs/tor-doc-windows to learn how to 
configure your applications to use Tor.\n
+\n
+If you installed Torbutton, you will need to restart Firefox.
+msgstr Instalēšana ir pabeigta.\nLūdzu apmeklējiet 
https://www.torproject.org/docs/tor-doc-windows , lai uzzinātu kā konfigurēt 
lietotnes un izmantotu Tor.\n\nJa instalējāt Torbutton, vajadzēs 
pārstartēt Firefox'u.
+
+msgctxt BundleRunNow
+msgid Run installed components now
+msgstr Tūliņ izpildīt instalētos komponentus
+
+msgctxt VidaliaGroupDesc
+msgid Vidalia is a GUI that helps you control, monitor, and configure Tor.
+msgstr Vidalia ir GLS jeb grafiskā lietotāja saskarne, kura palīdz vadīt, 
uzraudzīt un konfigurēt Tor'u.
+
+msgctxt VidaliaUninstDesc
+msgid Remove ${VIDALIA_DESC}.
+msgstr Noņemt ${VIDALIA_DESC}.
+
+msgctxt VidaliaSetupCaption
+msgid ${VIDALIA_NAME} setup
+msgstr ${VIDALIA_NAME} iestatīšana
+
+msgctxt VidaliaWelcomeText
+msgid 
+This wizard will guide you through the installation of Vidalia, a GUI that 
helps you control, monitor, and configure Tor.\n
+\n
+$_CLICK
+msgstr Vednis palīdzēs instalēt Vidalia, kura ir GLS jeb grafiskā 
lietotāja saskarne, kas palīdz vadīt, uzraudzīt un konfigurēt 
Tor'u.\n\n$_CLICK
+
+msgctxt VidaliaWelcomeTitle
+msgid Welcome to the ${VIDALIA_NAME} Setup Wizard
+msgstr Sveicināti ${VIDALIA_NAME} Iestatīšanas vednī
+
+msgctxt VidaliaLinkText
+msgid ${VIDALIA_NAME} homepage
+msgstr ${VIDALIA_NAME} mājaslapa
+
+msgctxt VidaliaAppDesc
+msgid Vidalia is a GUI that helps you control, monitor, and configure Tor.
+msgstr Vidalia ir GLS jeb grafiskā lietotāja saskarne, kura palīdz vadīt, 
uzraudzīt un konfigurēt Tor'u.
+
+msgctxt VidaliaStartup
+msgid Run At Startup
+msgstr Izpildīt startēšanas laikā
+
+msgctxt VidaliaStartupDesc
+msgid Automatically run ${VIDALIA_NAME} at startup.
+msgstr Automātiski izpildīt ${VIDALIA_NAME} 

[tor-commits] r25844: {website} Update torbutton to 1.4.6.3. --This line, and tsose below, w (in website/trunk: include torbutton)

2012-10-10 Thread Mike Perry
Author: mikeperry
Date: 2012-10-10 18:08:25 + (Wed, 10 Oct 2012)
New Revision: 25844

Modified:
   website/trunk/include/versions.wmi
   website/trunk/torbutton/update.rdf
Log:
Update torbutton to 1.4.6.3.

--This line, and tsose below, will be ignored--
cks ssh vescum /home/mirroradm/bin/trigger-mirrors


Minclude/versions.wmi
Mtorbutton/update.rdf


Modified: website/trunk/include/versions.wmi
===
--- website/trunk/include/versions.wmi  2012-10-09 22:44:12 UTC (rev 25843)
+++ website/trunk/include/versions.wmi  2012-10-10 18:08:25 UTC (rev 25844)
@@ -109,8 +109,8 @@
 define-tag file-source-alpha 
whitespace=deletetor-version-alpha.tar.gz/define-tag
 define-tag package-source-alpha 
whitespace=delete../dist/file-source-alpha/define-tag
 
-define-tag version-torbutton whitespace=delete1.4.6.2 (12 Sep 
2012)/define-tag
-define-tag version-hash-torbutton 
whitespace=deletesha1:1182fa2dcb095ad8054a218c41bc0a849b5b30ed/define-tag
+define-tag version-torbutton whitespace=delete1.4.6.3 (10 Oct 
2012)/define-tag
+define-tag version-hash-torbutton 
whitespace=deletesha1:968455a5b702b3cabb6c16499e531a5a8f4c5f21/define-tag
 
 define-tag version-torbutton-alpha whitespace=deleteNone/define-tag
 define-tag version-hash-torbutton-alpha 
whitespace=deletesha1:c7323cd408ebee28ee23b6a91fe056d59de668f5/define-tag

Modified: website/trunk/torbutton/update.rdf
===
(Binary files differ)

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


[tor-commits] [torflow/master] Update results file with new output.

2012-10-10 Thread mikeperry
commit 79f1671ab244858429484f2d0b3da64baf732e55
Author: Mike Perry mikeperry-...@fscked.org
Date:   Wed Oct 10 16:49:28 2012 -0700

Update results file with new output.
---
 CircuitAnalysis/PathBias/results.txt |  233 +++--
 1 files changed, 134 insertions(+), 99 deletions(-)

diff --git a/CircuitAnalysis/PathBias/results.txt 
b/CircuitAnalysis/PathBias/results.txt
index 4293851..d8e1c97 100644
--- a/CircuitAnalysis/PathBias/results.txt
+++ b/CircuitAnalysis/PathBias/results.txt
@@ -2,11 +2,11 @@
 
 PassiveEvilGuard compromise rate at [success_rate, adversary_capacity, 
path_bias_pct]:
 (As expected, P(CompromisedExit|PassiveEvilGuard) ~= c/n)
-New extrema at [1, 0.75, 0.05, 70]: 0.052610548748
-New extrema at [1, 0.75, 0.25, 70]: 0.250574712644
-New extrema at [1, 0.75, 0.45, 70]: 0.455518836748
-New extrema at [1, 0.75, 0.65, 70]: 0.64692513369
-New extrema at [1, 0.75, 0.8501, 70]: 0.851249664069
+New extrema at [1, 0.75, 0.05, 70]: 0.0489855846236
+New extrema at [1, 0.75, 0.25, 70]: 0.252824098978
+New extrema at [1, 0.75, 0.45, 70]: 0.453292291221
+New extrema at [1, 0.75, 0.65, 70]: 0.651239888609
+New extrema at [1, 0.75, 0.8501, 70]: 0.845948471499
 [1, 0.75, 0.8501, 70]
 
 UnrepentantEvilGuard compromise rate at [success_rate, adversary_capacity, 
path_bias_pct]:
@@ -16,28 +16,28 @@ New extrema at [1, 0.75, 0.05, 70]: 1.0
 
 ProbabalisticEvilGuard compromise rate at [success_rate, adversary_capacity, 
path_bias_pct]:
 P(CompromisedExit|ProbabalisticEvilGuard) = (c/n)*(100/PATH_BIAS_PCT)
-New extrema at [1, 0.75, 0.05, 70]: 0.0615289955391
-New extrema at [1, 0.75, 0.25, 70]: 0.381941239809
-New extrema at [1, 0.75, 0.45, 70]: 0.686913732124
-New extrema at [1, 0.75, 0.65, 70]: 0.993549377976
+New extrema at [1, 0.75, 0.05, 70]: 0.0641538461538
+New extrema at [1, 0.75, 0.25, 70]: 0.386709736964
+New extrema at [1, 0.75, 0.45, 70]: 0.695431472081
+New extrema at [1, 0.75, 0.65, 70]: 0.994813119756
 New extrema at [1, 0.75, 0.8501, 70]: 1.0
 [1, 0.75, 0.8501, 70]
 
 OmniscientEvilGuard compromise rate at [success_rate, adversary_capacity, 
path_bias_pct]:
 P(CompromisedExit|OmniscientEvilGuard) = (c/n)*(100/PATH_BIAS_PCT)
-New extrema at [1, 0.75, 0.05, 70]: 0.0680291553523
-New extrema at [1, 0.75, 0.25, 70]: 0.356724310419
-New extrema at [1, 0.75, 0.45, 70]: 0.646151649293
-New extrema at [1, 0.75, 0.65, 70]: 0.917728688757
-New extrema at [1, 0.75, 0.8501, 70]: 1.0
+New extrema at [1, 0.75, 0.05, 70]: 0.0713570713571
+New extrema at [1, 0.75, 0.25, 70]: 0.368157781907
+New extrema at [1, 0.75, 0.45, 70]: 0.640582607454
+New extrema at [1, 0.75, 0.65, 70]: 0.913658881812
+New extrema at [1, 0.75, 0.8501, 70]: 0.999881544658
 [1, 0.75, 0.8501, 70]
 
 OmniscientEvilGuard compromise at [success_rate, adversary_capacity, 
path_bias_pct]:
 P(CompromisedExit|OmniscientEvilGuard) = (c/n)*(100/PATH_BIAS_PCT)
-New extrema at [1, 0.75, 0.2, 20]: 0.927127409497
-New extrema at [1, 0.75, 0.2, 40]: 0.497260956175
-New extrema at [1, 0.75, 0.2, 60]: 0.328728362184
-New extrema at [1, 0.75, 0.2, 80]: 0.257664872982
+New extrema at [1, 0.75, 0.2, 20]: 0.923076923077
+New extrema at [1, 0.75, 0.2, 40]: 0.514037267081
+New extrema at [1, 0.75, 0.2, 60]: 0.339663501583
+New extrema at [1, 0.75, 0.2, 80]: 0.246594175728
 [1, 0.75, 0.2, 80]
 
 
@@ -46,107 +46,142 @@ New extrema at [1, 0.75, 0.2, 80]: 0.257664872982
 UnrepentantEvilGuard compromised circs at [success_rate, adversary_capacity, 
path_bias_pct]:
 circs_per_client ~= success_rate*c/n*MIN_CIRCS  for c/n  PATH_BIAS_PCT || 
c/n  success_rate
  ~= success_rate*circ_attempts*c/n  for c/n  PATH_BIAS_PCT  
c/n  success_rate
-New extrema at [10, 0.75, 0.05, 50]: 0.742451509698
-New extrema at [10, 0.75, 0.25, 50]: 3.73414682937
-New extrema at [10, 0.75, 0.45, 50]: 6.91443298969
-New extrema at [10, 0.75, 0.65, 50]: 30.9604339502
-New extrema at [10, 0.75, 0.8501, 50]: 63741.0
+New extrema at [10, 0.75, 0.05, 50]: 0.761847630474
+New extrema at [10, 0.75, 0.25, 50]: 3.7874
+New extrema at [10, 0.75, 0.45, 50]: 6.9507552245
+New extrema at [10, 0.75, 0.65, 50]: 32.9502688172
+New extrema at [10, 0.75, 0.8501, 50]: 63872.0
 [10, 0.75, 0.8501, 50]
 
 PassiveEvilGuard compromised circs at [success_rate, adversary_capacity, 
path_bias_pct]:
 circs_per_client ~= success_rate * circ_attempts * c/n
-New extrema at [10, 0.75, 0.05, 50]: 3657.0
-New extrema at [10, 0.75, 0.25, 50]: 18619.0
-New extrema at [10, 0.75, 0.45, 50]: 33849.0
-New extrema at [10, 0.75, 0.65, 50]: 49115.0
-New extrema at [10, 0.75, 0.8501, 50]: 63625.0
+New extrema at 

[tor-commits] [torflow/master] Add a Guard DoS simulation.

2012-10-10 Thread mikeperry
commit 77ee2aa8d0bff2a85268a233b18448bb2b0c9317
Author: Mike Perry mikeperry-...@fscked.org
Date:   Wed Oct 10 16:22:11 2012 -0700

Add a Guard DoS simulation.
---
 CircuitAnalysis/PathBias/path_bias.py |   39 -
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/CircuitAnalysis/PathBias/path_bias.py 
b/CircuitAnalysis/PathBias/path_bias.py
index 2487bc9..54e8581 100755
--- a/CircuitAnalysis/PathBias/path_bias.py
+++ b/CircuitAnalysis/PathBias/path_bias.py
@@ -341,6 +341,24 @@ def generic_rate_test(g, trials, success_rate, 
adversary_capacity, path_bias_pct
 
   return rate_fcn(g)
 
+def dos_attack_test(success_rate, dos_success_rate, path_bias_pct, 
scale_thresh):
+  global PATH_BIAS_PCT
+  global PATH_BIAS_SCALE_THRESHOLD
+  PATH_BIAS_PCT = path_bias_pct
+  PATH_BIAS_SCALE_THRESHOLD = scale_thresh
+
+  g = Guard(success_rate)
+
+  simulate_circs_until(g, PATH_BIAS_SCALE_THRESHOLD, lambda g: False)
+  g.rejected_count = 0
+
+  g.succeed_rate = dos_success_rate
+
+  simulate_circs_until(g, 1, lambda g: g.rejected_count  0)
+
+  return g.first_hops_total - PATH_BIAS_SCALE_THRESHOLD
+
+
  Multi-Dementianal Analysis #
 
 # If brute force doesn't work, you're not using enough
@@ -497,7 +515,7 @@ def main():
 
 
   if True:
-print \n\n= FALSE POSITIVES 

+print \n\n= False Positives 

 
 print \nStartup false positive counts at [trials, success_rate, 
min_circs, path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
min_circs)
@@ -564,6 +582,25 @@ def main():
  [(100,100), (0.45, 0.45), (100,500), (30, 30)],
  [0, -0.1, 50, 5])
 
+  if True:
+print \n\n= DoS Attack Duration 

+print \nDoS attack durations (in circs) at [success_rate, 
dos_success_rate, path_bias_pct, scale_thresh]:
+print brute_force(lambda x,y: xy,
+ dos_attack_test,
+ #dos_attack_test(g, trials, success_rate, 
dos_success_rate, path_bias_pct):
+ #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ [(0.80, 0.80), (0.05,0.05), (30, 30), (200, 1000)],
+ [-0.1, -0.1, 5, 100])
+
+print \nDoS attack durations (in circs) at [success_rate, 
dos_success_rate, path_bias_pct, scale_thresh]:
+print brute_force(lambda x,y: xy,
+ dos_attack_test,
+ #dos_attack_test(g, trials, success_rate, 
dos_success_rate, path_bias_pct):
+ #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ [(0.80, 0.80), (0.25,0.05), (30, 30), (500, 500)],
+ [-0.1, -0.1, 5, 100])
+
+
 
 if __name__ == __main__:
   main() #sys.argv)



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


[tor-commits] [torflow/master] Represent false positives as raw counts.

2012-10-10 Thread mikeperry
commit 71fb889aaf099fa99c53f3dcb87dff09aec77814
Author: Mike Perry mikeperry-...@fscked.org
Date:   Wed Oct 10 14:55:11 2012 -0700

Represent false positives as raw counts.

Also, clarify the startup false positive test.
---
 CircuitAnalysis/PathBias/path_bias.py |   67 -
 1 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/CircuitAnalysis/PathBias/path_bias.py 
b/CircuitAnalysis/PathBias/path_bias.py
index 621e2c1..2487bc9 100755
--- a/CircuitAnalysis/PathBias/path_bias.py
+++ b/CircuitAnalysis/PathBias/path_bias.py
@@ -15,7 +15,7 @@ PATH_BIAS_MIN_CIRCS = 20
 # XXX: An int divisor was wrong here. Fix that in Tor. We might
 # even want a weighted moving average, but that will be trickier
 # to analyze.
-PATH_BIAS_SCALE_FACTOR = 95
+PATH_BIAS_SCALE_FACTOR = 50
 PATH_BIAS_SCALE_THRESHOLD = 250
 
 # XXX: We should only emit warnings if we are above the scaling threshhold..
@@ -33,7 +33,7 @@ def reset_globals():
 
   PATH_BIAS_PCT = 70
   PATH_BIAS_MIN_CIRCS = 20
-  PATH_BIAS_SCALE_FACTOR = 95
+  PATH_BIAS_SCALE_FACTOR = 50
   PATH_BIAS_SCALE_THRESHOLD = 250
   PATH_BIAS_WARN_CIRCS = 
PATH_BIAS_SCALE_THRESHOLD*(PATH_BIAS_SCALE_FACTOR/100.0)
 
@@ -294,7 +294,7 @@ def simulate_circs_until(g, circ_count, say_when):
 # success_rate
 # PATH_BIAS_MIN_CIRCS = 20
 # PATH_BIAS_PCT = 70
-def notice_false_positive_test(trials, success_rate, min_circs, path_bias_pct):
+def startup_false_positive_test(trials, success_rate, min_circs, 
path_bias_pct):
   # FIXME: Look it's just easier this way, ok? Get off my back already
   global PATH_BIAS_MIN_CIRCS
   global PATH_BIAS_PCT
@@ -309,7 +309,7 @@ def notice_false_positive_test(trials, success_rate, 
min_circs, path_bias_pct):
 
   #print g._get_rate()
 
-  return g.reject_rate()
+  return g.rejected_count
 
 def reject_false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
   # FIXME: Look it's just easier this way, ok? Get off my back already
@@ -327,9 +327,7 @@ def reject_false_positive_test(trials, success_rate, 
scale_circs, path_bias_pct)
 
   simulate_circs_until(g, trials, lambda g: False)
 
-  #print g._get_rate()
-
-  return g.reject_rate()
+  return g.rejected_count
 
 def generic_rate_test(g, trials, success_rate, adversary_capacity, 
path_bias_pct, rate_fcn):
   # FIXME: Look it's just easier this way, ok? Get off my back already
@@ -501,52 +499,69 @@ def main():
   if True:
 print \n\n= FALSE POSITIVES 

 
-print \nNotice false positive rates at [trials, success_rate, min_circs, 
path_bias_pct]:
+print \nStartup false positive counts at [trials, success_rate, 
min_circs, path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
min_circs)
 print brute_force(lambda x,y: xy,
- notice_false_positive_test,
+ startup_false_positive_test,
  #false_positive_test(trials, success_rate, min_circs, 
path_bias_pct):
- [(10,10), (0.65, 0.65), (50,250), (70, 70)],
- [0, -0.1, 50, 5])
+ [(10,10), (0.80, 0.80), (20,200), (70, 70)],
+ [0, -0.1, 20, 5])
 
-print \nNotice false positive rates at [trials, success_rate, min_circs, 
path_bias_pct]:
+print \nStartup false positive counts at [trials, success_rate, 
min_circs, path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
min_circs)
 print brute_force(lambda x,y: xy,
- notice_false_positive_test,
+ startup_false_positive_test,
  #false_positive_test(trials, success_rate, min_circs, 
path_bias_pct):
- [(10,10), (0.70, 0.70), (50,500), (70, 70)],
+ [(10,10), (0.45, 0.45), (20,200), (30, 30)],
+ [0, -0.1, 20, 5])
+
+
+print \nFalse positive counts at [trials, success_rate, scale_circs, 
path_bias_pct]:
+print (Results are some function of success_rate - path_bias_pct vs 
scale_circs)
+print brute_force(lambda x,y: xy,
+ reject_false_positive_test,
+ #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ [(100,100), (0.70, 0.70), (100,500), (70, 70)],
  [0, -0.1, 50, 5])
 
-print \nNotice false positives at [trials, success_rate, min_circs, 
path_bias_pct]:
-print (Results are some function of success_rate - path_bias_pct vs 
min_circs)
+print \nFalse positive counts at [trials, success_rate, scale_circs, 
path_bias_pct]:
+print (Results are some function of success_rate - path_bias_pct vs 
scale_circs)
 print brute_force(lambda x,y: xy,
- notice_false_positive_test,
- #false_positive_test(trials, success_rate, min_circs, 
path_bias_pct):
- 

[tor-commits] [torflow/master] Clarify that trials are circuit counts in output.

2012-10-10 Thread mikeperry
commit 04ed8e5dc3b357f6d7c012b6192f7c841b04aaed
Author: Mike Perry mikeperry-...@fscked.org
Date:   Wed Oct 10 18:56:22 2012 -0700

Clarify that trials are circuit counts in output.
---
 CircuitAnalysis/PathBias/path_bias.py |   48 ++--
 CircuitAnalysis/PathBias/results.txt  |  145 +
 2 files changed, 97 insertions(+), 96 deletions(-)

diff --git a/CircuitAnalysis/PathBias/path_bias.py 
b/CircuitAnalysis/PathBias/path_bias.py
index 54e8581..f3fc1bd 100755
--- a/CircuitAnalysis/PathBias/path_bias.py
+++ b/CircuitAnalysis/PathBias/path_bias.py
@@ -517,68 +517,68 @@ def main():
   if True:
 print \n\n= False Positives 

 
-print \nStartup false positive counts at [trials, success_rate, 
min_circs, path_bias_pct]:
+print \nStartup false positive counts at [num_circs, success_rate, 
min_circs, path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
min_circs)
 print brute_force(lambda x,y: xy,
  startup_false_positive_test,
- #false_positive_test(trials, success_rate, min_circs, 
path_bias_pct):
- [(10,10), (0.80, 0.80), (20,200), (70, 70)],
- [0, -0.1, 20, 5])
+ #false_positive_test(num_circs, success_rate, min_circs, 
path_bias_pct):
+ [(100,100), (0.80, 0.80), (25,250), (70, 70)],
+ [0, -0.1, 25, 5])
 
-print \nStartup false positive counts at [trials, success_rate, 
min_circs, path_bias_pct]:
+print \nStartup false positive counts at [num_circs, success_rate, 
min_circs, path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
min_circs)
 print brute_force(lambda x,y: xy,
  startup_false_positive_test,
- #false_positive_test(trials, success_rate, min_circs, 
path_bias_pct):
- [(10,10), (0.45, 0.45), (20,200), (30, 30)],
- [0, -0.1, 20, 5])
+ #false_positive_test(num_circs, success_rate, min_circs, 
path_bias_pct):
+ [(100,100), (0.45, 0.45), (25,250), (30, 30)],
+ [0, -0.1, 25, 5])
 
 
-print \nFalse positive counts at [trials, success_rate, scale_circs, 
path_bias_pct]:
+print \nFalse positive counts at [num_circs, success_rate, scale_circs, 
path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
scale_circs)
 print brute_force(lambda x,y: xy,
  reject_false_positive_test,
- #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ #false_positive_test(num_circs, success_rate, 
scale_circs, path_bias_pct):
  [(100,100), (0.70, 0.70), (100,500), (70, 70)],
  [0, -0.1, 50, 5])
 
-print \nFalse positive counts at [trials, success_rate, scale_circs, 
path_bias_pct]:
+print \nFalse positive counts at [num_circs, success_rate, scale_circs, 
path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
scale_circs)
 print brute_force(lambda x,y: xy,
  reject_false_positive_test,
- #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ #false_positive_test(num_circs, success_rate, 
scale_circs, path_bias_pct):
  [(100,100), (0.75, 0.75), (100,500), (70, 70)],
  [0, -0.1, 50, 5])
 
-print \nFalse positive counts at [trials, success_rate, scale_circs, 
path_bias_pct]:
+print \nFalse positive counts at [num_circs, success_rate, scale_circs, 
path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
scale_circs)
 print brute_force(lambda x,y: xy,
  reject_false_positive_test,
- #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ #false_positive_test(num_circs, success_rate, 
scale_circs, path_bias_pct):
  [(100,100), (0.80, 0.80), (100,500), (70, 70)],
  [0, -0.1, 50, 5])
 
-print \nFalse positive counts at [trials, success_rate, scale_circs, 
path_bias_pct]:
+print \nFalse positive counts at [num_circs, success_rate, scale_circs, 
path_bias_pct]:
 print (Results are some function of success_rate - path_bias_pct vs 
scale_circs)
 print brute_force(lambda x,y: xy,
  reject_false_positive_test,
- #false_positive_test(trials, success_rate, scale_circs, 
path_bias_pct):
+ #false_positive_test(num_circs, success_rate, 
scale_circs, path_bias_pct):
  [(100,100), (0.55, 0.55), (100,500), (50, 50)],
  [0, 

[tor-commits] [tor/master] Fix make check-spaces in circuitbuild.c and router.h

2012-10-10 Thread andrea
commit 7f952da55334d3a3693d1c6e8531fd96730265db
Author: Andrea Shepard and...@persephoneslair.org
Date:   Wed Aug 1 02:38:43 2012 -0700

Fix make check-spaces in circuitbuild.c and router.h
---
 src/or/router.h |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/or/router.h b/src/or/router.h
index c43c308..3964085 100644
--- a/src/or/router.h
+++ b/src/or/router.h
@@ -86,13 +86,18 @@ int router_pick_published_address(const or_options_t 
*options, uint32_t *addr);
 int router_rebuild_descriptor(int force);
 int router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
  crypto_pk_t *ident_key);
-int extrainfo_dump_to_string(char **s, extrainfo_t *extrainfo,
- crypto_pk_t *ident_key);
 void router_get_prim_orport(const routerinfo_t *router,
-tor_addr_port_t *ap_out);
+tor_addr_port_t *addr_port_out);
+void router_get_pref_orport(const routerinfo_t *router,
+tor_addr_port_t *addr_port_out);
+void router_get_pref_ipv6_orport(const routerinfo_t *router,
+ tor_addr_port_t *addr_port_out);
+int router_ipv6_preferred(const routerinfo_t *router);
 int router_has_addr(const routerinfo_t *router, const tor_addr_t *addr);
 int router_has_orport(const routerinfo_t *router,
   const tor_addr_port_t *orport);
+int extrainfo_dump_to_string(char **s, extrainfo_t *extrainfo,
+ crypto_pk_t *ident_key);
 int is_legal_nickname(const char *s);
 int is_legal_nickname_or_hexdigest(const char *s);
 int is_legal_hexdigest(const char *s);



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


[tor-commits] [tor/master] Make reachabiity test in dirserv.c use channel_t

2012-10-10 Thread andrea
commit 35924435d22c2469ecbe06156c8069a928859d63
Author: Andrea Shepard and...@persephoneslair.org
Date:   Sat Aug 25 15:27:50 2012 -0700

Make reachabiity test in dirserv.c use channel_t
---
 src/or/dirserv.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 0d98324..1480cb6 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -8,6 +8,8 @@
 #include buffers.h
 #include config.h
 #include confparse.h
+#include channel.h
+#include channeltls.h
 #include connection.h
 #include connection_or.h
 #include control.h
@@ -3410,8 +3412,8 @@ dirserv_single_reachability_test(time_t now, routerinfo_t 
*router)
   log_debug(LD_OR,Testing reachability of %s at %s:%u.,
 router-nickname, router-address, router-or_port);
   tor_addr_from_ipv4h(router_addr, router-addr);
-  connection_or_connect(router_addr, router-or_port,
-router-cache_info.identity_digest);
+  channel_tls_connect(router_addr, router-or_port,
+  router-cache_info.identity_digest);
 
   /* Possible IPv6. */
   if (get_options()-AuthDirHasIPv6Connectivity == 1 
@@ -3421,8 +3423,8 @@ dirserv_single_reachability_test(time_t now, routerinfo_t 
*router)
   router-nickname,
   tor_addr_to_str(addrstr, router-ipv6_addr, sizeof(addrstr), 1),
   router-ipv6_orport);
-connection_or_connect(router-ipv6_addr, router-ipv6_orport,
-  router-cache_info.identity_digest);
+channel_tls_connect(router-ipv6_addr, router-ipv6_orport,
+router-cache_info.identity_digest);
   }
 }
 



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


[tor-commits] [tor/master] Convert relay.c/relay.h to channel_t

2012-10-10 Thread andrea
commit e136f7ccb4e671e33b6c92a48df819082291f5c1
Author: Andrea Shepard and...@persephoneslair.org
Date:   Sat Aug 25 14:30:01 2012 -0700

Convert relay.c/relay.h to channel_t

Note: this is a squashed commit; see branch bug6465_rebased_v2 of 
user/andrea/tor.git for full history of the following 10 commits:

Convert relay.c/relay.h to channel_t
Updating the timestamp if n_flushed  0 at the end of 
channel_flush_from_first_active_circuit() was redundant since 
channel_write_cell() et al. do it themselves.
Get rid of now-unnecessary time parameter in 
channel_flush_from_first_active_circuit()
Get rid of now-unnecessary time parameter in 
channel_flush_from_first_active_circuit() in connection_or.c
Add non-inlined external call for channeltls.c to free a packed_cell_t
Appease make check-spaces in relay.c
Replace channel_get_write_queue_len() with sufficient and easier to 
implement channel_has_queued_writes() in relay.c
Rename channel_touched_by_client() and client_used field for consistency 
with other timestamps in relay.c
Don't double-free packed cells in relay.c (channel_t Tor now bootstraps and 
works as a client)
Rearrange channel_t struct to use a union distinguishing listener from 
cell-bearing channels in relay.c
---
 src/or/connection.c |4 -
 src/or/relay.c  |  405 +--
 src/or/relay.h  |8 +-
 3 files changed, 236 insertions(+), 181 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 8e9c701..db234f1 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -265,9 +265,6 @@ or_connection_new(int socket_family)
 
   or_conn-timestamp_last_added_nonpadding = time(NULL);
 
-  or_conn-active_circuit_pqueue = smartlist_new();
-  or_conn-active_circuit_pqueue_last_recalibrated = cell_ewma_get_tick();
-
   return or_conn;
 }
 
@@ -508,7 +505,6 @@ _connection_free(connection_t *conn)
 or_conn-tls = NULL;
 or_handshake_state_free(or_conn-handshake_state);
 or_conn-handshake_state = NULL;
-smartlist_free(or_conn-active_circuit_pqueue);
 tor_free(or_conn-nickname);
   }
   if (conn-type == CONN_TYPE_AP) {
diff --git a/src/or/relay.c b/src/or/relay.c
index 4a50b71..3850562 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -14,6 +14,7 @@
 #define RELAY_PRIVATE
 #include or.h
 #include buffers.h
+#include channel.h
 #include circuitbuild.h
 #include circuitlist.h
 #include config.h
@@ -166,7 +167,7 @@ int
 circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
cell_direction_t cell_direction)
 {
-  or_connection_t *or_conn=NULL;
+  channel_t *chan = NULL;
   crypt_path_t *layer_hint=NULL;
   char recognized=0;
   int reason;
@@ -213,17 +214,17 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
   /* not recognized. pass it on. */
   if (cell_direction == CELL_DIRECTION_OUT) {
 cell-circ_id = circ-n_circ_id; /* switch it */
-or_conn = circ-n_conn;
+chan = circ-n_chan;
   } else if (! CIRCUIT_IS_ORIGIN(circ)) {
 cell-circ_id = TO_OR_CIRCUIT(circ)-p_circ_id; /* switch it */
-or_conn = TO_OR_CIRCUIT(circ)-p_conn;
+chan = TO_OR_CIRCUIT(circ)-p_chan;
   } else {
 log_fn(LOG_PROTOCOL_WARN, LD_OR,
Dropping unrecognized inbound cell on origin circuit.);
 return 0;
   }
 
-  if (!or_conn) {
+  if (!chan) {
 //  Can this splice stuff be done more cleanly?
 if (! CIRCUIT_IS_ORIGIN(circ) 
 TO_OR_CIRCUIT(circ)-rend_splice 
@@ -254,7 +255,7 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
   * we might kill the circ before we relay
   * the cells. */
 
-  append_cell_to_circuit_queue(circ, or_conn, cell, cell_direction, 0);
+  append_cell_to_circuit_queue(circ, chan, cell, cell_direction, 0);
   return 0;
 }
 
@@ -353,13 +354,13 @@ circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
cell_direction_t cell_direction,
crypt_path_t *layer_hint, streamid_t on_stream)
 {
-  or_connection_t *conn; /* where to send the cell */
+  channel_t *chan; /* where to send the cell */
 
   if (cell_direction == CELL_DIRECTION_OUT) {
 crypt_path_t *thishop; /* counter for repeated crypts */
-conn = circ-n_conn;
-if (!CIRCUIT_IS_ORIGIN(circ) || !conn) {
-  log_warn(LD_BUG,outgoing relay cell has n_conn==NULL. Dropping.);
+chan = circ-n_chan;
+if (!CIRCUIT_IS_ORIGIN(circ) || !chan) {
+  log_warn(LD_BUG,outgoing relay cell has n_chan==NULL. Dropping.);
   return 0; /* just drop it */
 }
 
@@ -388,14 +389,14 @@ circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
   return 0; /* just drop it */
 }
 or_circ = TO_OR_CIRCUIT(circ);
-conn = or_circ-p_conn;
+chan = or_circ-p_chan;
 relay_set_digest(or_circ-p_digest, cell);
 if (relay_crypt_one_payload(or_circ-p_crypto, cell-payload, 

[tor-commits] [tor/master] Support channel_t in connection_edge.c

2012-10-10 Thread andrea
commit 4768c0efe3e9471cc367c3740d1a4ba0ab79626c
Author: Andrea Shepard and...@persephoneslair.org
Date:   Sat Aug 25 11:55:39 2012 -0700

Support channel_t in connection_edge.c
---
 src/or/connection_edge.c |   50 +++--
 1 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index ade3b48..9bcfca3 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -11,6 +11,7 @@
 
 #include or.h
 #include buffers.h
+#include channel.h
 #include circuitlist.h
 #include circuituse.h
 #include config.h
@@ -3068,27 +3069,30 @@ connection_exit_begin_conn(cell_t *cell, circuit_t 
*circ)
   tor_free(address);
   return 0;
 }
-if (or_circ  or_circ-p_conn  !options-AllowSingleHopExits 
-(or_circ-is_first_hop ||
- (!connection_or_digest_is_known_relay(
-   or_circ-p_conn-identity_digest) 
+if (or_circ  or_circ-p_chan) {
+  tor_assert(!(or_circ-p_chan-is_listener));
+  if (!options-AllowSingleHopExits 
+   (or_circ-is_first_hop ||
+(!connection_or_digest_is_known_relay(
+or_circ-p_chan-u.cell_chan.identity_digest) 
   should_refuse_unknown_exits(options {
-  /* Don't let clients use us as a single-hop proxy, unless the user
-   * has explicitly allowed that in the config. It attracts attackers
-   * and users who'd be better off with, well, single-hop proxies.
-   */
-  log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- Attempt by %s to open a stream %s. Closing.,
- safe_str(or_circ-p_conn-_base.address),
- or_circ-is_first_hop ? on first hop of circuit :
- from unknown relay);
-  relay_send_end_cell_from_edge(rh.stream_id, circ,
-or_circ-is_first_hop ?
-  END_STREAM_REASON_TORPROTOCOL :
-  END_STREAM_REASON_MISC,
-NULL);
-  tor_free(address);
-  return 0;
+/* Don't let clients use us as a single-hop proxy, unless the user
+ * has explicitly allowed that in the config. It attracts attackers
+ * and users who'd be better off with, well, single-hop proxies.
+ */
+log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+   Attempt by %s to open a stream %s. Closing.,
+   safe_str(channel_get_canonical_remote_descr(or_circ-p_chan)),
+   or_circ-is_first_hop ? on first hop of circuit :
+   from unknown relay);
+relay_send_end_cell_from_edge(rh.stream_id, circ,
+  or_circ-is_first_hop ?
+END_STREAM_REASON_TORPROTOCOL :
+END_STREAM_REASON_MISC,
+  NULL);
+tor_free(address);
+return 0;
+  }
 }
   } else if (rh.command == RELAY_COMMAND_BEGIN_DIR) {
 if (!directory_permits_begindir_requests(options) ||
@@ -3101,8 +3105,8 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
  * caller might want to know whether his IP address has changed, and
  * we might already have corrected _base.addr[ess] for the relay's
  * canonical IP address. */
-if (or_circ  or_circ-p_conn)
-  address = tor_dup_addr(or_circ-p_conn-real_addr);
+if (or_circ  or_circ-p_chan)
+  address = tor_strdup(channel_get_actual_remote_descr(or_circ-p_chan));
 else
   address = tor_strdup(127.0.0.1);
 port = 1; /*  This value is never actually used anywhere, and there
@@ -3178,8 +3182,6 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
 
   if (rh.command == RELAY_COMMAND_BEGIN_DIR) {
 tor_assert(or_circ);
-if (or_circ-p_conn  !tor_addr_is_null(or_circ-p_conn-real_addr))
-  tor_addr_copy(n_stream-_base.addr, or_circ-p_conn-real_addr);
 return connection_exit_connect_dir(n_stream);
   }
 



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


[tor-commits] [tor/master] Query circuit count from associated channel of or_conn in control.c

2012-10-10 Thread andrea
commit 6cce6241dd4405f6cf21057f9913e07633cf18bb
Author: Andrea Shepard and...@persephoneslair.org
Date:   Thu Aug 30 15:27:55 2012 -0700

Query circuit count from associated channel of or_conn in control.c
---
 src/or/control.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/or/control.c b/src/or/control.c
index 74c6acc..5c05fe1 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -12,6 +12,8 @@
 
 #include or.h
 #include buffers.h
+#include channel.h
+#include channeltls.h
 #include circuitbuild.h
 #include circuitlist.h
 #include circuituse.h
@@ -3822,7 +3824,11 @@ control_event_or_conn_status(or_connection_t *conn, 
or_conn_status_event_t tp,
   log_warn(LD_BUG, Unrecognized status code %d, (int)tp);
   return 0;
 }
-  ncircs = circuit_count_pending_on_or_conn(conn);
+  if (conn-chan) {
+ncircs = circuit_count_pending_on_channel(TLS_CHAN_TO_BASE(conn-chan));
+  } else {
+ncircs = 0;
+  }
   ncircs += conn-n_circuits;
   if (ncircs  (tp == OR_CONN_EVENT_FAILED || tp == OR_CONN_EVENT_CLOSED)) {
 tor_snprintf(ncircs_buf, sizeof(ncircs_buf), %sNCIRCS=%d,



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


[tor-commits] [tor/master] Use channel_t in cpuworker.c

2012-10-10 Thread andrea
commit 77dac97354974e8a819d8e35ad4e7a7619b4
Author: Andrea Shepard and...@persephoneslair.org
Date:   Thu Aug 30 15:47:05 2012 -0700

Use channel_t in cpuworker.c

Note: this is a squashed commit; see branch bug6465_rebased_v2 of 
user/andrea/tor.git for full history of the following 2 commits:

Use channel_t in cpuworker.c
Fix bug in channel_t usage in cpuworker.c that was killing relaying on 
channel_t-ized Tor.  The tags passed to the worker now have a channel ID, not a 
connection ID.
---
 src/or/cpuworker.c |   36 +++-
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 0255227..a78518f 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -14,6 +14,8 @@
 
 #include or.h
 #include buffers.h
+#include channel.h
+#include channeltls.h
 #include circuitbuild.h
 #include circuitlist.h
 #include config.h
@@ -68,19 +70,20 @@ connection_cpu_finished_flushing(connection_t *conn)
 /** Pack global_id and circ_id; set *tag to the result. (See note on
  * cpuworker_main for wire format.) */
 static void
-tag_pack(char *tag, uint64_t conn_id, circid_t circ_id)
+tag_pack(char *tag, uint64_t chan_id, circid_t circ_id)
 {
   /* RETHINK THIS WHOLE MESS  !NM NM NM NM*/
-  set_uint64(tag, conn_id);
+  /* DOUBLEPLUSTHIS AS AS AS AS*/
+  set_uint64(tag, chan_id);
   set_uint16(tag+8, circ_id);
 }
 
 /** Unpack btag/b into addr, port, and circ_id.
  */
 static void
-tag_unpack(const char *tag, uint64_t *conn_id, circid_t *circ_id)
+tag_unpack(const char *tag, uint64_t *chan_id, circid_t *circ_id)
 {
-  *conn_id = get_uint64(tag);
+  *chan_id = get_uint64(tag);
   *circ_id = get_uint16(tag+8);
 }
 
@@ -131,10 +134,9 @@ connection_cpu_process_inbuf(connection_t *conn)
 {
   char success;
   char buf[LEN_ONION_RESPONSE];
-  uint64_t conn_id;
+  uint64_t chan_id;
   circid_t circ_id;
-  connection_t *tmp_conn;
-  or_connection_t *p_conn = NULL;
+  channel_t *p_chan = NULL;
   circuit_t *circ;
 
   tor_assert(conn);
@@ -152,15 +154,15 @@ connection_cpu_process_inbuf(connection_t *conn)
 connection_fetch_from_buf(buf,LEN_ONION_RESPONSE-1,conn);
 
 /* parse out the circ it was talking about */
-tag_unpack(buf, conn_id, circ_id);
+tag_unpack(buf, chan_id, circ_id);
 circ = NULL;
-tmp_conn = connection_get_by_global_id(conn_id);
-if (tmp_conn  !tmp_conn-marked_for_close 
-tmp_conn-type == CONN_TYPE_OR)
-  p_conn = TO_OR_CONN(tmp_conn);
+log_debug(LD_OR,
+  Unpacking cpuworker reply, chan_id is %lu, circ_id is %d,
+  chan_id, circ_id);
+p_chan = channel_find_by_global_id(chan_id);
 
-if (p_conn)
-  circ = circuit_get_by_circid_orconn(circ_id, p_conn);
+if (p_chan)
+  circ = circuit_get_by_circid_channel(circ_id, p_chan);
 
 if (success == 0) {
   log_debug(LD_OR,
@@ -475,12 +477,12 @@ assign_onionskin_to_cpuworker(connection_t *cpuworker,
 
 tor_assert(cpuworker);
 
-if (!circ-p_conn) {
-  log_info(LD_OR,circ-p_conn gone. Failing circ.);
+if (!circ-p_chan) {
+  log_info(LD_OR,circ-p_chan gone. Failing circ.);
   tor_free(onionskin);
   return -1;
 }
-tag_pack(tag, circ-p_conn-_base.global_identifier,
+tag_pack(tag, circ-p_chan-global_identifier,
  circ-p_circ_id);
 
 cpuworker-state = CPUWORKER_STATE_BUSY_ONION;



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


[tor-commits] [tor/master] Switch onion.c over to channel_t

2012-10-10 Thread andrea
commit 8b14db9628f0e8982e894034e86c8efdd78cff32
Author: Andrea Shepard and...@persephoneslair.org
Date:   Sun Sep 2 21:13:25 2012 -0700

Switch onion.c over to channel_t
---
 src/or/onion.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/onion.c b/src/or/onion.c
index ff1556c..17d8e77 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -106,7 +106,7 @@ onion_next_task(char **onionskin_out)
 return NULL; /* no onions pending, we're done */
 
   tor_assert(ol_list-circ);
-  tor_assert(ol_list-circ-p_conn); /* make sure it's still valid */
+  tor_assert(ol_list-circ-p_chan); /* make sure it's still valid */
   tor_assert(ol_length  0);
   circ = ol_list-circ;
   *onionskin_out = ol_list-onionskin;



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


[tor-commits] [tor/master] Convert rendmid.c to channel_t

2012-10-10 Thread andrea
commit f0f87cb68a22feaf552a18b521d3313d843f8793
Author: Andrea Shepard and...@persephoneslair.org
Date:   Tue Sep 4 01:44:19 2012 -0700

Convert rendmid.c to channel_t
---
 src/or/rendmid.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index bacd0ef..00bbd28 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -35,7 +35,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t 
*request,
Received an ESTABLISH_INTRO request on circuit %d,
circ-p_circ_id);
 
-  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_conn) {
+  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_chan) {
 log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
  Rejecting ESTABLISH_INTRO on non-OR or non-edge circuit.);
 reason = END_CIRC_REASON_TORPROTOCOL;
@@ -142,7 +142,7 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t 
*request,
   log_info(LD_REND, Received an INTRODUCE1 request on circuit %d,
circ-p_circ_id);
 
-  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_conn) {
+  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_chan) {
 log_warn(LD_PROTOCOL,
  Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.,
  circ-p_circ_id);
@@ -224,7 +224,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const 
uint8_t *request,
   log_info(LD_REND, Received an ESTABLISH_RENDEZVOUS request on circuit %d,
circ-p_circ_id);
 
-  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_conn) {
+  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_chan) {
 log_warn(LD_PROTOCOL,
  Tried to establish rendezvous on non-OR or non-edge circuit.);
 goto err;
@@ -277,7 +277,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t 
*request,
   char hexid[9];
   int reason = END_CIRC_REASON_INTERNAL;
 
-  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_conn) {
+  if (circ-_base.purpose != CIRCUIT_PURPOSE_OR || circ-_base.n_chan) {
 log_info(LD_REND,
  Tried to complete rendezvous on non-OR or non-edge circuit %d.,
  circ-p_circ_id);



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


[tor-commits] [tor/master] Use dirreq_id from channel_t when appropriate

2012-10-10 Thread andrea
commit 28f108bcceab59fcf9f27e33065f64bfdb0f159a
Author: Andrea Shepard and...@persephoneslair.org
Date:   Tue Sep 4 00:33:16 2012 -0700

Use dirreq_id from channel_t when appropriate
---
 src/or/channel.h |5 -
 src/or/connection_edge.c |4 ++--
 src/or/directory.c   |8 
 src/or/geoip.c   |6 +++---
 4 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/or/channel.h b/src/or/channel.h
index 242a078..18d9a81 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -38,11 +38,6 @@ struct channel_s {
*/
   unsigned int is_listener:1;
 
-  /** Unique ID for measuring direct network status requests;vtunneled ones
-   * come over a circuit_t, which has a dirreq_id field as well, but is a
-   * distinct namespace. */
-  uint64_t dirreq_id;
-
   /** Why did we close?
*/
   enum {
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 9bcfca3..834f970 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -3124,7 +3124,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
 
   /* Remember the tunneled request ID in the new edge connection, so that
* we can measure download times. */
-  TO_CONN(n_stream)-dirreq_id = circ-dirreq_id;
+  n_stream-dirreq_id = circ-dirreq_id;
 
   n_stream-_base.purpose = EXIT_PURPOSE_CONNECT;
 
@@ -3366,7 +3366,7 @@ connection_exit_connect_dir(edge_connection_t *exitconn)
 
   /* Note that the new dir conn belongs to the same tunneled request as
* the edge conn, so that we can measure download times. */
-  TO_CONN(dirconn)-dirreq_id = TO_CONN(exitconn)-dirreq_id;
+  dirconn-dirreq_id = exitconn-dirreq_id;
 
   connection_link_connections(TO_CONN(dirconn), TO_CONN(exitconn));
 
diff --git a/src/or/directory.c b/src/or/directory.c
index 7df91fb..8003444 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2855,8 +2855,8 @@ directory_handle_command_get(dir_connection_t *conn, 
const char *headers,
 geoip_note_ns_response(act, GEOIP_SUCCESS);
 /* Note that a request for a network status has started, so that we
  * can measure the download time later on. */
-if (TO_CONN(conn)-dirreq_id)
-  geoip_start_dirreq(TO_CONN(conn)-dirreq_id, dlen, act,
+if (conn-dirreq_id)
+  geoip_start_dirreq(conn-dirreq_id, dlen, act,
  DIRREQ_TUNNELED);
 else
   geoip_start_dirreq(TO_CONN(conn)-global_identifier, dlen, act,
@@ -3529,8 +3529,8 @@ connection_dir_finished_flushing(dir_connection_t *conn)
   /* Note that we have finished writing the directory response. For direct
* connections this means we're done, for tunneled connections its only
* an intermediate step. */
-  if (TO_CONN(conn)-dirreq_id)
-geoip_change_dirreq_state(TO_CONN(conn)-dirreq_id, DIRREQ_TUNNELED,
+  if (conn-dirreq_id)
+geoip_change_dirreq_state(conn-dirreq_id, DIRREQ_TUNNELED,
   DIRREQ_FLUSHING_DIR_CONN_FINISHED);
   else
 geoip_change_dirreq_state(TO_CONN(conn)-global_identifier,
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 6b7cc82..a995f8b 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -578,7 +578,7 @@ _c_hist_compare(const void **_a, const void **_b)
  * failed, the others as still running. */
 #define DIRREQ_TIMEOUT (10*60)
 
-/** Entry in a map from either conn-global_identifier for direct requests
+/** Entry in a map from either chan-global_identifier for direct requests
  * or a unique circuit identifier for tunneled requests to request time,
  * response size, and completion time of a network status request. Used to
  * measure download times of requests to derive average client
@@ -586,7 +586,7 @@ _c_hist_compare(const void **_a, const void **_b)
 typedef struct dirreq_map_entry_t {
   HT_ENTRY(dirreq_map_entry_t) node;
   /** Unique identifier for this network status request; this is either the
-   * conn-global_identifier of the dir conn (direct request) or a new
+   * chan-global_identifier of the dir channel (direct request) or a new
* locally unique identifier of a circuit (tunneled request). This ID is
* only unique among other direct or tunneled requests, respectively. */
   uint64_t dirreq_id;
@@ -705,7 +705,7 @@ geoip_change_dirreq_state(uint64_t dirreq_id, dirreq_type_t 
type,
   if ((type == DIRREQ_DIRECT 
  new_state == DIRREQ_FLUSHING_DIR_CONN_FINISHED) ||
   (type == DIRREQ_TUNNELED 
- new_state == DIRREQ_OR_CONN_BUFFER_FLUSHED)) {
+ new_state == DIRREQ_CHANNEL_BUFFER_FLUSHED)) {
 tor_gettimeofday(ent-completion_time);
 ent-completed = 1;
   }



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


[tor-commits] [tor/master] Use connection_or_get_num_circuits() in control.c

2012-10-10 Thread andrea
commit 9ad7ba9f2267a9ee34fafda9356f1fa86633f00f
Author: Andrea Shepard and...@persephoneslair.org
Date:   Fri Sep 7 04:40:42 2012 -0700

Use connection_or_get_num_circuits() in control.c
---
 src/or/control.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/control.c b/src/or/control.c
index 5c05fe1..75a8f59 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -3829,7 +3829,7 @@ control_event_or_conn_status(or_connection_t *conn, 
or_conn_status_event_t tp,
   } else {
 ncircs = 0;
   }
-  ncircs += conn-n_circuits;
+  ncircs += connection_or_get_num_circuits(conn);
   if (ncircs  (tp == OR_CONN_EVENT_FAILED || tp == OR_CONN_EVENT_CLOSED)) {
 tor_snprintf(ncircs_buf, sizeof(ncircs_buf), %sNCIRCS=%d,
  reason ?   : , ncircs);



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


[tor-commits] [tor/master] Use channel_is_bad_for_new_circs(), connection_or_get_num_circs() in main.c

2012-10-10 Thread andrea
commit cb62a0b69a7d67b427224ca4c3075b49853a3a1f
Author: Andrea Shepard and...@persephoneslair.org
Date:   Fri Sep 7 04:42:13 2012 -0700

Use channel_is_bad_for_new_circs(), connection_or_get_num_circs() in main.c
---
 src/or/main.c |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index a1b1502..f53bcf3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -13,6 +13,8 @@
 #define MAIN_PRIVATE
 #include or.h
 #include buffers.h
+#include channel.h
+#include channeltls.h
 #include circuitbuild.h
 #include circuitlist.h
 #include circuituse.h
@@ -1046,7 +1048,8 @@ run_connection_housekeeping(int i, time_t now)
   tor_assert(conn-outbuf);
 #endif
 
-  if (or_conn-is_bad_for_new_circs  !or_conn-n_circuits) {
+  if (channel_is_bad_for_new_circs(TLS_CHAN_TO_BASE(or_conn-chan)) 
+  !connection_or_get_num_circuits(or_conn)) {
 /* It's bad for new circuits, and has no unmarked circuits on it:
  * mark it now. */
 log_info(LD_OR,
@@ -1064,14 +1067,15 @@ run_connection_housekeeping(int i, time_t now)
(int)conn-s,conn-address, conn-port);
   connection_mark_for_close(conn);
 }
-  } else if (we_are_hibernating()  !or_conn-n_circuits 
+  } else if (we_are_hibernating() 
+ !connection_or_get_num_circuits(or_conn) 
  !connection_get_outbuf_len(conn)) {
 /* We're hibernating, there's no circuits, and nothing to flush.*/
 log_info(LD_OR,Expiring non-used OR connection to fd %d (%s:%d) 
  [Hibernating or exiting].,
  (int)conn-s,conn-address, conn-port);
 connection_mark_and_flush(conn);
-  } else if (!or_conn-n_circuits 
+  } else if (!connection_or_get_num_circuits(or_conn) 
  now = or_conn-timestamp_last_added_nonpadding +
  IDLE_OR_CONN_TIMEOUT) {
 log_info(LD_OR,Expiring non-used OR connection to fd %d (%s:%d) 



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


[tor-commits] [tor/master] Add LD_CHANNEL log domain in log.c

2012-10-10 Thread andrea
commit f06880c855a6ac4dd824bed7efcd0bd0436bda32
Author: Andrea Shepard and...@persephoneslair.org
Date:   Fri Sep 7 14:38:16 2012 -0700

Add LD_CHANNEL log domain in log.c
---
 src/common/log.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/common/log.c b/src/common/log.c
index 5e2e6b5..ef2e69d 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -907,7 +907,7 @@ log_level_to_string(int level)
 static const char *domain_list[] = {
   GENERAL, CRYPTO, NET, CONFIG, FS, PROTOCOL, MM,
   HTTP, APP, CONTROL, CIRC, REND, BUG, DIR, DIRSERV,
-  OR, EDGE, ACCT, HIST, HANDSHAKE, HEARTBEAT, NULL
+  OR, EDGE, ACCT, HIST, HANDSHAKE, HEARTBEAT, CHANNEL, NULL
 };
 
 /** Return a bitmask for the log domain for which bdomain/b is the name,



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


[tor-commits] [tor/master] Call channel_run_cleanup() in main.c, and include a comment explaining how closing or_connections related to channels

2012-10-10 Thread andrea
commit 07f9e8fc7d5de57b878118a5179c26eee8466a39
Author: Andrea Shepard and...@persephoneslair.org
Date:   Sat Sep 8 18:58:03 2012 -0700

Call channel_run_cleanup() in main.c, and include a comment explaining how 
closing or_connections related to channels
---
 src/or/main.c |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index f53bcf3..491c48e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -400,6 +400,18 @@ connection_unlink(connection_t *conn)
   if (conn-type == CONN_TYPE_OR) {
 if (!tor_digest_is_zero(TO_OR_CONN(conn)-identity_digest))
   connection_or_remove_from_identity_map(TO_OR_CONN(conn));
+/* connection_unlink() can only get called if the connection
+ * was already on the closeable list, and it got there by
+ * connection_mark_for_close(), which was called from
+ * connection_or_close_normally() or
+ * connection_or_close_for_error(), so the channel should
+ * already be in CHANNEL_STATE_CLOSING, and then the
+ * connection_about_to_close_connection() goes to
+ * connection_or_about_to_close(), which calls channel_closed()
+ * to notify the channel_t layer, and closed the channel, so
+ * nothing more to do here to deal with the channel associated
+ * with an orconn.
+ */
   }
   connection_free(conn);
 }
@@ -1525,6 +1537,9 @@ run_scheduled_events(time_t now)
* flush it. */
   or_state_save(now);
 
+  /** 8c. Do channel cleanup just like for connections */
+  channel_run_cleanup();
+
   /** 9. and if we're a server, check whether our DNS is telling stories to
* us. */
   if (!net_is_disabled() 



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


[tor-commits] [tor/master] Keep better statistics about channels and dump them from dumpstats() on SIGUSR1

2012-10-10 Thread andrea
commit 7138a4adac9592edbb73d3983cc51db153c76edf
Author: Andrea Shepard and...@persephoneslair.org
Date:   Thu Sep 13 02:44:21 2012 -0700

Keep better statistics about channels and dump them from dumpstats() on 
SIGUSR1
---
 src/or/channel.c|  400 ++-
 src/or/channel.h|   33 -
 src/or/channeltls.c |   43 ++
 src/or/main.c   |4 +-
 4 files changed, 472 insertions(+), 8 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 0268fce..cf08e3b 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -1488,6 +1488,8 @@ channel_write_cell(channel_t *chan, cell_t *cell)
   channel_timestamp_xmit(chan);
   /* If we're here the queue is empty, so it's drained too */
   channel_timestamp_drained(chan);
+  /* Update the counter */
+  ++(chan-u.cell_chan.n_cells_xmitted);
 }
   }
 
@@ -1546,6 +1548,8 @@ channel_write_packed_cell(channel_t *chan, packed_cell_t 
*packed_cell)
   channel_timestamp_xmit(chan);
   /* If we're here the queue is empty, so it's drained too */
   channel_timestamp_drained(chan);
+  /* Update the counter */
+  ++(chan-u.cell_chan.n_cells_xmitted);
 }
   }
 
@@ -1609,6 +1613,8 @@ channel_write_var_cell(channel_t *chan, var_cell_t 
*var_cell)
   channel_timestamp_xmit(chan);
   /* If we're here the queue is empty, so it's drained too */
   channel_timestamp_drained(chan);
+  /* Update the counter */
+  ++(chan-u.cell_chan.n_cells_xmitted);
 }
   }
 
@@ -1883,6 +1889,7 @@ channel_flush_some_cells_from_outgoing_queue(channel_t 
*chan,
 tor_free(q);
 ++flushed;
 channel_timestamp_xmit(chan);
+++(chan-u.cell_chan.n_cells_xmitted);
   }
   /* Else couldn't write it; leave it on the queue */
 } else {
@@ -1902,6 +1909,7 @@ channel_flush_some_cells_from_outgoing_queue(channel_t 
*chan,
 tor_free(q);
 ++flushed;
 channel_timestamp_xmit(chan);
+++(chan-u.cell_chan.n_cells_xmitted);
   }
   /* Else couldn't write it; leave it on the queue */
 } else {
@@ -1921,6 +1929,7 @@ channel_flush_some_cells_from_outgoing_queue(channel_t 
*chan,
 tor_free(q);
 ++flushed;
 channel_timestamp_xmit(chan);
+++(chan-u.cell_chan.n_cells_xmitted);
   }
   /* Else couldn't write it; leave it on the queue */
 } else {
@@ -2179,6 +2188,11 @@ channel_queue_incoming(channel_t *listener, channel_t 
*incoming)
 listener-u.listener.incoming_list = smartlist_new();
   }
 
+  /* Bump the counter and timestamp it */
+  channel_timestamp_active(listener);
+  channel_timestamp_accepted(listener);
+  ++(listener-u.listener.n_accepted);
+
   /* If we don't need to queue, process it right away */
   if (!need_to_queue) {
 tor_assert(listener-u.listener.listener);
@@ -2301,6 +2315,9 @@ channel_queue_cell(channel_t *chan, cell_t *cell)
   /* Timestamp for receiving */
   channel_timestamp_recv(chan);
 
+  /* Update the counter */
+  ++(chan-u.cell_chan.n_cells_recved);
+
   /* If we don't need to queue we can just call cell_handler */
   if (!need_to_queue) {
 tor_assert(chan-u.cell_chan.cell_handler);
@@ -2360,6 +2377,9 @@ channel_queue_var_cell(channel_t *chan, var_cell_t 
*var_cell)
   /* Timestamp for receiving */
   channel_timestamp_recv(chan);
 
+  /* Update the counter */
+  ++(chan-u.cell_chan.n_cells_recved);
+
   /* If we don't need to queue we can just call cell_handler */
   if (!need_to_queue) {
 tor_assert(chan-u.cell_chan.var_cell_handler);
@@ -2417,6 +2437,41 @@ channel_send_destroy(circid_t circ_id, channel_t *chan, 
int reason)
 }
 
 /**
+ * Channel statistics
+ *
+ * This is called from dumpstats() in main.c and spams the log with
+ * statistics on channels.
+ */
+
+void
+channel_dumpstats(int severity)
+{
+  if (all_channels  smartlist_len(all_channels)  0) {
+log(severity, LD_GENERAL,
+Dumping statistics about %d channels:,
+smartlist_len(all_channels));
+log(severity, LD_GENERAL,
+%d are active, %d are listeners, and %d are done and 
+waiting for cleanup,
+(active_channels != NULL) ?
+  smartlist_len(active_channels) : 0,
+(listening_channels != NULL) ?
+  smartlist_len(listening_channels) : 0,
+(finished_channels != NULL) ?
+  smartlist_len(finished_channels) : 0);
+
+SMARTLIST_FOREACH(all_channels, channel_t *, chan,
+  channel_dump_statistics(chan, severity));
+
+log(severity, LD_GENERAL,
+Done spamming about channels now);
+  } else {
+log(severity, LD_GENERAL,
+No channels to dump);
+  }
+}
+
+/**
  * Channel cleanup
  *
  * This gets called periodically from run_scheduled_events() in main.c;
@@ -2785,6 +2840,265 

[tor-commits] [tor/master] Call channel_tls_free_all() and channel_free_all() from tor_free_all in main.c

2012-10-10 Thread andrea
commit a9a75ee59a719f938b02d48c6df3db649cf32cb9
Author: Andrea Shepard and...@persephoneslair.org
Date:   Wed Sep 12 16:31:08 2012 -0700

Call channel_tls_free_all() and channel_free_all() from tor_free_all in 
main.c
---
 src/or/main.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/or/main.c b/src/or/main.c
index b87cf52..908e490 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2476,6 +2476,8 @@ tor_free_all(int postfork)
   circuit_free_all();
   entry_guards_free_all();
   pt_free_all();
+  channel_tls_free_all();
+  channel_free_all();
   connection_free_all();
   buf_shrink_freelists(1);
   memarea_clear_freelist();



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


[tor-commits] [tor/master] Check return value from connection_or_connect() in channel_tls_connect()

2012-10-10 Thread andrea
commit 71ba517e0c557d0ae35af7a5f99c8756f336a416
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 18:24:04 2012 -0700

Check return value from connection_or_connect() in channel_tls_connect()

It's possible for connection_or_connect() to fail and return NULL after it
sets tlschan-conn, so not checking leaves a channel hanging around in
CHANNEL_STATE_OPENING with a pointer to a freed or_connection_t forever.
---
 src/or/channeltls.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 8a1b5eb..03792dd 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -129,7 +129,7 @@ channel_tls_connect(const tor_addr_t *addr, uint16_t port,
 cell_ewma_get_tick();
 
   /* Set up or_connection stuff */
-  connection_or_connect(addr, port, id_digest, tlschan);
+  tlschan-conn = connection_or_connect(addr, port, id_digest, tlschan);
   /* connection_or_connect() will fill in tlschan-conn */
   if (!(tlschan-conn)) {
 channel_change_state(chan, CHANNEL_STATE_ERROR);



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


[tor-commits] [tor/master] channel_free() should be a no-op

2012-10-10 Thread andrea
commit 64e6f6687c8fc275ddc207fa43f29c4213d3cad2
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 19:50:41 2012 -0700

channel_free() should be a no-op
---
 src/or/channel.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 2fe4466..690bfb9 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -763,7 +763,8 @@ channel_init_listener(channel_t *chan)
 void
 channel_free(channel_t *chan)
 {
-  tor_assert(chan);
+  if (!chan) return;
+
   /* It must be closed or errored */
   tor_assert(chan-state == CHANNEL_STATE_CLOSED ||
  chan-state == CHANNEL_STATE_ERROR);



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


[tor-commits] [tor/master] Simplify channel_find_by_remote_digest()

2012-10-10 Thread andrea
commit 341928c807b1d16383710b8b2728ed963746bb9d
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 19:53:05 2012 -0700

Simplify channel_find_by_remote_digest()
---
 src/or/channel.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 9b814bb..c5bf60d 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -596,14 +596,13 @@ channel_find_by_global_id(uint64_t global_identifier)
 channel_t *
 channel_find_by_remote_digest(const char *identity_digest)
 {
-  channel_t *rv = NULL, *tmp;
+  channel_t *rv = NULL;
 
   tor_assert(identity_digest);
 
   /* Search for it in the identity map */
   if (channel_identity_map) {
-tmp = digestmap_get(channel_identity_map, identity_digest);
-rv = tmp;
+rv = digestmap_get(channel_identity_map, identity_digest);
   }
 
   return rv;



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


[tor-commits] [tor/master] Add changes file for channels (ticket 6465)

2012-10-10 Thread andrea
commit b1b33f15bed25b2dbbe1ddd3bc69fe18b2fb8ed4
Author: Andrea Shepard and...@persephoneslair.org
Date:   Thu Sep 13 05:56:21 2012 -0700

Add changes file for channels (ticket 6465)
---
 changes/bug6465 |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/changes/bug6465 b/changes/bug6465
new file mode 100644
index 000..a5ea9e2
--- /dev/null
+++ b/changes/bug6465
@@ -0,0 +1,12 @@
+  o Infrastructure features:
+- Introduce new channel_t abstraction between circuits and or_connection_t
+  to allow for implementing alternate OR-to-OR transports.  A channel_t is
+  an abstract object which can either be a cell-bearing channel, which is
+  responsible for authenticating and handshaking with the remote OR and
+  transmitting cells to and from it, or a listening channel, which spawns
+  new cell-bearing channels at the request of remote ORs.
+
+- Also new is the channel_tls_t subclass of channel_t, adapting it to the
+  existing or_connection_t code.  The V2/V3 protocol handshaking code
+  which formerly resided in command.c has been moved below the channel_t
+  abstraction layer and may be found in channeltls.c now.



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


[tor-commits] [tor/master] Abolish superfluous channel_find_by_remote_nickname()

2012-10-10 Thread andrea
commit 965c9de498ab7f6c7ce3dce133bb34456f3d668e
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 19:52:04 2012 -0700

Abolish superfluous channel_find_by_remote_nickname()
---
 src/or/channel.c |   36 
 src/or/channel.h |1 -
 2 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 690bfb9..9b814bb 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -610,42 +610,6 @@ channel_find_by_remote_digest(const char *identity_digest)
 }
 
 /**
- * Find channel by remote nickname
- *
- * This function looks up a channel by the nickname of the remote
- * endpoint.  It's possible that more than one channel to that endpoint
- * nickname exists, but there is not currently any supported way to iterate
- * them.  Use digests.
- *
- * @param nickname A node nickname
- * @return A channel pointer to a channel to a node with that nickname, or
- * NULL if none is available.
- */
-
-channel_t *
-channel_find_by_remote_nickname(const char *nickname)
-{
-  channel_t *rv = NULL;
-
-  tor_assert(nickname);
-
-  if (all_channels  smartlist_len(all_channels)  0) {
-SMARTLIST_FOREACH_BEGIN(all_channels, channel_t *, curr) {
-  if (!(curr-is_listener)) {
-if (curr-u.cell_chan.nickname 
-strncmp(curr-u.cell_chan.nickname, nickname,
-MAX_NICKNAME_LEN) == 0) {
-  rv = curr;
-  break;
-}
-  }
-} SMARTLIST_FOREACH_END(curr);
-  }
-
-  return rv;
-}
-
-/**
  * Next channel with digest
  *
  * This function takes a channel and finds the next channel in the list
diff --git a/src/or/channel.h b/src/or/channel.h
index ed69b92..7075981 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -368,7 +368,6 @@ int channel_is_better(time_t now,
 
 channel_t * channel_find_by_global_id(uint64_t global_identifier);
 channel_t * channel_find_by_remote_digest(const char *identity_digest);
-channel_t * channel_find_by_remote_nickname(const char *nickname);
 
 /** For things returned by channel_find_by_remote_digest(), walk the list.
  */



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


[tor-commits] [tor/master] Make channel_force_free() static

2012-10-10 Thread andrea
commit 8a41dd20cb43b16548b49f9eff581dba0ed9a9a1
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:10:13 2012 -0700

Make channel_force_free() static
---
 src/or/channel.c |4 +++-
 src/or/channel.h |1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 2ca9a13..469dc5d 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -86,6 +86,8 @@ static ssize_t
 channel_flush_some_cells_from_outgoing_queue(channel_t *chan,
  ssize_t num_cells);
 
+static void channel_force_free(channel_t *chan);
+
 /***
  * Channel state utility functions *
  **/
@@ -753,7 +755,7 @@ channel_free(channel_t *chan)
  * it should only be used from channel_free_all() when shutting down.
  */
 
-void
+static void
 channel_force_free(channel_t *chan)
 {
   tor_assert(chan);
diff --git a/src/or/channel.h b/src/or/channel.h
index fbcd38d..fac2b3b 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -285,7 +285,6 @@ void channel_closed(channel_t *chan);
 
 /* Free a channel */
 void channel_free(channel_t *chan);
-void channel_force_free(channel_t *chan);
 
 /* State/metadata setters */
 



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


[tor-commits] [tor/master] Eliminate unnecessary channel_set_cell_handler(), channel_set_var_cell_handler() in channel.c

2012-10-10 Thread andrea
commit e877d02fdde73934e727346a9da11018681a4c14
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:06:40 2012 -0700

Eliminate unnecessary channel_set_cell_handler(), 
channel_set_var_cell_handler() in channel.c
---
 src/or/channel.c |   89 +-
 src/or/channel.h |5 ---
 2 files changed, 1 insertions(+), 93 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index b3ab2f0..f987cae 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -916,50 +916,7 @@ void
 }
 
 /**
- * Set the fixed-length cell handler for a channel
- *
- * This function sets the fixed-length cell handler for a channel and
- * processes any incoming cells that had been blocked in the queue because
- * none was available.
- *
- * @param chan Channel to set the fixed-length cell handler for
- * @param cell_handler Function pointer to new fixed-length cell handler
- */
-
-void
-channel_set_cell_handler(channel_t *chan,
- void (*cell_handler)(channel_t *, cell_t *))
-{
-  int changed = 0;
-
-  tor_assert(chan);
-  tor_assert(!(chan-is_listener));
-  tor_assert(chan-state == CHANNEL_STATE_OPENING ||
- chan-state == CHANNEL_STATE_OPEN ||
- chan-state == CHANNEL_STATE_MAINT);
-
-  log_debug(LD_CHANNEL,
-   Setting cell_handler callback for channel %p to %p,
-   chan, cell_handler);
-
-  /*
-   * Keep track whether we've changed it so we know if there's any point in
-   * re-running the queue.
-   */
-  if (cell_handler != chan-u.cell_chan.cell_handler) changed = 1;
-
-  /* Change it */
-  chan-u.cell_chan.cell_handler = cell_handler;
-
-  /* Re-run the queue if we have one and there's any reason to */
-  if (chan-u.cell_chan.cell_queue 
-  (smartlist_len(chan-u.cell_chan.cell_queue)  0) 
-  changed 
-  chan-u.cell_chan.cell_handler) channel_process_cells(chan);
-}
-
-/**
- * Set the both cell handlers for a channel
+ * Set both cell handlers for a channel
  *
  * This function sets both the fixed-length and variable length cell handlers
  * for a channel and processes any incoming cells that had been blocked in the
@@ -1011,50 +968,6 @@ channel_set_cell_handlers(channel_t *chan,
 }
 
 /**
- * Set the variable-length cell handler for a channel
- *
- * This function sets the variable-length cell handler for a channel and
- * processes any incoming cells that had been blocked in the queue because
- * none was available.
- *
- * @param chan Channel to set the variable-length cell handler for
- * @param cell_handler Function pointer to new variable-length cell handler
- */
-
-void
-channel_set_var_cell_handler(channel_t *chan,
- void (*var_cell_handler)(channel_t *,
-  var_cell_t *))
-{
-  int changed = 0;
-
-  tor_assert(chan);
-  tor_assert(!(chan-is_listener));
-  tor_assert(chan-state == CHANNEL_STATE_OPENING ||
- chan-state == CHANNEL_STATE_OPEN ||
- chan-state == CHANNEL_STATE_MAINT);
-
-  log_debug(LD_CHANNEL,
-   Setting var_cell_handler callback for channel %p to %p,
-   chan, var_cell_handler);
-
-  /*
-   * Keep track whether we've changed it so we know if there's any point in
-   * re-running the queue.
-   */
-  if (var_cell_handler != chan-u.cell_chan.var_cell_handler) changed = 1;
-
-  /* Change it */
-  chan-u.cell_chan.var_cell_handler = var_cell_handler;
-
-  /* Re-run the queue if we have one and there's any reason to */
-  if (chan-u.cell_chan.cell_queue 
-  (smartlist_len(chan-u.cell_chan.cell_queue)  0) 
-  changed  chan-u.cell_chan.var_cell_handler)
-channel_process_cells(chan);
-}
-
-/**
  * Request a channel be closed
  *
  * This function tries to close a channel_t; it will go into the CLOSING
diff --git a/src/or/channel.h b/src/or/channel.h
index 7075981..fbcd38d 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -247,15 +247,10 @@ void (* channel_get_cell_handler(channel_t *chan))
   (channel_t *, cell_t *);
 void (* channel_get_var_cell_handler(channel_t *chan))
   (channel_t *, var_cell_t *);
-void channel_set_cell_handler(channel_t *chan,
-  void (*cell_handler)(channel_t *, cell_t *));
 void channel_set_cell_handlers(channel_t *chan,
void (*cell_handler)(channel_t *, cell_t *),
void (*var_cell_handler)(channel_t *,
 var_cell_t *));
-void channel_set_var_cell_handler(channel_t *chan,
-  void (*var_cell_handler)(channel_t *,
-   var_cell_t *));
 
 /* Clean up closed channels periodically; called from run_scheduled_events()
  * in main.c



___
tor-commits mailing list
tor-commits@lists.torproject.org

[tor-commits] [tor/master] Remove orphaned comment in channel_flush_some_cells_from_outgoing_queue()

2012-10-10 Thread andrea
commit bb92a2d7a8560e7028faad024c3307080449aea4
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 19:54:47 2012 -0700

Remove orphaned comment in channel_flush_some_cells_from_outgoing_queue()
---
 src/or/channel.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index c5bf60d..114b5a8 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -1847,7 +1847,6 @@ channel_flush_some_cells_from_outgoing_queue(channel_t 
*chan,
 
   /* Get the head of the queue */
   q = smartlist_get(chan-u.cell_chan.outgoing_queue, 0);
-  /* That shouldn't happen; bail out */
   if (q) {
 /*
  * Okay, we have a good queue entry, try to give it to the lower



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


[tor-commits] [tor/master] Eliminate unnecessary SMARTLIST_DEL_CURRENT() invocations in channel.c, channeltls.c

2012-10-10 Thread andrea
commit 17356fe7fd96af9285f8f9507b111373fd6fb891
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:02:42 2012 -0700

Eliminate unnecessary SMARTLIST_DEL_CURRENT() invocations in channel.c, 
channeltls.c
---
 src/or/channel.c|   88 ++-
 src/or/channeltls.c |5 +--
 2 files changed, 32 insertions(+), 61 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 114b5a8..b3ab2f0 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -761,9 +761,6 @@ channel_free(channel_t *chan)
 void
 channel_force_free(channel_t *chan)
 {
-  cell_queue_entry_t *tmp = NULL;
-  channel_t *tmpchan = NULL;
-
   tor_assert(chan);
 
   /* Call a free method if there is one */
@@ -778,9 +775,7 @@ channel_force_free(channel_t *chan)
 if (chan-u.listener.incoming_list) {
   SMARTLIST_FOREACH_BEGIN(chan-u.listener.incoming_list,
   channel_t *, qchan) {
-tmpchan = qchan;
-SMARTLIST_DEL_CURRENT(chan-u.listener.incoming_list, qchan);
-channel_request_close(tmpchan);
+channel_request_close(qchan);
   } SMARTLIST_FOREACH_END(qchan);
 
   smartlist_free(chan-u.listener.incoming_list);
@@ -794,8 +789,6 @@ channel_force_free(channel_t *chan)
 if (chan-u.cell_chan.cell_queue) {
   SMARTLIST_FOREACH_BEGIN(chan-u.cell_chan.cell_queue,
   cell_queue_entry_t *, q) {
-tmp = q;
-SMARTLIST_DEL_CURRENT(chan-u.cell_chan.cell_queue, q);
 tor_free(q);
   } SMARTLIST_FOREACH_END(q);
 
@@ -807,14 +800,12 @@ channel_force_free(channel_t *chan)
 if (chan-u.cell_chan.outgoing_queue) {
   SMARTLIST_FOREACH_BEGIN(chan-u.cell_chan.outgoing_queue,
   cell_queue_entry_t *, q) {
-tmp = q;
-SMARTLIST_DEL_CURRENT(chan-u.cell_chan.outgoing_queue, q);
-if (tmp-type == CELL_QUEUE_PACKED) {
-  if (tmp-u.packed.packed_cell) {
-packed_cell_free(tmp-u.packed.packed_cell);
+if (q-type == CELL_QUEUE_PACKED) {
+  if (q-u.packed.packed_cell) {
+packed_cell_free(q-u.packed.packed_cell);
   }
 }
-tor_free(tmp);
+tor_free(q);
   } SMARTLIST_FOREACH_END(q);
 
   smartlist_free(chan-u.cell_chan.outgoing_queue);
@@ -2055,10 +2046,8 @@ channel_process_incoming(channel_t *listener)
 /* Make sure this is set correctly */
 channel_mark_incoming(chan);
 listener-u.listener.listener(listener, chan);
-SMARTLIST_DEL_CURRENT(listener-u.listener.incoming_list, chan);
   } SMARTLIST_FOREACH_END(chan);
 
-  tor_assert(smartlist_len(listener-u.listener.incoming_list) == 0);
   smartlist_free(listener-u.listener.incoming_list);
   listener-u.listener.incoming_list = NULL;
 }
@@ -2484,53 +2473,44 @@ channel_run_cleanup(void)
 void
 channel_free_all(void)
 {
-  channel_t *tmp = NULL;
-
   log_debug(LD_CHANNEL,
 Shutting down channels...);
 
   /* First, let's go for finished channels */
   if (finished_channels) {
 SMARTLIST_FOREACH_BEGIN(finished_channels, channel_t *, curr) {
-  tmp = curr;
-  /* Remove it from the list */
-  SMARTLIST_DEL_CURRENT(finished_channels, curr);
   /* Deregister and free it */
-  tor_assert(tmp);
+  tor_assert(curr);
   log_debug(LD_CHANNEL,
 Cleaning up finished channel %p (ID  U64_FORMAT ) 
 in state %s (%d),
-tmp, U64_PRINTF_ARG(tmp-global_identifier),
-channel_state_to_string(tmp-state), tmp-state);
-  channel_unregister(tmp);
-  channel_free(tmp);
+curr, U64_PRINTF_ARG(curr-global_identifier),
+channel_state_to_string(curr-state), curr-state);
+  channel_unregister(curr);
+  channel_free(curr);
 } SMARTLIST_FOREACH_END(curr);
 
 smartlist_free(finished_channels);
 finished_channels = NULL;
-tmp = NULL;
   }
 
   /* Now the listeners */
   if (listening_channels) {
 SMARTLIST_FOREACH_BEGIN(listening_channels, channel_t *, curr) {
-  tmp = curr;
-  /* Remove it from the list */
-  SMARTLIST_DEL_CURRENT(listening_channels, curr);
   /* Close, deregister and free it */
-  tor_assert(tmp);
+  tor_assert(curr);
   log_debug(LD_CHANNEL,
 Cleaning up listening channel %p (ID  U64_FORMAT ) 
 in state %s (%d),
-tmp, U64_PRINTF_ARG(tmp-global_identifier),
-channel_state_to_string(tmp-state), tmp-state);
+curr, U64_PRINTF_ARG(curr-global_identifier),
+channel_state_to_string(curr-state), curr-state);
   /*
* We have to unregister first so we don't put it in finished_channels
* and allocate that again on close.
*/
-  channel_unregister(tmp);
-  channel_request_close(tmp);
-  channel_force_free(tmp);
+  channel_unregister(curr);
+  

[tor-commits] [tor/master] s/channel_request_close()/channel_mark_for_close()/g for consistency

2012-10-10 Thread andrea
commit d61e58e1ba594c57afdb4bf49169f59b0a56a7f4
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:14:04 2012 -0700

s/channel_request_close()/channel_mark_for_close()/g for consistency
---
 src/or/channel.c|   12 ++--
 src/or/channel.h|2 +-
 src/or/channeltls.c |4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 469dc5d..5b40028 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -772,7 +772,7 @@ channel_force_free(channel_t *chan)
 if (chan-u.listener.incoming_list) {
   SMARTLIST_FOREACH_BEGIN(chan-u.listener.incoming_list,
   channel_t *, qchan) {
-channel_request_close(qchan);
+channel_mark_for_close(qchan);
   } SMARTLIST_FOREACH_END(qchan);
 
   smartlist_free(chan-u.listener.incoming_list);
@@ -965,7 +965,7 @@ channel_set_cell_handlers(channel_t *chan,
 }
 
 /**
- * Request a channel be closed
+ * Mark a channel to be closed
  *
  * This function tries to close a channel_t; it will go into the CLOSING
  * state, and eventually the lower layer should put it into the CLOSED or
@@ -975,7 +975,7 @@ channel_set_cell_handlers(channel_t *chan,
  */
 
 void
-channel_request_close(channel_t *chan)
+channel_mark_for_close(channel_t *chan)
 {
   tor_assert(chan != NULL);
   tor_assert(chan-close != NULL);
@@ -2419,7 +2419,7 @@ channel_free_all(void)
* and allocate that again on close.
*/
   channel_unregister(curr);
-  channel_request_close(curr);
+  channel_mark_for_close(curr);
   channel_force_free(curr);
 } SMARTLIST_FOREACH_END(curr);
 
@@ -2442,7 +2442,7 @@ channel_free_all(void)
* and allocate that again on close.
*/
   channel_unregister(curr);
-  channel_request_close(curr);
+  channel_mark_for_close(curr);
   channel_force_free(curr);
 } SMARTLIST_FOREACH_END(curr);
 
@@ -2464,7 +2464,7 @@ channel_free_all(void)
   if (!(curr-state == CHANNEL_STATE_CLOSING ||
 curr-state == CHANNEL_STATE_CLOSED ||
 curr-state == CHANNEL_STATE_ERROR)) {
-channel_request_close(curr);
+channel_mark_for_close(curr);
   }
   channel_force_free(curr);
 } SMARTLIST_FOREACH_END(curr);
diff --git a/src/or/channel.h b/src/or/channel.h
index fac2b3b..182639e 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -230,7 +230,7 @@ const char * channel_state_to_string(channel_state_t state);
 
 /* Abstract channel operations */
 
-void channel_request_close(channel_t *chan);
+void channel_mark_for_close(channel_t *chan);
 void channel_write_cell(channel_t *chan, cell_t *cell);
 void channel_write_packed_cell(channel_t *chan, packed_cell_t *cell);
 void channel_write_var_cell(channel_t *chan, var_cell_t *cell);
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 883aef1..bb6ef9b 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -224,7 +224,7 @@ channel_tls_free_all(void)
   if (channel_tls_listener) {
 base = TLS_CHAN_TO_BASE(channel_tls_listener);
 channel_unregister(base);
-channel_request_close(base);
+channel_mark_for_close(base);
 channel_free(base);
 channel_tls_listener = NULL;
   }
@@ -316,7 +316,7 @@ channel_tls_close_method(channel_t *chan)
 if (chan-u.listener.incoming_list) {
   SMARTLIST_FOREACH_BEGIN(chan-u.listener.incoming_list,
   channel_t *, ichan) {
-channel_request_close(ichan);
+channel_mark_for_close(ichan);
   } SMARTLIST_FOREACH_END(ichan);
 
   smartlist_free(chan-u.listener.incoming_list);



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


[tor-commits] [tor/master] Simplify channel_next_with_digest() in channel.c

2012-10-10 Thread andrea
commit 123a08e4a33f6750c3857c5c7ed3515bb196db53
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:08:18 2012 -0700

Simplify channel_next_with_digest() in channel.c
---
 src/or/channel.c |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index f987cae..2ca9a13 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -622,15 +622,10 @@ channel_find_by_remote_digest(const char *identity_digest)
 channel_t *
 channel_next_with_digest(channel_t *chan)
 {
-  channel_t *rv = NULL;
-
   tor_assert(chan);
   tor_assert(!(chan-is_listener));
 
-  if (chan-u.cell_chan.next_with_same_id)
-rv = chan-u.cell_chan.next_with_same_id;
-
-  return rv;
+  return chan-u.cell_chan.next_with_same_id;
 }
 
 /**



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


[tor-commits] [tor/master] Fix typo in comment

2012-10-10 Thread andrea
commit 4686638743919513baa72001d4676996f5e53c14
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:15:09 2012 -0700

Fix typo in comment
---
 src/or/channel.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/channel.h b/src/or/channel.h
index 182639e..8fb29d8 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -12,7 +12,7 @@
 #include or.h
 
 /*
- * Channel struct; see thw channel_t typedef in or.h.  A channel is an
+ * Channel struct; see the channel_t typedef in or.h.  A channel is an
  * abstract interface for the OR-to-OR connection, similar to connection_or_t,
  * but without the strong coupling to the underlying TLS implementation.  They
  * are constructed by calling a protocol-specific function to open a channel



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


[tor-commits] [tor/master] s/cell_queue/incoming_queue/g in channel.c for consistency with outgoing_queue

2012-10-10 Thread andrea
commit ee4e88e4d9891a24334870616067d21580f95704
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:20:28 2012 -0700

s/cell_queue/incoming_queue/g in channel.c for consistency with 
outgoing_queue
---
 src/or/channel.c |   66 +++---
 src/or/channel.h |2 +-
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 5b40028..cdb0830 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -783,14 +783,14 @@ channel_force_free(channel_t *chan)
 smartlist_free(chan-u.cell_chan.active_circuit_pqueue);
 
 /* We might still have a cell queue; kill it */
-if (chan-u.cell_chan.cell_queue) {
-  SMARTLIST_FOREACH_BEGIN(chan-u.cell_chan.cell_queue,
+if (chan-u.cell_chan.incoming_queue) {
+  SMARTLIST_FOREACH_BEGIN(chan-u.cell_chan.incoming_queue,
   cell_queue_entry_t *, q) {
 tor_free(q);
   } SMARTLIST_FOREACH_END(q);
 
-  smartlist_free(chan-u.cell_chan.cell_queue);
-  chan-u.cell_chan.cell_queue = NULL;
+  smartlist_free(chan-u.cell_chan.incoming_queue);
+  chan-u.cell_chan.incoming_queue = NULL;
 }
 
 /* Outgoing cell queue is similar, but we can have to free packed cells */
@@ -957,8 +957,8 @@ channel_set_cell_handlers(channel_t *chan,
   chan-u.cell_chan.var_cell_handler = var_cell_handler;
 
   /* Re-run the queue if we have one and there's any reason to */
-  if (chan-u.cell_chan.cell_queue 
-  (smartlist_len(chan-u.cell_chan.cell_queue)  0) 
+  if (chan-u.cell_chan.incoming_queue 
+  (smartlist_len(chan-u.cell_chan.incoming_queue)  0) 
   try_again 
   (chan-u.cell_chan.cell_handler ||
chan-u.cell_chan.var_cell_handler)) channel_process_cells(chan);
@@ -1633,8 +1633,8 @@ channel_change_state(channel_t *chan, channel_state_t 
to_state)
   if (!(chan-is_listener) 
   to_state == CHANNEL_STATE_OPEN) {
 /* Check for queued cells to process */
-if (chan-u.cell_chan.cell_queue 
-smartlist_len(chan-u.cell_chan.cell_queue)  0)
+if (chan-u.cell_chan.incoming_queue 
+smartlist_len(chan-u.cell_chan.incoming_queue)  0)
   channel_process_cells(chan);
 if (chan-u.cell_chan.outgoing_queue 
 smartlist_len(chan-u.cell_chan.outgoing_queue)  0)
@@ -1646,8 +1646,8 @@ channel_change_state(channel_t *chan, channel_state_t 
to_state)
   tor_assert(!(chan-u.listener.incoming_list) ||
   smartlist_len(chan-u.listener.incoming_list) == 0);
 } else {
-  tor_assert(!(chan-u.cell_chan.cell_queue) ||
-  smartlist_len(chan-u.cell_chan.cell_queue) == 0);
+  tor_assert(!(chan-u.cell_chan.incoming_queue) ||
+  smartlist_len(chan-u.cell_chan.incoming_queue) == 0);
   tor_assert(!(chan-u.cell_chan.outgoing_queue) ||
   smartlist_len(chan-u.cell_chan.outgoing_queue) == 0);
 }
@@ -1881,8 +1881,8 @@ channel_more_to_flush(channel_t *chan)
   tor_assert(!(chan-is_listener));
 
   /* Check if we have any queued */
-  if (chan-u.cell_chan.cell_queue 
-  smartlist_len(chan-u.cell_chan.cell_queue)  0) return 1;
+  if (chan-u.cell_chan.incoming_queue 
+  smartlist_len(chan-u.cell_chan.incoming_queue)  0) return 1;
 
   /* Check if any circuits would like to queue some */
   if (chan-u.cell_chan.active_circuits) return 1;
@@ -2108,13 +2108,13 @@ channel_process_cells(channel_t *chan)
   if (!(chan-u.cell_chan.cell_handler ||
 chan-u.cell_chan.var_cell_handler)) return;
   /* Nothing we can do if we have no cells */
-  if (!(chan-u.cell_chan.cell_queue)) return;
+  if (!(chan-u.cell_chan.incoming_queue)) return;
 
   /*
* Process cells until we're done or find one we have no current handler
* for.
*/
-  SMARTLIST_FOREACH_BEGIN(chan-u.cell_chan.cell_queue,
+  SMARTLIST_FOREACH_BEGIN(chan-u.cell_chan.incoming_queue,
   cell_queue_entry_t *, q) {
 tor_assert(q);
 tor_assert(q-type == CELL_QUEUE_FIXED ||
@@ -2128,7 +2128,7 @@ channel_process_cells(channel_t *chan)
 Processing incoming cell_t %p for channel %p,
 q-u.fixed.cell, chan);
   chan-u.cell_chan.cell_handler(chan, q-u.fixed.cell);
-  SMARTLIST_DEL_CURRENT(chan-u.cell_chan.cell_queue, q);
+  SMARTLIST_DEL_CURRENT(chan-u.cell_chan.incoming_queue, q);
   tor_free(q);
 } else if (q-type == CELL_QUEUE_VAR 
chan-u.cell_chan.var_cell_handler) {
@@ -2138,7 +2138,7 @@ channel_process_cells(channel_t *chan)
 Processing incoming var_cell_t %p for channel %p,
 q-u.var.var_cell, chan);
   chan-u.cell_chan.var_cell_handler(chan, q-u.var.var_cell);
-  SMARTLIST_DEL_CURRENT(chan-u.cell_chan.cell_queue, q);
+  SMARTLIST_DEL_CURRENT(chan-u.cell_chan.incoming_queue, q);
   tor_free(q);
 } else {
   /* Can't handle this one */
@@ -2147,9 +2147,9 @@ 

[tor-commits] [tor/master] Use typedefs for function pointer return values and s/listener/listener_fn/ for distinctness

2012-10-10 Thread andrea
commit 89a00ee63ae61e707343432dd9f74702cf60ac3c
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 20:49:19 2012 -0700

Use typedefs for function pointer return values and s/listener/listener_fn/ 
for distinctness
---
 src/or/channel.c |   25 +++--
 src/or/channel.h |   32 +++-
 src/or/command.c |2 +-
 3 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index cdb0830..9fbfecb 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -823,9 +823,8 @@ channel_force_free(channel_t *chan)
  * @return Function pointer to an incoming channel handler
  */
 
-void
-(* channel_get_listener(channel_t *chan))
-  (channel_t *, channel_t *)
+channel_listener_fn_ptr
+channel_get_listener_fn(channel_t *chan)
 {
   tor_assert(chan);
   tor_assert(chan-is_listener);
@@ -847,8 +846,8 @@ void
  */
 
 void
-channel_set_listener(channel_t *chan,
- void (*listener)(channel_t *, channel_t *) )
+channel_set_listener_fn(channel_t *chan,
+channel_listener_fn_ptr listener)
 {
   tor_assert(chan);
   tor_assert(chan-is_listener);
@@ -872,9 +871,8 @@ channel_set_listener(channel_t *chan,
  * @return A function pointer to chan's fixed-length cell handler, if any.
  */
 
-void
-(* channel_get_cell_handler(channel_t *chan))
-  (channel_t *, cell_t *)
+channel_cell_handler_fn_ptr
+channel_get_cell_handler(channel_t *chan)
 {
   tor_assert(chan);
   tor_assert(!(chan-is_listener));
@@ -897,9 +895,8 @@ void
  * @return A function pointer to chan's variable-length cell handler, if any.
  */
 
-void
-(* channel_get_var_cell_handler(channel_t *chan))
-  (channel_t *, var_cell_t *)
+channel_var_cell_handler_fn_ptr
+channel_get_var_cell_handler(channel_t *chan)
 {
   tor_assert(chan);
   tor_assert(!(chan-is_listener));
@@ -927,9 +924,9 @@ void
 
 void
 channel_set_cell_handlers(channel_t *chan,
-  void (*cell_handler)(channel_t *, cell_t *),
-  void (*var_cell_handler)(channel_t *,
-   var_cell_t *))
+  channel_cell_handler_fn_ptr cell_handler,
+  channel_var_cell_handler_fn_ptr
+var_cell_handler)
 {
   int try_again = 0;
 
diff --git a/src/or/channel.h b/src/or/channel.h
index 696ae07..70ea30f 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -11,6 +11,11 @@
 
 #include or.h
 
+/* Channel handler function pointer typedefs */
+typedef void (*channel_listener_fn_ptr)(channel_t *, channel_t *);
+typedef void (*channel_cell_handler_fn_ptr)(channel_t *, cell_t *);
+typedef void (*channel_var_cell_handler_fn_ptr)(channel_t *, var_cell_t *);
+
 /*
  * Channel struct; see the channel_t typedef in or.h.  A channel is an
  * abstract interface for the OR-to-OR connection, similar to connection_or_t,
@@ -65,7 +70,7 @@ struct channel_s {
   union {
 struct {
   /* Registered listen handler to call on incoming connection */
-  void (*listener)(channel_t *, channel_t *);
+  channel_listener_fn_ptr listener;
 
   /* List of pending incoming connections */
   smartlist_t *incoming_list;
@@ -78,8 +83,8 @@ struct channel_s {
 } listener;
 struct {
   /* Registered handlers for incoming cells */
-  void (*cell_handler)(channel_t *, cell_t *);
-  void (*var_cell_handler)(channel_t *, var_cell_t *);
+  channel_cell_handler_fn_ptr cell_handler;
+  channel_var_cell_handler_fn_ptr var_cell_handler;
 
   /* Methods implemented by the lower layer */
 
@@ -238,19 +243,20 @@ void channel_write_var_cell(channel_t *chan, var_cell_t 
*cell);
 /* Channel callback registrations */
 
 /* Listener callback */
-void (* channel_get_listener(channel_t *chan))(channel_t *, channel_t *);
-void channel_set_listener(channel_t *chan,
-  void (*listener)(channel_t *, channel_t *) );
+channel_listener_fn_ptr channel_get_listener_fn(channel_t *chan);
+void channel_set_listener_fn(channel_t *chan,
+ channel_listener_fn_ptr listener);
 
 /* Incoming cell callbacks */
-void (* channel_get_cell_handler(channel_t *chan))
-  (channel_t *, cell_t *);
-void (* channel_get_var_cell_handler(channel_t *chan))
-  (channel_t *, var_cell_t *);
+channel_cell_handler_fn_ptr channel_get_cell_handler(channel_t *chan);
+
+channel_var_cell_handler_fn_ptr
+channel_get_var_cell_handler(channel_t *chan);
+
 void channel_set_cell_handlers(channel_t *chan,
-   void (*cell_handler)(channel_t *, cell_t *),
-   void (*var_cell_handler)(channel_t *,
-var_cell_t *));
+   channel_cell_handler_fn_ptr cell_handler,
+   channel_var_cell_handler_fn_ptr
+ var_cell_handler);
 
 /* Clean up 

[tor-commits] [tor/master] Set reason_for_closing when erroring out of channel_tls_connect()

2012-10-10 Thread andrea
commit 53454fad956c278921487a9956aa9f022b9cc2c7
Author: Andrea Shepard and...@torproject.org
Date:   Tue Oct 9 10:51:10 2012 -0700

Set reason_for_closing when erroring out of channel_tls_connect()
---
 src/or/channeltls.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 93e0636..339663e 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -133,6 +133,7 @@ channel_tls_connect(const tor_addr_t *addr, uint16_t port,
   tlschan-conn = connection_or_connect(addr, port, id_digest, tlschan);
   /* connection_or_connect() will fill in tlschan-conn */
   if (!(tlschan-conn)) {
+chan-reason_for_closing = CHANNEL_CLOSE_FOR_ERROR;
 channel_change_state(chan, CHANNEL_STATE_ERROR);
 goto err;
   }



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


[tor-commits] [tor/master] Conform to existing Doxygen style

2012-10-10 Thread andrea
commit 6391f963fb1ff9988d048397cd054b65ff5a52ff
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 21:30:07 2012 -0700

Conform to existing Doxygen style
---
 src/or/channel.c|  265 +++---
 src/or/channeltls.c |   98 +--
 2 files changed, 18 insertions(+), 345 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index fac4017..57b9e4f 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -97,9 +97,6 @@ channel_write_cell_queue_entry(channel_t *chan, 
cell_queue_entry_t *q);
 
 /**
  * Indicate whether a given channel state is valid
- *
- * @param state A channel state
- * @return A boolean value indicating whether state is a valid channel state
  */
 
 int
@@ -131,10 +128,6 @@ channel_state_is_valid(channel_state_t state)
  * This function takes two channel states and indicates whether a
  * transition between them is permitted (see the state definitions and
  * transition table in or.h at the channel_state_t typedef).
- *
- * @param from Proposed state to transition from
- * @param to Proposed state to transition to
- * @return A boolean value indicating whether the posposed transition is valid
  */
 
 int
@@ -183,9 +176,6 @@ channel_state_can_transition(channel_state_t from, 
channel_state_t to)
 
 /**
  * Return a human-readable description for a channel state
- *
- * @param state A channel state
- * @return A pointer to a string with a human-readable description of state
  */
 
 const char *
@@ -232,8 +222,6 @@ channel_state_to_string(channel_state_t state)
  *
  * This function registers a newly created channel in the global lists/maps
  * of active channels.
- *
- * @param chan A pointer to an unregistered channel
  */
 
 void
@@ -306,8 +294,6 @@ channel_register(channel_t *chan)
  *
  * This function removes a channel from the global lists and maps and is used
  * when freeing a closed/errored channel.
- *
- * @param chan A pointer to a channel to be unregistered
  */
 
 void
@@ -363,8 +349,6 @@ channel_unregister(channel_t *chan)
  * This function adds a channel to the digest map and inserts it into the
  * correct linked list if channels with that remote endpoint identity digest
  * already exist.
- *
- * @param chan A pointer to a channel to add
  */
 
 static void
@@ -416,8 +400,6 @@ channel_add_to_digest_map(channel_t *chan)
  *
  * This function removes a channel from the digest map and the linked list of
  * channels for that digest if more than one exists.
- *
- * @param chan A pointer to a channel to remove
  */
 
 static void
@@ -563,10 +545,6 @@ channel_remove_from_digest_map(channel_t *chan)
  * This function searches for a channel by the global_identifier assigned
  * at initialization time.  This identifier is unique for the lifetime of the
  * Tor process.
- *
- * @param global_identifier The global_identifier value to search for
- * @return A pointer to the channel with that global identifier, or NULL if
- * none exists.
  */
 
 channel_t *
@@ -593,9 +571,6 @@ channel_find_by_global_id(uint64_t global_identifier)
  * the channel digest map.  It's possible that more than one channel to a
  * given endpoint exists.  Use channel_next_with_digest() and
  * channel_prev_with_digest() to walk the list.
- *
- * @param identity_digest A digest to search for
- * @return A channel pointer, or NULL if no channel to this endpoint exists.
  */
 
 channel_t *
@@ -614,14 +589,10 @@ channel_find_by_remote_digest(const char *identity_digest)
 }
 
 /**
- * Next channel with digest
+ * Get next channel with digest
  *
  * This function takes a channel and finds the next channel in the list
  * with the same digest.
- *
- * @param chan Channel pointer to iterate
- * @return A pointer to the next channel after chan with the same remote
- * endpoint identity digest, or NULL if none exists.
  */
 
 channel_t *
@@ -634,14 +605,10 @@ channel_next_with_digest(channel_t *chan)
 }
 
 /**
- * Previous channel with digest
+ * Get previous channel with digest
  *
  * This function takes a channel and finds the previos channel in the list
  * with the same digest.
- *
- * @param chan Channel pointer to iterate
- * @return A pointer to the previous channel after chan with the same remote
- * endpoint identity digest, or NULL if none exists.
  */
 
 channel_t *
@@ -659,13 +626,11 @@ channel_prev_with_digest(channel_t *chan)
 }
 
 /**
- * Internal-only channel init function for cell channels
+ * Initialize a cell channel
  *
  * This function should be called by subclasses to set up some per-channel
  * variables.  I.e., this is the superclass constructor.  Before this, the
  * channel should be allocated with tor_malloc_zero().
- *
- * @param chan Pointer to a channel to initialize.
  */
 
 void
@@ -690,13 +655,11 @@ channel_init_for_cells(channel_t *chan)
 }
 
 /**
- * Internal-only channel init function for listener channels
+ * Initialize a listener channel
  *
  * This function should be called by 

[tor-commits] [tor/master] Refactor channel_write_cell()/channel_write_packed_cell()/channel_write_var_cell() to eliminate redundant code

2012-10-10 Thread andrea
commit 06a76d1db49d7c9c386368583928cde11b509519
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 8 21:16:59 2012 -0700

Refactor 
channel_write_cell()/channel_write_packed_cell()/channel_write_var_cell() to 
eliminate redundant code
---
 src/or/channel.c |  217 ++---
 1 files changed, 106 insertions(+), 111 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 9fbfecb..fac4017 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -74,6 +74,8 @@ static uint64_t n_channels_allocated = 0;
  */
 static digestmap_t *channel_identity_map = NULL;
 
+static int cell_queue_entry_is_padding(cell_queue_entry_t *q);
+
 /* Functions to maintain the digest map */
 static void channel_add_to_digest_map(channel_t *chan);
 static void channel_remove_from_digest_map(channel_t *chan);
@@ -85,8 +87,9 @@ static void channel_remove_from_digest_map(channel_t *chan);
 static ssize_t
 channel_flush_some_cells_from_outgoing_queue(channel_t *chan,
  ssize_t num_cells);
-
 static void channel_force_free(channel_t *chan);
+static void
+channel_write_cell_queue_entry(channel_t *chan, cell_queue_entry_t *q);
 
 /***
  * Channel state utility functions *
@@ -1308,39 +1311,56 @@ channel_set_remote_end(channel_t *chan,
 }
 
 /**
- * Write a cell to a channel
- *
- * Write a fixed-length cell to a channel using the write_cell() method.
- * This is equivalent to the pre-channels connection_or_write_cell_to_buf().
- *
- * @param chan Channel to write a cell to
- * @param cell Cell to write to chan
+ * Check whether a cell queue entry is padding; this is a helper function
+ * for channel_write_cell_queue_entry()
  */
 
-void
-channel_write_cell(channel_t *chan, cell_t *cell)
+static int
+cell_queue_entry_is_padding(cell_queue_entry_t *q)
 {
-  cell_queue_entry_t *q;
-  int sent = 0;
+  tor_assert(q);
+
+  if (q-type == CELL_QUEUE_FIXED) {
+if (q-u.fixed.cell) {
+  if (q-u.fixed.cell-command == CELL_PADDING ||
+  q-u.fixed.cell-command == CELL_VPADDING) {
+return 1;
+  }
+}
+  } else if (q-type == CELL_QUEUE_VAR) {
+if (q-u.var.var_cell) {
+  if (q-u.var.var_cell-command == CELL_PADDING ||
+  q-u.var.var_cell-command == CELL_VPADDING) {
+return 1;
+  }
+}
+  }
+
+  return 0;
+}
+
+/**
+ * Given a cell_queue_entry_t filled out by the caller, try to send the cell
+ * and queue it if we can't.
+ */
+
+static void
+channel_write_cell_queue_entry(channel_t *chan, cell_queue_entry_t *q)
+{
+  int result = 0, sent = 0;
+  cell_queue_entry_t *tmp = NULL;
 
   tor_assert(chan);
   tor_assert(!(chan-is_listener));
-  tor_assert(cell);
-  tor_assert(chan-u.cell_chan.write_cell);
+  tor_assert(q);
 
   /* Assert that the state makes sense for a cell write */
   tor_assert(chan-state == CHANNEL_STATE_OPENING ||
  chan-state == CHANNEL_STATE_OPEN ||
  chan-state == CHANNEL_STATE_MAINT);
 
-  log_debug(LD_CHANNEL,
-Writing cell_t %p to channel %p with global ID 
-U64_FORMAT,
-cell, chan, U64_PRINTF_ARG(chan-global_identifier));
-
   /* Increment the timestamp unless it's padding */
-  if (!(cell-command == CELL_PADDING ||
-cell-command == CELL_VPADDING)) {
+  if (!cell_queue_entry_is_padding(q)) {
 chan-u.cell_chan.timestamp_last_added_nonpadding = approx_time();
   }
 
@@ -1348,7 +1368,31 @@ channel_write_cell(channel_t *chan, cell_t *cell)
   if (!(chan-u.cell_chan.outgoing_queue 
 (smartlist_len(chan-u.cell_chan.outgoing_queue)  0)) 
chan-state == CHANNEL_STATE_OPEN) {
-if (chan-u.cell_chan.write_cell(chan, cell)) {
+/* Pick the right write function for this cell type and save the result */
+switch (q-type) {
+  case CELL_QUEUE_FIXED:
+tor_assert(chan-u.cell_chan.write_cell);
+tor_assert(q-u.fixed.cell);
+result = chan-u.cell_chan.write_cell(chan, q-u.fixed.cell);
+break;
+  case CELL_QUEUE_PACKED:
+tor_assert(chan-u.cell_chan.write_packed_cell);
+tor_assert(q-u.packed.packed_cell);
+result = chan-
+  u.cell_chan.write_packed_cell(chan,
+q-u.packed.packed_cell);
+break;
+  case CELL_QUEUE_VAR:
+tor_assert(chan-u.cell_chan.write_var_cell);
+tor_assert(q-u.var.var_cell);
+result = chan-u.cell_chan.write_var_cell(chan, q-u.var.var_cell);
+break;
+  default:
+tor_assert(1);
+}
+
+/* Check if we got it out */
+if (result  0) {
   sent = 1;
   /* Timestamp for transmission */
   channel_timestamp_xmit(chan);
@@ -1363,39 +1407,56 @@ channel_write_cell(channel_t *chan, cell_t *cell)
 /* Not sent, queue it */
 if (!(chan-u.cell_chan.outgoing_queue))
   chan-u.cell_chan.outgoing_queue = smartlist_new();
-q = tor_malloc(sizeof(*q));
-q-type = 

[tor-commits] [tor/master] Add magic number for type-checking channel casts

2012-10-10 Thread andrea
commit bddfb9ffa85a0fe73545fb231a0847c4101758c1
Author: Andrea Shepard and...@torproject.org
Date:   Tue Oct 9 14:16:51 2012 -0700

Add magic number for type-checking channel casts
---
 src/or/channel.h|3 +++
 src/or/channeltls.c |   37 +++--
 src/or/channeltls.h |   11 +--
 3 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/src/or/channel.h b/src/or/channel.h
index c31806c..27fba8f 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -26,6 +26,9 @@ typedef void (*channel_var_cell_handler_fn_ptr)(channel_t *, 
var_cell_t *);
  */
 
 struct channel_s {
+  /* Magic number for type-checking cast macros */
+  uint32_t magic;
+
   /* Current channel state */
   channel_state_t state;
 
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 339663e..5d6a7a9 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -102,8 +102,9 @@ channel_tls_connect(const tor_addr_t *addr, uint16_t port,
 const char *id_digest)
 {
   channel_tls_t *tlschan = tor_malloc_zero(sizeof(*tlschan));
-  channel_t *chan = TLS_CHAN_TO_BASE(tlschan);
+  channel_t *chan = (tlschan-_base);
   channel_init(chan);
+  chan-magic = TLS_CHAN_MAGIC;
   chan-state = CHANNEL_STATE_OPENING;
   chan-close = channel_tls_close_method;
   chan-describe_transport = channel_tls_describe_transport_method;
@@ -233,12 +234,13 @@ channel_t *
 channel_tls_handle_incoming(or_connection_t *orconn)
 {
   channel_tls_t *tlschan = tor_malloc_zero(sizeof(*tlschan));
-  channel_t *chan = TLS_CHAN_TO_BASE(tlschan);
+  channel_t *chan = (tlschan-_base);
 
   tor_assert(orconn);
   tor_assert(!(orconn-chan));
 
   channel_init(chan);
+  chan-magic = TLS_CHAN_MAGIC;
   chan-state = CHANNEL_STATE_OPENING;
   chan-close = channel_tls_close_method;
   chan-describe_transport = channel_tls_describe_transport_method;
@@ -267,6 +269,37 @@ channel_tls_handle_incoming(or_connection_t *orconn)
   return chan;
 }
 
+/*
+ * Casts *
+ /
+
+/**
+ * Cast a channel_tls_t to a channel_t.
+ */
+
+channel_t *
+channel_tls_to_base(channel_tls_t *tlschan)
+{
+  if (!tlschan) return NULL;
+
+  return (tlschan-_base);
+}
+
+/**
+ * Cast a channel_t to a channel_tls_t, with appropriate type-checking
+ * asserts.
+ */
+
+channel_tls_t *
+channel_tls_from_base(channel_t *chan)
+{
+  if (!chan) return NULL;
+
+  tor_assert(chan-magic == TLS_CHAN_MAGIC);
+
+  return (channel_tls_t *)(chan);
+}
+
 /
  * Method implementations for channel_tls_t *
  ***/
diff --git a/src/or/channeltls.h b/src/or/channeltls.h
index b38e12a..ca2fc88 100644
--- a/src/or/channeltls.h
+++ b/src/or/channeltls.h
@@ -12,8 +12,10 @@
 #include or.h
 #include channel.h
 
-#define BASE_CHAN_TO_TLS(c) ((channel_tls_t *)(c))
-#define TLS_CHAN_TO_BASE(c) ((channel_t *)(c))
+#define BASE_CHAN_TO_TLS(c) (channel_tls_from_base((c)))
+#define TLS_CHAN_TO_BASE(c) (channel_tls_to_base((c)))
+
+#define TLS_CHAN_MAGIC 0x8a192427U
 
 #ifdef _TOR_CHANNEL_INTERNAL
 
@@ -32,6 +34,11 @@ channel_listener_t * channel_tls_get_listener(void);
 channel_listener_t * channel_tls_start_listener(void);
 channel_t * channel_tls_handle_incoming(or_connection_t *orconn);
 
+/* Casts */
+
+channel_t * channel_tls_to_base(channel_tls_t *tlschan);
+channel_tls_t * channel_tls_from_base(channel_t *chan);
+
 /* Things for connection_or.c to call back into */
 ssize_t channel_tls_flush_some_cells(channel_tls_t *chan, ssize_t num_cells);
 int channel_tls_more_to_flush(channel_tls_t *chan);



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


[tor-commits] [tor/master] Use circuitmux_t in channels and when relaying cells

2012-10-10 Thread andrea
commit b208539b8047a12fb2f1f794c9932fddd577dfdb
Author: Andrea Shepard and...@torproject.org
Date:   Fri Sep 21 14:46:22 2012 -0700

Use circuitmux_t in channels and when relaying cells
---
 src/or/channel.c   |   49 ++---
 src/or/channel.h   |   33 ++-
 src/or/channeltls.c|   17 ++-
 src/or/circuitlist.c   |   38 ++-
 src/or/connection_or.c |2 +-
 src/or/or.h|   42 ++--
 src/or/relay.c |  283 +++-
 src/or/relay.h |7 +-
 8 files changed, 258 insertions(+), 213 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 334f843..8241556 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -19,6 +19,7 @@
 #include circuitbuild.h
 #include circuitlist.h
 #include connection_or.h /* For var_cell_free() */
+#include circuitmux.h
 #include geoip.h
 #include nodelist.h
 #include relay.h
@@ -813,9 +814,10 @@ channel_free(channel_t *chan)
 
   channel_clear_remote_end(chan);
 
-  if (chan-active_circuit_pqueue) {
-smartlist_free(chan-active_circuit_pqueue);
-chan-active_circuit_pqueue = NULL;
+  if (chan-cmux) {
+circuitmux_detach_all_circuits(chan-cmux);
+circuitmux_free(chan-cmux);
+chan-cmux = NULL;
   }
 
   /* We're in CLOSED or ERROR, so the cell queue is already empty */
@@ -866,7 +868,6 @@ channel_force_free(channel_t *chan)
   if (chan-free) chan-free(chan);
 
   channel_clear_remote_end(chan);
-  smartlist_free(chan-active_circuit_pqueue);
 
   /* We might still have a cell queue; kill it */
   if (chan-incoming_queue) {
@@ -2031,12 +2032,13 @@ channel_flush_some_cells(channel_t *chan, ssize_t 
num_cells)
 (unlimited ? -1 : num_cells - flushed));
 if (!unlimited  num_cells = flushed) goto done;
 
-if (chan-active_circuits) {
+if (circuitmux_num_cells(chan-cmux)  0) {
   /* Try to get more cells from any active circuits */
-  num_cells_from_circs =
-channel_flush_from_first_active_circuit(chan,
-(unlimited ? MAX_CELLS_TO_GET_FROM_CIRCUITS_FOR_UNLIMITED :
- (num_cells - flushed)));
+  num_cells_from_circs = channel_flush_from_first_active_circuit(
+  chan,
+  (unlimited ?
+ MAX_CELLS_TO_GET_FROM_CIRCUITS_FOR_UNLIMITED :
+ (num_cells - flushed)));
 
   /* If it claims we got some, process the queue again */
   if (num_cells_from_circs  0) {
@@ -2227,7 +2229,7 @@ channel_more_to_flush(channel_t *chan)
   smartlist_len(chan-incoming_queue)  0) return 1;
 
   /* Check if any circuits would like to queue some */
-  if (chan-active_circuits) return 1;
+  if (circuitmux_num_cells(chan-cmux)  0) return 1;
 
   /* Else no */
   return 0;
@@ -2935,8 +2937,8 @@ channel_is_better(time_t now, channel_t *a, channel_t *b,
* one that has no circuits is in its grace period.
*/
 
-  a_has_circs = (a-n_circuits  0);
-  b_has_circs = (b-n_circuits  0);
+  a_has_circs = (channel_num_circuits(a)  0);
+  b_has_circs = (channel_num_circuits(b)  0);
   a_grace = (forgive_new_connections 
  (now  channel_when_created(a) + NEW_CHAN_GRACE_PERIOD));
   b_grace = (forgive_new_connections 
@@ -3223,9 +3225,10 @@ channel_dump_statistics(channel_t *chan, int severity)
* Channel  U64_FORMAT  has %d active circuits out of
%d in total,
   U64_PRINTF_ARG(chan-global_identifier),
-  (chan-active_circuit_pqueue != NULL) ?
-smartlist_len(chan-active_circuit_pqueue) : 0,
-  chan-n_circuits);
+  (chan-cmux != NULL) ?
+ circuitmux_num_active_circuits(chan-cmux) : 0,
+  (chan-cmux != NULL) ?
+ circuitmux_num_circuits(chan-cmux) : 0);
 
   /* Describe timestamps */
   log(severity, LD_GENERAL,
@@ -4008,6 +4011,22 @@ channel_matches_target_addr_for_extend(channel_t *chan,
 }
 
 /**
+ * Return the total number of circuits used by a channel
+ *
+ * @param chan Channel to query
+ * @return Number of circuits using this as n_chan or p_chan
+ */
+
+unsigned int
+channel_num_circuits(channel_t *chan)
+{
+  tor_assert(chan);
+
+  return chan-num_n_circuits +
+ chan-num_p_circuits;
+}
+
+/**
  * Set up circuit ID generation
  *
  * This is called when setting up a channel and replaces the old
diff --git a/src/or/channel.h b/src/or/channel.h
index 27fba8f..4d3db41 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -10,6 +10,7 @@
 #define _TOR_CHANNEL_H
 
 #include or.h
+#include circuitmux.h
 
 /* Channel handler function pointer typedefs */
 typedef void (*channel_listener_fn_ptr)(channel_listener_t *, channel_t *);
@@ -99,7 +100,7 @@ struct channel_s {
   int (*matches_target)(channel_t *, const tor_addr_t *);
   /* Write a cell to an open channel */
   int (*write_cell)(channel_t *, cell_t *);
-  /* Write a packed cell to an open channel */
+   /* Write a packed cell to an open channel */
   int (*write_packed_cell)(channel_t *, packed_cell_t *);
   /* Write a variable-length cell to an open channel 

[tor-commits] [tor/master] Use cell_queue_entry_new/free() functions in channel.c

2012-10-10 Thread andrea
commit 1c3362dcdcf39f4b9da8c71567412349d111d08f
Author: Andrea Shepard and...@torproject.org
Date:   Tue Oct 9 11:35:08 2012 -0700

Use cell_queue_entry_new/free() functions in channel.c
---
 src/or/channel.c |  157 ++
 1 files changed, 135 insertions(+), 22 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 278daa6..e87f4de 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -18,6 +18,7 @@
 #include channeltls.h
 #include circuitbuild.h
 #include circuitlist.h
+#include connection_or.h /* For var_cell_free() */
 #include geoip.h
 #include nodelist.h
 #include relay.h
@@ -80,7 +81,13 @@ static uint64_t n_channels_allocated = 0;
  */
 static digestmap_t *channel_identity_map = NULL;
 
+static cell_queue_entry_t * cell_queue_entry_dup(cell_queue_entry_t *q);
+static void cell_queue_entry_free(cell_queue_entry_t *q, int handed_off);
 static int cell_queue_entry_is_padding(cell_queue_entry_t *q);
+static cell_queue_entry_t *
+cell_queue_entry_new_fixed(cell_t *cell);
+static cell_queue_entry_t *
+cell_queue_entry_new_var(var_cell_t *var_cell);
 
 /* Functions to maintain the digest map */
 static void channel_add_to_digest_map(channel_t *chan);
@@ -865,7 +872,7 @@ channel_force_free(channel_t *chan)
   if (chan-incoming_queue) {
 SMARTLIST_FOREACH_BEGIN(chan-incoming_queue,
 cell_queue_entry_t *, q) {
-  tor_free(q);
+  cell_queue_entry_free(q, 0);
 } SMARTLIST_FOREACH_END(q);
 
 smartlist_free(chan-incoming_queue);
@@ -876,12 +883,7 @@ channel_force_free(channel_t *chan)
   if (chan-outgoing_queue) {
 SMARTLIST_FOREACH_BEGIN(chan-outgoing_queue,
 cell_queue_entry_t *, q) {
-  if (q-type == CELL_QUEUE_PACKED) {
-if (q-u.packed.packed_cell) {
-  packed_cell_free(q-u.packed.packed_cell);
-}
-  }
-  tor_free(q);
+  cell_queue_entry_free(q, 0);
 } SMARTLIST_FOREACH_END(q);
 
 smartlist_free(chan-outgoing_queue);
@@ -1502,6 +1504,79 @@ channel_set_remote_end(channel_t *chan,
 }
 
 /**
+ * Duplicate a cell queue entry; this is a shallow copy intended for use
+ * in channel_write_cell_queue_entry().
+ */
+
+static cell_queue_entry_t *
+cell_queue_entry_dup(cell_queue_entry_t *q)
+{
+  cell_queue_entry_t *rv = NULL;
+
+  tor_assert(q);
+
+  rv = tor_malloc(sizeof(*rv));
+  memcpy(rv, q, sizeof(*rv));
+  
+  return rv;
+}
+
+/**
+ * Free a cell_queue_entry_t; the handed_off parameter indicates whether
+ * the contents were passed to the lower layer (it is responsible for
+ * them) or not (we should free).
+ */
+
+static void
+cell_queue_entry_free(cell_queue_entry_t *q, int handed_off) {
+  if (!q) return;
+
+  if (!handed_off) {
+/*
+ * If we handed it off, the recipient becomes responsible (or
+ * with packed cells the channel_t subclass calls packed_cell
+ * free after writing out its contents; see, e.g.,
+ * channel_tls_write_packed_cell_method().  Otherwise, we have
+ * to take care of it here if possible.
+ */
+switch (q-type) {
+  case CELL_QUEUE_FIXED:
+if (q-u.fixed.cell) {
+  /*
+   * There doesn't seem to be a cell_free() function anywhere in the
+   * pre-channel code; just use tor_free()
+   */
+  tor_free(q-u.fixed.cell);
+}
+break;
+  case CELL_QUEUE_PACKED:
+if (q-u.packed.packed_cell) {
+  packed_cell_free(q-u.packed.packed_cell);
+}
+break;
+  case CELL_QUEUE_VAR:
+if (q-u.var.var_cell) {
+  /*
+   * This one's in connection_or.c; it'd be nice to figure out the
+   * whole flow of cells from one end to the other and factor the
+   * cell memory management functions like this out of the specific
+   * TLS lower layer.
+   */
+  var_cell_free(q-u.var.var_cell);
+}
+break;
+  default:
+/*
+ * Nothing we can do if we don't know the type; this will
+ * have been warned about elsewhere.
+ */
+break;
+}
+  }
+  tor_free(q);
+}
+
+/**
  * Check whether a cell queue entry is padding; this is a helper function
  * for channel_write_cell_queue_entry()
  */
@@ -1531,6 +1606,42 @@ cell_queue_entry_is_padding(cell_queue_entry_t *q)
 }
 
 /**
+ * Allocate a new cell queue entry for a fixed-size cell
+ */
+
+static cell_queue_entry_t *
+cell_queue_entry_new_fixed(cell_t *cell)
+{
+  cell_queue_entry_t *q = NULL;
+
+  tor_assert(cell);
+
+  q = tor_malloc(sizeof(*q));
+  q-type = CELL_QUEUE_FIXED;
+  q-u.fixed.cell = cell;
+
+  return q;
+}
+
+/**
+ * Allocate a new cell queue entry for a variable-size cell
+ */
+
+static cell_queue_entry_t *
+cell_queue_entry_new_var(var_cell_t *var_cell)
+{
+  cell_queue_entry_t *q = NULL;
+
+  tor_assert(var_cell);
+
+  q = tor_malloc(sizeof(*q));
+  q-type = CELL_QUEUE_VAR;
+  q-u.var.var_cell = var_cell;
+
+  

[tor-commits] [tor/master] Improve comments on channel_write_*()

2012-10-10 Thread andrea
commit f00b44ef8c82eb52fad19fd2218f485f1c5aceca
Author: Andrea Shepard and...@torproject.org
Date:   Tue Oct 9 11:38:15 2012 -0700

Improve comments on channel_write_*()
---
 src/or/channel.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index e87f4de..334f843 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -1723,7 +1723,9 @@ channel_write_cell_queue_entry(channel_t *chan, 
cell_queue_entry_t *q)
  * Write a cell to a channel
  *
  * Write a fixed-length cell to a channel using the write_cell() method.
- * This is equivalent to the pre-channels connection_or_write_cell_to_buf().
+ * This is equivalent to the pre-channels connection_or_write_cell_to_buf();
+ * it is called by the transport-independent code to deliver a cell to a
+ * channel for transmission.
  */
 
 void
@@ -1747,7 +1749,9 @@ channel_write_cell(channel_t *chan, cell_t *cell)
 /**
  * Write a packed cell to a channel
  *
- * Write a packed cell to a channel using the write_cell() method.
+ * Write a packed cell to a channel using the write_cell() method.  This is
+ * called by the transport-independent code to deliver a packed cell to a
+ * channel for transmission.
  */
 
 void
@@ -1774,7 +1778,8 @@ channel_write_packed_cell(channel_t *chan, packed_cell_t 
*packed_cell)
  *
  * Write a variable-length cell to a channel using the write_cell() method.
  * This is equivalent to the pre-channels
- * connection_or_write_var_cell_to_buf().
+ * connection_or_write_var_cell_to_buf(); it's called by the transport-
+ * independent code to deliver a var_cell to a channel for transmission.
  */
 
 void



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


[tor-commits] [tor/master] Add circuitmux.c, circuitmux.h

2012-10-10 Thread andrea
commit c684076fc7f685d6e0cd97f426d1474749f1da8b
Author: Andrea Shepard and...@torproject.org
Date:   Fri Sep 21 14:45:32 2012 -0700

Add circuitmux.c, circuitmux.h
---
 src/or/Makefile.nmake |   12 
 src/or/circuitmux.c   |   67 +
 src/or/circuitmux.h   |   50 
 src/or/include.am |2 +
 src/or/or.h   |   13 +-
 5 files changed, 137 insertions(+), 7 deletions(-)

diff --git a/src/or/Makefile.nmake b/src/or/Makefile.nmake
index b145fdc..9f948d6 100644
--- a/src/or/Makefile.nmake
+++ b/src/or/Makefile.nmake
@@ -9,12 +9,12 @@ LIBS = ..\..\..\build-alpha\lib\libevent.a \
  ws2_32.lib advapi32.lib shell32.lib
 
 LIBTOR_OBJECTS = buffers.obj channel.obj channeltls.obj circuitbuild.obj \
-   circuitlist.obj circuituse.obj command.obj config.obj connection.obj
-   connection_edge.obj connection_or.obj control.obj cpuworker.obj \
-   directory.obj dirserv.obj dirvote.obj dns.obj dnsserv.obj geoip.obj \
-   hibernate.obj main.obj microdesc.obj networkstatus.obj \
-   nodelist.obj onion.obj policies.obj reasons.obj relay.obj \
-   rendclient.obj rendcommon.obj rendmid.obj rendservice.obj \
+   circuitlist.obj circuitmux.obj circuituse.obj command.obj config.obj \
+   connection.obj connection_edge.obj connection_or.obj control.obj \
+   cpuworker.obj directory.obj dirserv.obj dirvote.obj dns.obj \
+   dnsserv.obj geoip.obj hibernate.obj main.obj microdesc.obj \
+   networkstatus.obj nodelist.obj onion.obj policies.obj reasons.obj \
+   relay.obj rendclient.obj rendcommon.obj rendmid.obj rendservice.obj \
rephist.obj router.obj routerlist.obj routerparse.obj status.obj \
config_codedigest.obj ntmain.obj
 
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
new file mode 100644
index 000..45b72f2
--- /dev/null
+++ b/src/or/circuitmux.c
@@ -0,0 +1,67 @@
+/* * Copyright (c) 2012, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file circuitmux.c
+ * \brief Circuit mux/cell selection abstraction
+ **/
+
+#include or.h
+#include circuitmux.h
+
+/*
+ * A circuitmux is a collection of circuits; it tracks which subset
+ * of the attached circuits are 'active' (i.e., have cells available
+ * to transmit) and how many cells on each.  It expoes three distinct
+ * interfaces to other components:
+ *
+ * To channels, which each have a circuitmux_t, the supported operations
+ * are:
+ *
+ * circuitmux_flush_cells():
+ *
+ *   Retrieve a cell from one of the active circuits, chosen according to
+ *   the circuitmux_t's cell selection policy.
+ *
+ * circuitmux_unlink_all():
+ *
+ *   The channel is closing down, all circuits must be detached.
+ *
+ * To circuits, the exposed operations are:
+ *
+ *   TODO
+ *
+ * To circuit selection policies, the exposed operations are:
+ *
+ *   TODO
+ *
+ * General status inquiries?
+ * 
+ */
+
+struct circuitmux_s {
+  /*
+   * Double-linked ring of circuits with queued cells waiting for room to
+   * free up on this connection's outbuf.  Every time we pull cells from
+   * a circuit, we advance this pointer to the next circuit in the ring.
+   */
+  struct circuit_t *active_circuits;
+
+  /*
+   * Priority queue of cell_ewma_t for circuits with queued cells waiting
+   * for room to free up on this connection's outbuf.  Kept in heap order
+   * according to EWMA.
+   *
+   * This is redundant with active_circuits; if we ever decide only to use
+   * the cell_ewma algorithm for choosing circuits, we can remove
+   * active_circuits.
+   */
+  smartlist_t *active_circuit_pqueue;
+
+  /*
+   * The tick on which the cell_ewma_ts in active_circuit_pqueue last had
+   * their ewma values rescaled.
+   */
+  unsigned active_circuit_pqueue_last_recalibrated;
+};
+
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
new file mode 100644
index 000..c5f9526
--- /dev/null
+++ b/src/or/circuitmux.h
@@ -0,0 +1,50 @@
+/* * Copyright (c) 2012, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file circuitmux.h
+ * \brief Header file for circuitmux.c
+ **/
+
+#ifndef _TOR_CIRCUITMUX_H
+#define _TOR_CIRCUITMUX_H
+
+#include or.h
+
+/* Consistency check */
+void circuitmux_assert_okay(circuitmux_t *cmux);
+
+/* Create/destroy */
+circuitmux_t * circuitmux_alloc(void);
+void circuitmux_detach_all_circuits(circuitmux_t *cmux);
+void circuitmux_free(circuitmux_t *cmux);
+
+/* Status inquiries */
+cell_direction_t circuitmux_attached_circuit_direction(
+circuitmux_t *cmux,
+circuit_t *circ);
+int circuitmux_is_circuit_attached(circuitmux_t *cmux, circuit_t *circ);
+int circuitmux_is_circuit_active(circuitmux_t *cmux, circuit_t *circ);
+unsigned int circuitmux_num_cells_for_circuit(circuitmux_t *cmux,
+  circuit_t *circ);
+unsigned int circuitmux_num_cells(circuitmux_t *cmux);
+unsigned int 

[tor-commits] [tor/master] Implement circuitmux_alloc()/circuitmux_free() and chanid/circid-muxinfo hash table

2012-10-10 Thread andrea
commit e4a11b890e7c5fe45dc1f5f271fbd8130ccc9c55
Author: Andrea Shepard and...@torproject.org
Date:   Mon Sep 24 08:52:05 2012 -0700

Implement circuitmux_alloc()/circuitmux_free() and chanid/circid-muxinfo 
hash table
---
 src/or/circuitmux.c |  144 ++-
 1 files changed, 143 insertions(+), 1 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 45b72f2..d4866ca 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -10,6 +10,33 @@
 #include circuitmux.h
 
 /*
+ * Private typedefs for circuitmux.c
+ */
+
+/*
+ * Map of muxinfos for circuitmux_t to use; struct is defined below (name
+ * of struct must match HT_HEAD line).
+ */
+typedef struct chanid_circid_muxinfo_map chanid_circid_muxinfo_map_t;
+
+/*
+ * Hash table entry (yeah, calling it chanid_circid_muxinfo_s seems to
+ * break the hash table code).
+ */
+typedef struct chanid_circid_muxinfo_t chanid_circid_muxinfo_t;
+
+/*
+ * Anything the mux wants to store per-circuit in the map; right now just
+ * a count of queued cells.
+ */
+
+typedef struct circuit_muxinfo_s circuit_muxinfo_t;
+
+/*
+ * Structures for circuitmux.c
+ */
+
+/*
  * A circuitmux is a collection of circuits; it tracks which subset
  * of the attached circuits are 'active' (i.e., have cells available
  * to transmit) and how many cells on each.  It expoes three distinct
@@ -40,6 +67,14 @@
  */
 
 struct circuitmux_s {
+  /* Keep count of attached, active circuits */
+  unsigned int n_circuits, n_active_circuits;
+
+  /*
+   * Map from (channel ID, circuit ID) pairs to circuit_muxinfo_t
+   */
+  chanid_circid_muxinfo_map_t *chanid_circid_map;
+
   /*
* Double-linked ring of circuits with queued cells waiting for room to
* free up on this connection's outbuf.  Every time we pull cells from
@@ -62,6 +97,113 @@ struct circuitmux_s {
* The tick on which the cell_ewma_ts in active_circuit_pqueue last had
* their ewma values rescaled.
*/
-  unsigned active_circuit_pqueue_last_recalibrated;
+  unsigned int active_circuit_pqueue_last_recalibrated;
+};
+
+/*
+ * This struct holds whatever we want to store per attached circuit on a
+ * circuitmux_t; right now, just the count of queued cells.
+ */
+
+struct circuit_muxinfo_s {
+  unsigned int cell_count;
+};
+
+/*
+ * A map from channel ID and circuit ID to a circuit_muxinfo_t for that
+ * circuit.
+ */
+
+struct chanid_circid_muxinfo_t {
+  HT_ENTRY(chanid_circid_muxinfo_t) node;
+  uint64_t chan_id;
+  circid_t circ_id;
+  circuit_muxinfo_t muxinfo;
 };
 
+/*
+ * Static function declarations
+ */
+
+static INLINE int
+chanid_circid_entries_eq(chanid_circid_muxinfo_t *a,
+ chanid_circid_muxinfo_t *b);
+static INLINE unsigned int
+chanid_circid_entry_hash(chanid_circid_muxinfo_t *a);
+
+/* Function definitions */
+
+/**
+ * Helper for chanid_circid_cell_count_map_t hash table: compare the channel
+ * ID and circuit ID for a and b, and return less than, equal to, or greater
+ * than zero appropriately.
+ */
+
+static INLINE int
+chanid_circid_entries_eq(chanid_circid_muxinfo_t *a,
+ chanid_circid_muxinfo_t *b)
+{
+return a-chan_id == b-chan_id  a-circ_id == b-circ_id;
+}
+
+/**
+ * Helper: return a hash based on circuit ID and channel ID in a.
+ */
+
+static INLINE unsigned int
+chanid_circid_entry_hash(chanid_circid_muxinfo_t *a)
+{
+return (((unsigned int)(a-circ_id)  8) ^
+((unsigned int)((a-chan_id  32)  0x)) ^
+((unsigned int)(a-chan_id  0x)));
+}
+
+/* Declare the struct chanid_circid_muxinfo_map type */
+HT_HEAD(chanid_circid_muxinfo_map, chanid_circid_muxinfo_t);
+
+/* Emit a bunch of hash table stuff */
+HT_PROTOTYPE(chanid_circid_muxinfo_map, chanid_circid_muxinfo_t, node,
+ chanid_circid_entry_hash, chanid_circid_entries_eq);
+HT_GENERATE(chanid_circid_muxinfo_map, chanid_circid_muxinfo_t, node,
+chanid_circid_entry_hash, chanid_circid_entries_eq, 0.6,
+malloc, realloc, free);
+
+/**
+ * Allocate a new circuitmux_t
+ */
+
+circuitmux_t *
+circuitmux_alloc(void)
+{
+  circuitmux_t *rv = NULL;
+
+  rv = tor_malloc_zero(sizeof(*rv));
+  rv-chanid_circid_map = tor_malloc_zero(sizeof(*( rv-chanid_circid_map)));
+  HT_INIT(chanid_circid_muxinfo_map, rv-chanid_circid_map);
+
+  return rv;
+}
+
+/**
+ * Free a circuitmux_t; the circuits must be detached first with
+ * circuitmux_detach_all_circuits().
+ */
+
+void
+circuitmux_free(circuitmux_t *cmux)
+{
+  if (!cmux) return;
+
+  tor_assert(cmux-n_circuits == 0);
+  tor_assert(cmux-n_active_circuits == 0);
+
+  smartlist_free(cmux-active_circuit_pqueue);
+
+  if (cmux-chanid_circid_map) {
+HT_CLEAR(chanid_circid_muxinfo_map, cmux-chanid_circid_map);
+tor_free(cmux-chanid_circid_map);
+  }
+
+  tor_free(cmux);
+}
+



___
tor-commits mailing list
tor-commits@lists.torproject.org

[tor-commits] [tor/master] Implement circuitmux_detach_circuit() in circuitmux.c

2012-10-10 Thread andrea
commit c3ebd0340cca67dc4dd44bd18849100ebba39051
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 11:40:33 2012 -0700

Implement circuitmux_detach_circuit() in circuitmux.c
---
 src/or/circuitmux.c |   98 +++---
 1 files changed, 30 insertions(+), 68 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 629fbcf..2a7d075 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -443,98 +443,60 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
   }
 }
 
-/*
- * Circuitmux/circuit attachment status inquiry functions
- */
-
 /**
- * Query the direction of an attached circuit
+ * Detach a circuit from a circuitmux and update all counters as needed;
+ * no-op if not attached.
  */
 
-cell_direction_t
-circuitmux_attached_circuit_direction(circuitmux_t *cmux, circuit_t *circ)
+void
+circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t *circ)
 {
-  chanid_circid_muxinfo_t *hashent = NULL;
-
-  /* Try to find a map entry */
-  hashent = circuitmux_find_map_entry(cmux, circ);
-
+  chanid_circid_muxinfo_t search, *hashent = NULL;
   /*
-   * This function should only be called on attached circuits; assert that
-   * we had a map entry.
+   * Use this to keep track of whether we found it for n_chan or
+   * p_chan for consistency checking.
*/
-  tor_assert(hashent);
-
-  /* Return the direction from the map entry */
-  return hashent-muxinfo.direction;
-}
-
-/**
- * Find an entry in the cmux's map for this circuit or return NULL if there
- * is none.
- */
+  cell_direction_t last_searched_direction;
 
-static chanid_circid_muxinfo_t *
-circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t *circ)
-{
-  chanid_circid_muxinfo_t search, *hashent = NULL;
-
-  /* Sanity-check parameters */
   tor_assert(cmux);
   tor_assert(cmux-chanid_circid_map);
   tor_assert(circ);
   tor_assert(circ-n_chan);
 
-  /* Okay, let's see if it's attached for n_chan/n_circ_id */
+  /* See if we have it for n_chan/n_circ_id */
   search.chan_id = circ-n_chan-global_identifier;
   search.circ_id = circ-n_circ_id;
+  hashent = HT_REMOVE(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+  search);
+  last_searched_direction = CELL_DIRECTION_OUT;
 
-  /* Query */
-  hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
-search);
-
-  /* Found something? */
-  if (hashent) {
-/*
- * Assert that the direction makes sense for a hashent we found by
- * n_chan/n_circ_id before we return it.
- */
-tor_assert(hashent-muxinfo.direction == CELL_DIRECTION_OUT);
-  } else {
-/* Not there, have we got a p_chan/p_circ_id to try? */
+  /* Got one? If not, see if it's an or_circuit_t and try p_chan/p_circ_id */
+  if (!hashent) {
 if (circ-magic == OR_CIRCUIT_MAGIC) {
   search.circ_id = TO_OR_CIRCUIT(circ)-p_circ_id;
-  /* Check for p_chan */
   if (TO_OR_CIRCUIT(circ)-p_chan) {
 search.chan_id = TO_OR_CIRCUIT(circ)-p_chan-global_identifier;
-/* Okay, search for that */
-hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
-  search);
-/* Find anything? */
-if (hashent) {
-  /* Assert that the direction makes sense before we return it */
-  tor_assert(hashent-muxinfo.direction == CELL_DIRECTION_IN);
-}
+hashent = HT_REMOVE(chanid_circid_muxinfo_map,
+cmux-chanid_circid_map,
+search);
+last_searched_direction = CELL_DIRECTION_IN;
   }
 }
   }
 
-  /* Okay, hashent is it if it was there */
-  return hashent;
-}
-
-/**
- * Query whether a circuit is attached to a circuitmux
- */
-
-int
-circuitmux_is_circuit_attached(circuitmux_t *cmux, circuit_t *circ)
-{
-  chanid_circid_muxinfo_t *hashent = NULL;
+  /* If hashent isn't NULL, we just removed it from the map */
+  if (hashent) {
+/* Update counters */
+--(cmux-n_circuits);
+if (hashent-muxinfo.cell_count  0) --(cmux-n_active_circuits);
+cmux-n_cells -= hashent-muxinfo.cell_count;
+/* TODO update active_circuits / active_circuit_pqueue */
 
-  /* Look if it's in the circuit map */
-  hashent = circuitmux_find_map_entry(cmux, circ);
+/* Consistency check: the direction must match the direction searched */
+tor_assert(last_searched_direction == hashent-muxinfo.direction);
 
-  return (hashent != NULL);
+/* Free the hash entry */
+tor_free(hashent);
+  }
 }
 



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


[tor-commits] [tor/master] Implement circuitmux_attach_circuit() in circuitmux.c

2012-10-10 Thread andrea
commit 3c41d7f414511aeb6e9e0fd6bfb9be1af539840a
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 00:56:26 2012 -0700

Implement circuitmux_attach_circuit() in circuitmux.c
---
 src/or/circuitmux.c |  238 ++-
 src/or/or.h |4 -
 2 files changed, 236 insertions(+), 6 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index d4866ca..6508048 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -7,6 +7,7 @@
  **/
 
 #include or.h
+#include channel.h
 #include circuitmux.h
 
 /*
@@ -63,13 +64,16 @@ typedef struct circuit_muxinfo_s circuit_muxinfo_t;
  *   TODO
  *
  * General status inquiries?
- * 
+ *
  */
 
 struct circuitmux_s {
   /* Keep count of attached, active circuits */
   unsigned int n_circuits, n_active_circuits;
 
+  /* Total number of queued cells on all circuits */
+  unsigned int n_cells;
+
   /*
* Map from (channel ID, circuit ID) pairs to circuit_muxinfo_t
*/
@@ -102,11 +106,14 @@ struct circuitmux_s {
 
 /*
  * This struct holds whatever we want to store per attached circuit on a
- * circuitmux_t; right now, just the count of queued cells.
+ * circuitmux_t; right now, just the count of queued cells and the direction.
  */
 
 struct circuit_muxinfo_s {
+  /* Count of cells on this circuit at last update */
   unsigned int cell_count;
+  /* Direction of flow */
+  cell_direction_t direction;
 };
 
 /*
@@ -168,6 +175,10 @@ HT_GENERATE(chanid_circid_muxinfo_map, 
chanid_circid_muxinfo_t, node,
 chanid_circid_entry_hash, chanid_circid_entries_eq, 0.6,
 malloc, realloc, free);
 
+/*
+ * Circuitmux alloc/free functions
+ */
+
 /**
  * Allocate a new circuitmux_t
  */
@@ -207,3 +218,226 @@ circuitmux_free(circuitmux_t *cmux)
   tor_free(cmux);
 }
 
+/*
+ * Circuitmux/circuit attachment status inquiry functions
+ */
+
+/**
+ * Query the direction of an attached circuit
+ */
+
+cell_direction_t
+circuitmux_attached_circuit_direction(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+
+  /* Try to find a map entry */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+
+  /*
+   * This function should only be called on attached circuits; assert that
+   * we had a map entry.
+   */
+  tor_assert(hashent);
+
+  /* Return the direction from the map entry */
+  return hashent-muxinfo.direction;
+}
+
+/**
+ * Find an entry in the cmux's map for this circuit or return NULL if there
+ * is none.
+ */
+
+static chanid_circid_muxinfo_t *
+circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t search, *hashent = NULL;
+
+  /* Sanity-check parameters */
+  tor_assert(cmux);
+  tor_assert(cmux-chanid_circid_map);
+  tor_assert(circ);
+  tor_assert(circ-n_chan);
+
+  /* Okay, let's see if it's attached for n_chan/n_circ_id */
+  search.chan_id = circ-n_chan-global_identifier;
+  search.circ_id = circ-n_circ_id;
+
+  /* Query */
+  hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+search);
+
+  /* Found something? */
+  if (hashent) {
+/*
+ * Assert that the direction makes sense for a hashent we found by
+ * n_chan/n_circ_id before we return it.
+ */
+tor_assert(hashent-muxinfo.direction == CELL_DIRECTION_OUT);
+  } else {
+/* Not there, have we got a p_chan/p_circ_id to try? */
+if (circ-magic == OR_CIRCUIT_MAGIC) {
+  search.circ_id = TO_OR_CIRCUIT(circ)-p_circ_id;
+  /* Check for p_chan */
+  if (TO_OR_CIRCUIT(circ)-p_chan) {
+search.chan_id = TO_OR_CIRCUIT(circ)-p_chan-global_identifier;
+/* Okay, search for that */
+hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+  search);
+/* Find anything? */
+if (hashent) {
+  /* Assert that the direction makes sense before we return it */
+  tor_assert(hashent-muxinfo.direction == CELL_DIRECTION_IN);
+}
+  }
+}
+  }
+
+  /* Okay, hashent is it if it was there */
+  return hashent;
+}
+
+/**
+ * Query whether a circuit is attached to a circuitmux
+ */
+
+int
+circuitmux_is_circuit_attached(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+
+  /* Look if it's in the circuit map */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+
+  return (hashent != NULL);
+}
+
+/*
+ * Functions for circuit code to call to update circuit status
+ */
+
+/**
+ * Attach a circuit to a circuitmux, for the specified direction.
+ */
+
+void
+circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
+  cell_direction_t direction)
+{
+  channel_t *chan = NULL;
+  uint64_t channel_id;
+  circid_t circ_id;
+  chanid_circid_muxinfo_t search, *hashent = NULL;
+  unsigned int cell_count;
+
+  tor_assert(cmux);
+  tor_assert(circ);
+  tor_assert(direction == CELL_DIRECTION_IN ||
+ direction == CELL_DIRECTION_OUT);
+
+  

[tor-commits] [tor/master] Handle n_mux/p_mux properly in circuitmux.c

2012-10-10 Thread andrea
commit 8004448635d63fa829d2a836214c42c1609c3f01
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 11:51:39 2012 -0700

Handle n_mux/p_mux properly in circuitmux.c
---
 src/or/circuitmux.c |   30 +-
 src/or/or.h |7 ++-
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 2a7d075..ede2486 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -340,7 +340,8 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
 
   /*
* Figure out which channel we're using, and get the circuit's current
-   * cell count and circuit ID.
+   * cell count and circuit ID; assert that the circuit is not already
+   * attached to another mux.
*/
   if (direction == CELL_DIRECTION_OUT) {
 /* It's n_chan */
@@ -376,13 +377,16 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
  Circuit %u on channel  U64_FORMAT  was already attached to 
  cmux %p (trying to attach to %p),
  circ_id, U64_PRINTF_ARG(channel_id),
- circ-mux, cmux);
+ ((direction == CELL_DIRECTION_OUT) ?
+circ-n_mux : TO_OR_CIRCUIT(circ)-p_mux),
+ cmux);
 
 /*
- * The mux pointer on the circuit should match this cmux, and the
- * direction in result should match; otherwise assert.
+ * The mux pointer on this circuit and the direction in result should
+ * match; otherwise assert.
  */
-tor_assert(circ-mux == cmux);
+if (direction == CELL_DIRECTION_OUT) tor_assert(circ-n_mux == cmux);
+else tor_assert(TO_OR_CIRCUIT(circ)-p_mux == cmux);
 tor_assert(hashent-muxinfo.direction == direction);
 
 /*
@@ -407,8 +411,12 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
  Attaching circuit %u on channel  U64_FORMAT  to cmux %p,
  circ_id, U64_PRINTF_ARG(channel_id), cmux);
 
-/* Assert that the circuit doesn't already have a mux */
-tor_assert(circ-mux == NULL);
+/*
+ * Assert that the circuit doesn't already have a mux for this
+ * direction.
+ */
+if (direction == CELL_DIRECTION_OUT) tor_assert(circ-n_mux == NULL);
+else tor_assert(TO_OR_CIRCUIT(circ)-p_mux == NULL);
 
 /* Insert it in the map */
 hashent = tor_malloc_zero(sizeof(*hashent));
@@ -419,8 +427,9 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
 HT_INSERT(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
   hashent);
 
-/* Set the circuit's mux */
-circ-mux = cmux;
+/* Set the circuit's mux for this direction */
+if (direction == CELL_DIRECTION_OUT) circ-n_mux = cmux;
+else TO_OR_CIRCUIT(circ)-p_mux = cmux;
 
 /* Make sure the next/prev pointers are NULL */
 if (direction == CELL_DIRECTION_OUT) {
@@ -494,6 +503,9 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
 
 /* Consistency check: the direction must match the direction searched */
 tor_assert(last_searched_direction == hashent-muxinfo.direction);
+/* Clear the circuit's mux for this direction */
+if (last_searched_direction == CELL_DIRECTION_OUT) circ-n_mux = NULL;
+else TO_OR_CIRCUIT(circ)-p_mux = NULL;
 
 /* Free the hash entry */
 tor_free(hashent);
diff --git a/src/or/or.h b/src/or/or.h
index 3555a08..a0fcf8f 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2650,7 +2650,7 @@ typedef struct circuit_t {
* Circuit mux associated with n_chan to which this circuit is attached;
* NULL if we have no n_chan.
*/
-  circuitmux_t *mux;
+  circuitmux_t *n_mux;
 
   /** Queue of cells waiting to be transmitted on n_chan */
   cell_queue_t n_chan_cells;
@@ -2916,6 +2916,11 @@ typedef struct or_circuit_t {
   cell_queue_t p_chan_cells;
   /** The channel that is previous in this circuit. */
   channel_t *p_chan;
+  /**
+   * Circuit mux associated with p_chan to which this circuit is attached;
+   * NULL if we have no p_chan.
+   */
+  circuitmux_t *p_mux;
   /** Linked list of Exit streams associated with this circuit. */
   edge_connection_t *n_streams;
   /** Linked list of Exit streams associated with this circuit that are



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


[tor-commits] [tor/master] Implement circuitmux_clear_num_cells() and circuitmux_set_num_cells() in circuitmux.c, remove unneeded circuitmux_add_to_num_cells() from circuitmux.h

2012-10-10 Thread andrea
commit a9deec3550ed51b3cd2a6a51104745def56b5e7a
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 12:23:58 2012 -0700

Implement circuitmux_clear_num_cells() and circuitmux_set_num_cells() in 
circuitmux.c, remove unneeded circuitmux_add_to_num_cells() from circuitmux.h
---
 src/or/circuitmux.c |   50 ++
 src/or/circuitmux.h |2 --
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index ede2486..f6cdbf1 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -512,3 +512,53 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
   }
 }
 
+/**
+ * Clear the cell counter for a circuit on a circuitmux
+ */
+
+void
+circuitmux_clear_num_cells(circuitmux_t *cmux, circuit_t *circ)
+{
+  /* This is the same as setting the cell count to zero */
+  circuitmux_set_num_cells(cmux, circ, 0);
+}
+
+/**
+ * Set the cell counter for a circuit on a circuitmux
+ */
+
+void
+circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t *circ,
+ unsigned int n_cells)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  /* Search for this circuit's entry */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+  /* Assert that we found one */
+  tor_assert(hashent);
+
+  /* Update cmux cell counter */
+  cmux-n_cells -= hashent-muxinfo.cell_count;
+  cmux-n_cells += n_cells;
+
+  /*
+   * Update cmux active circuit counter: is the old cell count  0 and the
+   * new cell count == 0 ?
+   */
+  if (hashent-muxinfo.cell_count  0  n_cells == 0) {
+--(cmux-n_active_circuits);
+/* TODO update active_circuits / active_circuit_pqueue */
+  /* Is the old cell count == 0 and the new cell count  0 ? */
+  } else if (hashent-muxinfo.cell_count == 0  n_cells  0) {
+++(cmux-n_active_circuits);
+/* TODO update active_circuits / active_circuit_pqueue */
+  }
+
+  /* Update hash entry cell counter */
+  hashent-muxinfo.cell_count = n_cells;
+}
+
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index c5f9526..ade544f 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -41,8 +41,6 @@ void circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
cell_direction_t direction);
 void circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t *circ);
 void circuitmux_clear_num_cells(circuitmux_t *cmux, circuit_t *circ);
-void circuitmux_add_to_num_cells(circuitmux_t *cmux, circuit_t *circ,
- unsigned int n_cells);
 void circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t *circ,
   unsigned int n_cells);
 



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


[tor-commits] [tor/master] Implement circuitmux_attached_circuit_direction(), circuitmux_find_map_entry() and circuitmux_is_circuit_attached() in circuitmux.c

2012-10-10 Thread andrea
commit 7e5c358d38cae7769426f1427f23ce6002cda980
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 10:54:08 2012 -0700

Implement circuitmux_attached_circuit_direction(), 
circuitmux_find_map_entry() and circuitmux_is_circuit_attached() in circuitmux.c
---
 src/or/circuitmux.c |   97 +++
 1 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 6508048..629fbcf 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -137,6 +137,8 @@ chanid_circid_entries_eq(chanid_circid_muxinfo_t *a,
  chanid_circid_muxinfo_t *b);
 static INLINE unsigned int
 chanid_circid_entry_hash(chanid_circid_muxinfo_t *a);
+static chanid_circid_muxinfo_t *
+circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t *circ);
 
 /* Function definitions */
 
@@ -441,3 +443,98 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
   }
 }
 
+/*
+ * Circuitmux/circuit attachment status inquiry functions
+ */
+
+/**
+ * Query the direction of an attached circuit
+ */
+
+cell_direction_t
+circuitmux_attached_circuit_direction(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+
+  /* Try to find a map entry */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+
+  /*
+   * This function should only be called on attached circuits; assert that
+   * we had a map entry.
+   */
+  tor_assert(hashent);
+
+  /* Return the direction from the map entry */
+  return hashent-muxinfo.direction;
+}
+
+/**
+ * Find an entry in the cmux's map for this circuit or return NULL if there
+ * is none.
+ */
+
+static chanid_circid_muxinfo_t *
+circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t search, *hashent = NULL;
+
+  /* Sanity-check parameters */
+  tor_assert(cmux);
+  tor_assert(cmux-chanid_circid_map);
+  tor_assert(circ);
+  tor_assert(circ-n_chan);
+
+  /* Okay, let's see if it's attached for n_chan/n_circ_id */
+  search.chan_id = circ-n_chan-global_identifier;
+  search.circ_id = circ-n_circ_id;
+
+  /* Query */
+  hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+search);
+
+  /* Found something? */
+  if (hashent) {
+/*
+ * Assert that the direction makes sense for a hashent we found by
+ * n_chan/n_circ_id before we return it.
+ */
+tor_assert(hashent-muxinfo.direction == CELL_DIRECTION_OUT);
+  } else {
+/* Not there, have we got a p_chan/p_circ_id to try? */
+if (circ-magic == OR_CIRCUIT_MAGIC) {
+  search.circ_id = TO_OR_CIRCUIT(circ)-p_circ_id;
+  /* Check for p_chan */
+  if (TO_OR_CIRCUIT(circ)-p_chan) {
+search.chan_id = TO_OR_CIRCUIT(circ)-p_chan-global_identifier;
+/* Okay, search for that */
+hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+  search);
+/* Find anything? */
+if (hashent) {
+  /* Assert that the direction makes sense before we return it */
+  tor_assert(hashent-muxinfo.direction == CELL_DIRECTION_IN);
+}
+  }
+}
+  }
+
+  /* Okay, hashent is it if it was there */
+  return hashent;
+}
+
+/**
+ * Query whether a circuit is attached to a circuitmux
+ */
+
+int
+circuitmux_is_circuit_attached(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+
+  /* Look if it's in the circuit map */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+
+  return (hashent != NULL);
+}
+



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


[tor-commits] [tor/master] Eliminate linked list helper functions in relay.c which are no longer used

2012-10-10 Thread andrea
commit 35f5259df4feacbb77b14c6da30ec137a21763bb
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 15:05:10 2012 -0700

Eliminate linked list helper functions in relay.c which are no longer used
---
 src/or/relay.c |   32 
 1 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index f079243..e3b383b 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1972,38 +1972,6 @@ cell_queue_pop(cell_queue_t *queue)
   return cell;
 }
 
-/** Return a pointer to the next_active_on_{n,p}_chan pointer of bcirc/b,
- * depending on whether bchan/b matches n_chan or p_chan. */
-static INLINE circuit_t **
-next_circ_on_chan_p(circuit_t *circ, channel_t *chan)
-{
-  tor_assert(circ);
-  tor_assert(chan);
-  if (chan == circ-n_chan) {
-return circ-next_active_on_n_chan;
-  } else {
-or_circuit_t *orcirc = TO_OR_CIRCUIT(circ);
-tor_assert(chan == orcirc-p_chan);
-return orcirc-next_active_on_p_chan;
-  }
-}
-
-/** Return a pointer to the prev_active_on_{n,p}_chan pointer of bcirc/b,
- * depending on whether bchan/b matches n_chan or p_chan. */
-static INLINE circuit_t **
-prev_circ_on_chan_p(circuit_t *circ, channel_t *chan)
-{
-  tor_assert(circ);
-  tor_assert(chan);
-  if (chan == circ-n_chan) {
-return circ-prev_active_on_n_chan;
-  } else {
-or_circuit_t *orcirc = TO_OR_CIRCUIT(circ);
-tor_assert(chan == orcirc-p_chan);
-return orcirc-prev_active_on_p_chan;
-  }
-}
-
 #if 0
 /** Helper for sorting cell_ewma_t values in their priority queue. */
 static int



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


[tor-commits] [tor/master] Implement circuitmux_is_circuit_active(), circuitmux_num_cells_for_circuit(), circuitmux_num_cells(), circuitmux_num_active_circuits() and circuitmux_num_circuits() in circu

2012-10-10 Thread andrea
commit 9da04141e23505074d6867e579fea130bbb00964
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 12:56:30 2012 -0700

Implement circuitmux_is_circuit_active(), 
circuitmux_num_cells_for_circuit(), circuitmux_num_cells(), 
circuitmux_num_active_circuits() and circuitmux_num_circuits() in circuitmux.c
---
 src/or/circuitmux.c |   85 +++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index f6cdbf1..c640294 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -315,6 +315,91 @@ circuitmux_is_circuit_attached(circuitmux_t *cmux, 
circuit_t *circ)
   return (hashent != NULL);
 }
 
+/**
+ * Query whether a circuit is active on a circuitmux
+ */
+
+int
+circuitmux_is_circuit_active(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+  int is_active = 0;
+
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  /* Look if it's in the circuit map */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+  if (hashent) {
+/* Check the number of cells on this circuit */
+is_active = (hashent-muxinfo.cell_count  0);
+  }
+  /* else not attached, so not active */
+
+  return is_active;
+}
+
+/**
+ * Query number of available cells for a circuit on a circuitmux
+ */
+
+unsigned int
+circuitmux_num_cells_for_circuit(circuitmux_t *cmux, circuit_t *circ)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+  unsigned int n_cells = 0;
+
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  /* Look if it's in the circuit map */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+  if (hashent) {
+/* Just get the cell count for this circuit */
+n_cells = hashent-muxinfo.cell_count;
+  }
+  /* else not attached, so 0 cells */
+
+  return n_cells;
+}
+
+
+/**
+ * Query total number of available cells on a circuitmux
+ */
+
+unsigned int
+circuitmux_num_cells(circuitmux_t *cmux)
+{
+  tor_assert(cmux);
+
+  return cmux-n_cells;
+}
+
+/**
+ * Query total number of circuits active on a circuitmux
+ */
+
+unsigned int
+circuitmux_num_active_circuits(circuitmux_t *cmux)
+{
+  tor_assert(cmux);
+
+  return cmux-n_active_circuits;
+}
+
+/**
+ * Query total number of circuits attached to a circuitmux
+ */
+
+unsigned int
+circuitmux_num_circuits(circuitmux_t *cmux)
+{
+  tor_assert(cmux);
+
+  return cmux-n_circuits;
+}
+
 /*
  * Functions for circuit code to call to update circuit status
  */



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


[tor-commits] [tor/master] Implement circuitmux_detach_all_circuits() in circuitmux.c

2012-10-10 Thread andrea
commit fd31dd440c8feb31dc7b4e0641bd78d36a65e4e3
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 13:38:32 2012 -0700

Implement circuitmux_detach_all_circuits() in circuitmux.c
---
 src/or/circuitmux.c |   69 +++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index c640294..61fd30d 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -8,6 +8,7 @@
 
 #include or.h
 #include channel.h
+#include circuitlist.h
 #include circuitmux.h
 
 /*
@@ -198,6 +199,74 @@ circuitmux_alloc(void)
 }
 
 /**
+ * Detach all circuits from a circuitmux (use before circuitmux_free())
+ */
+
+void
+circuitmux_detach_all_circuits(circuitmux_t *cmux)
+{
+  chanid_circid_muxinfo_t **i = NULL, *to_remove;
+  channel_t *chan = NULL;
+  circuit_t *circ = NULL;
+
+  tor_assert(cmux);
+
+  i = HT_START(chanid_circid_muxinfo_map, cmux-chanid_circid_map);
+  while (i) {
+to_remove = *i;
+i = HT_NEXT_RMV(chanid_circid_muxinfo_map, cmux-chanid_circid_map, i);
+if (to_remove) {
+  /* Find a channel and circuit */
+  chan = channel_find_by_global_id(to_remove-chan_id);
+  if (chan) {
+circ = circuit_get_by_circid_channel(to_remove-circ_id, chan);
+if (circ) {
+  /* Clear the circuit's mux for this direction */
+  if (to_remove-muxinfo.direction == CELL_DIRECTION_OUT) {
+/* Clear n_mux */
+circ-n_mux = NULL;
+  } else if (circ-magic == OR_CIRCUIT_MAGIC) {
+/*
+ * It has a sensible p_chan and direction == CELL_DIRECTION_IN,
+ * so clear p_mux.
+ */
+TO_OR_CIRCUIT(circ)-p_mux = NULL;
+  } else {
+/* Complain and move on */
+log_warn(LD_CIRC,
+ Circuit %d/channel  U64_FORMAT  had direction == 
+ CELL_DIRECTION_IN, but isn't an or_circuit_t,
+ to_remove-circ_id,
+ U64_PRINTF_ARG(to_remove-chan_id));
+  }
+
+  /* TODO update active_circuits / active_circuit_pqueue */
+} else {
+  /* Complain and move on */
+  log_warn(LD_CIRC,
+   Couldn't find circuit %d (for channel  U64_FORMAT ),
+   to_remove-circ_id,
+   U64_PRINTF_ARG(to_remove-chan_id));
+}
+  } else {
+/* Complain and move on */
+log_warn(LD_CIRC,
+ Couldn't find channel  U64_FORMAT  (for circuit id %d),
+ U64_PRINTF_ARG(to_remove-chan_id),
+ to_remove-circ_id);
+  }
+
+  /* Free it */
+  tor_free(to_remove);
+}
+  }
+
+  cmux-n_circuits = 0;
+  cmux-n_active_circuits = 0;
+  cmux-n_cells = 0;
+}
+
+/**
  * Free a circuitmux_t; the circuits must be detached first with
  * circuitmux_detach_all_circuits().
  */



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


[tor-commits] [tor/master] Implement circuitmux_make_circuit_inactive(), circuitmux_make_circuit_active() and linked list helper functions in circuitmux.c

2012-10-10 Thread andrea
commit 38fa3b7e4489dafdb74ebef96f5a684c1f29eb1e
Author: Andrea Shepard and...@torproject.org
Date:   Wed Sep 26 15:04:29 2012 -0700

Implement circuitmux_make_circuit_inactive(), 
circuitmux_make_circuit_active() and linked list helper functions in 
circuitmux.c
---
 src/or/circuitmux.c |  239 ---
 1 files changed, 227 insertions(+), 12 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 61fd30d..77bb568 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -85,7 +85,7 @@ struct circuitmux_s {
* free up on this connection's outbuf.  Every time we pull cells from
* a circuit, we advance this pointer to the next circuit in the ring.
*/
-  struct circuit_t *active_circuits;
+  struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /*
* Priority queue of cell_ewma_t for circuits with queued cells waiting
@@ -140,10 +140,50 @@ static INLINE unsigned int
 chanid_circid_entry_hash(chanid_circid_muxinfo_t *a);
 static chanid_circid_muxinfo_t *
 circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t *circ);
+static void
+circuitmux_make_circuit_active(circuitmux_t *cmux, circuit_t *circ,
+   cell_direction_t direction);
+static void
+circuitmux_make_circuit_inactive(circuitmux_t *cmux, circuit_t *circ,
+ cell_direction_t direction);
+static INLINE circuit_t **
+circuitmux_next_active_circ_p(circuitmux_t *cmux, circuit_t *circ);
+static INLINE circuit_t **
+circuitmux_prev_active_circ_p(circuitmux_t *cmux, circuit_t *circ);
 
 /* Function definitions */
 
 /**
+ * Linked list helpers
+ */
+
+static INLINE circuit_t **
+circuitmux_next_active_circ_p(circuitmux_t *cmux, circuit_t *circ)
+{
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  if (circ-n_mux == cmux) return (circ-next_active_on_n_chan);
+  else {
+tor_assert(TO_OR_CIRCUIT(circ)-p_mux == cmux);
+return (TO_OR_CIRCUIT(circ)-next_active_on_p_chan);
+  }
+}
+
+static INLINE circuit_t **
+circuitmux_prev_active_circ_p(circuitmux_t *cmux, circuit_t *circ)
+{
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  if (circ-n_mux == cmux) return (circ-prev_active_on_n_chan);
+  else {
+tor_assert(TO_OR_CIRCUIT(circ)-p_mux == cmux);
+return (TO_OR_CIRCUIT(circ)-prev_active_on_p_chan);
+  }
+}
+
+/**
  * Helper for chanid_circid_cell_count_map_t hash table: compare the channel
  * ID and circuit ID for a and b, and return less than, equal to, or greater
  * than zero appropriately.
@@ -225,12 +265,16 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
   if (to_remove-muxinfo.direction == CELL_DIRECTION_OUT) {
 /* Clear n_mux */
 circ-n_mux = NULL;
+/* Update active_circuits et al. */
+circuitmux_make_circuit_inactive(cmux, circ, CELL_DIRECTION_OUT);
   } else if (circ-magic == OR_CIRCUIT_MAGIC) {
 /*
  * It has a sensible p_chan and direction == CELL_DIRECTION_IN,
  * so clear p_mux.
  */
 TO_OR_CIRCUIT(circ)-p_mux = NULL;
+/* Update active_circuits et al. */
+circuitmux_make_circuit_inactive(cmux, circ, CELL_DIRECTION_IN);
   } else {
 /* Complain and move on */
 log_warn(LD_CIRC,
@@ -239,8 +283,6 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
  to_remove-circ_id,
  U64_PRINTF_ARG(to_remove-chan_id));
   }
-
-  /* TODO update active_circuits / active_circuit_pqueue */
 } else {
   /* Complain and move on */
   log_warn(LD_CIRC,
@@ -432,7 +474,6 @@ circuitmux_num_cells_for_circuit(circuitmux_t *cmux, 
circuit_t *circ)
   return n_cells;
 }
 
-
 /**
  * Query total number of available cells on a circuitmux
  */
@@ -548,14 +589,14 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
  */
 if (hashent-muxinfo.cell_count  0  cell_count == 0) {
   --(cmux-n_active_circuits);
+  circuitmux_make_circuit_inactive(cmux, circ, direction);
 } else if (hashent-muxinfo.cell_count == 0  cell_count  0) {
   ++(cmux-n_active_circuits);
+  circuitmux_make_circuit_active(cmux, circ, direction);
 }
 cmux-n_cells -= hashent-muxinfo.cell_count;
 cmux-n_cells += cell_count;
 hashent-muxinfo.cell_count = cell_count;
-
-/* TODO update active_circuits / active_circuit_pqueue */
   } else {
 /*
  * New circuit; add an entry and update the circuit/active circuit
@@ -601,8 +642,6 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
   circuitmux_make_circuit_active(cmux, circ, direction);
 }
 cmux-n_cells += cell_count;
-
-/* TODO update active_circuits / active_circuit_pqueue */
   }
 }
 
@@ -651,9 +690,11 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
   if (hashent) {
 /* Update counters */
 --(cmux-n_circuits);
-if 

[tor-commits] [tor/master] Allocate and free circuit-specific policy data in the right places

2012-10-10 Thread andrea
commit 930e3d611a7983dc0d5558b21b79e81f72cb7158
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 12:00:21 2012 -0700

Allocate and free circuit-specific policy data in the right places
---
 src/or/circuitmux.c |   58 +-
 1 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 860ba64..5a5739f 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -260,7 +260,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
   if (to_remove-muxinfo.direction == CELL_DIRECTION_OUT) {
 /* Clear n_mux */
 circ-n_mux = NULL;
-/* Update active_circuits et al. */
+/*
+ * Update active_circuits et al.; this does policy notifies, so
+ * comes before freeing policy data
+ */
 circuitmux_make_circuit_inactive(cmux, circ, CELL_DIRECTION_OUT);
   } else if (circ-magic == OR_CIRCUIT_MAGIC) {
 /*
@@ -268,7 +271,10 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
  * so clear p_mux.
  */
 TO_OR_CIRCUIT(circ)-p_mux = NULL;
-/* Update active_circuits et al. */
+/*
+ * Update active_circuits et al.; this does policy notifies, so
+ * comes before freeing policy data
+ */
 circuitmux_make_circuit_inactive(cmux, circ, CELL_DIRECTION_IN);
   } else {
 /* Complain and move on */
@@ -278,6 +284,24 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
  to_remove-circ_id,
  U64_PRINTF_ARG(to_remove-chan_id));
   }
+
+
+  /* Free policy-specific data if we have it */
+  if (to_remove-muxinfo.policy_data) {
+/*
+ * If we have policy data, assert that we have the means to
+ * free it
+ */
+tor_assert(cmux-policy);
+tor_assert(cmux-policy_data);
+tor_assert(cmux-policy-free_circ_data);
+/* Call free_circ_data() */
+cmux-policy-free_circ_data(cmux,
+ cmux-policy_data,
+ circ,
+ to_remove-muxinfo.policy_data);
+to_remove-muxinfo.policy_data = NULL;
+  }
 } else {
   /* Complain and move on */
   log_warn(LD_CIRC,
@@ -293,6 +317,9 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
  to_remove-circ_id);
   }
 
+  /* Assert that we don't have un-freed policy data for this circuit */
+  tor_assert(to_remove-muxinfo.policy_data == NULL);
+
   /* Free it */
   tor_free(to_remove);
 }
@@ -620,6 +647,18 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
 hashent-circ_id = circ_id;
 hashent-muxinfo.cell_count = cell_count;
 hashent-muxinfo.direction = direction;
+/* Allocate policy specific circuit data if we need it */
+if (cmux-policy  cmux-policy_data 
+cmux-policy-alloc_circ_data) {
+  hashent-muxinfo.policy_data =
+cmux-policy-alloc_circ_data(cmux,
+  cmux-policy_data,
+  circ,
+  direction,
+  cell_count);
+  /* If we wanted policy data, it's an error  not to get any */
+  tor_assert(hashent-muxinfo.policy_data);
+}
 HT_INSERT(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
   hashent);
 
@@ -693,10 +732,25 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
 --(cmux-n_circuits);
 if (hashent-muxinfo.cell_count  0) {
   --(cmux-n_active_circuits);
+  /* This does policy notifies, so comes before freeing policy data */
   circuitmux_make_circuit_inactive(cmux, circ, last_searched_direction);
 }
 cmux-n_cells -= hashent-muxinfo.cell_count;
 
+/* Free policy-specific data if we have it */
+if (hashent-muxinfo.policy_data) {
+  /* If we have policy data, assert that we have the means to free it */
+  tor_assert(cmux-policy);
+  tor_assert(cmux-policy_data);
+  tor_assert(cmux-policy-free_circ_data);
+  /* Call free_circ_data() */
+  cmux-policy-free_circ_data(cmux,
+   cmux-policy_data,
+   circ,
+   hashent-muxinfo.policy_data);
+  hashent-muxinfo.policy_data = NULL;
+}
+
 /* Consistency check: the direction must match the direction searched */
 tor_assert(last_searched_direction == hashent-muxinfo.direction);
 /* Clear the circuit's mux for this direction */



___
tor-commits mailing list
tor-commits@lists.torproject.org

[tor-commits] [tor/master] Add cmux policy notify_set_n_cells() and notify_xmit_cells() callbacks

2012-10-10 Thread andrea
commit eade7a37cdc9c128d66d2c2c74d7056516fde364
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 12:20:05 2012 -0700

Add cmux policy notify_set_n_cells() and notify_xmit_cells() callbacks
---
 src/or/circuitmux.c |   13 +
 src/or/circuitmux.h |   11 +++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 5a5739f..53d3a1b 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -995,6 +995,19 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
   cmux-n_cells -= hashent-muxinfo.cell_count;
   cmux-n_cells += n_cells;
 
+  /* Do we need to notify a cmux policy? */
+  if (cmux-policy  cmux-policy_data 
+  cmux-policy-notify_set_n_cells) {
+/* Yeah; assert that we have circuit policy data */
+tor_assert(hashent-muxinfo.policy_data);
+/* ... and call notify_set_n_cells */
+cmux-policy-notify_set_n_cells(cmux,
+ cmux-policy_data,
+ circ,
+ hashent-muxinfo.policy_data,
+ n_cells);
+  }
+
   /*
* Update cmux active circuit counter: is the old cell count  0 and the
* new cell count == 0 ?
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index e344b6e..dcacb8e 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -42,6 +42,17 @@ struct circuitmux_policy_s {
circuitmux_policy_data_t *pol_data,
circuit_t *circ,
circuitmux_policy_circ_data_t *pol_circ_data);
+  /* Notify of arriving/transmitted cells on a circuit */
+  void (*notify_set_n_cells)(circuitmux_t *cmux,
+ circuitmux_policy_data_t *pol_data,
+ circuit_t *circ,
+ circuitmux_policy_circ_data_t *pol_circ_data,
+ unsigned int n_cells);
+  void (*notify_xmit_cells)(circuitmux_t *cmux,
+circuitmux_policy_data_t *pol_data,
+circuit_t *circ,
+circuitmux_policy_circ_data_t *pol_circ_data,
+unsigned int n_cells);
 };
 
 /*



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


[tor-commits] [tor/master] Implement circuitmux policy basic notifications mechanism

2012-10-10 Thread andrea
commit 851734d3245dfd56be02f6f4a78a3b776f4ebedc
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 11:38:27 2012 -0700

Implement circuitmux policy basic notifications mechanism
---
 src/or/circuitmux.c |   59 +-
 src/or/circuitmux.h |   57 +
 2 files changed, 100 insertions(+), 16 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 77bb568..860ba64 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -88,21 +88,14 @@ struct circuitmux_s {
   struct circuit_t *active_circuits_head, *active_circuits_tail;
 
   /*
-   * Priority queue of cell_ewma_t for circuits with queued cells waiting
-   * for room to free up on this connection's outbuf.  Kept in heap order
-   * according to EWMA.
-   *
-   * This is redundant with active_circuits; if we ever decide only to use
-   * the cell_ewma algorithm for choosing circuits, we can remove
-   * active_circuits.
+   * Circuitmux policy; if this is non-NULL, it can override the built-
+   * in round-robin active circuits behavior.  This is how EWMA works in
+   * the new circuitmux_t world.
*/
-  smartlist_t *active_circuit_pqueue;
+  const circuitmux_policy_t *policy;
 
-  /*
-   * The tick on which the cell_ewma_ts in active_circuit_pqueue last had
-   * their ewma values rescaled.
-   */
-  unsigned int active_circuit_pqueue_last_recalibrated;
+  /* Policy-specific data */
+  circuitmux_policy_data_t *policy_data;
 };
 
 /*
@@ -115,6 +108,8 @@ struct circuit_muxinfo_s {
   unsigned int cell_count;
   /* Direction of flow */
   cell_direction_t direction;
+  /* Policy-specific data */
+  circuitmux_policy_circ_data_t *policy_data;
 };
 
 /*
@@ -321,7 +316,13 @@ circuitmux_free(circuitmux_t *cmux)
   tor_assert(cmux-n_circuits == 0);
   tor_assert(cmux-n_active_circuits == 0);
 
-  smartlist_free(cmux-active_circuit_pqueue);
+  /* Free policy-specific data if we have any */
+  if (cmux-policy  cmux-policy-free_cmux_data) {
+if (cmux-policy_data) {
+  cmux-policy-free_cmux_data(cmux, cmux-policy_data);
+  cmux-policy_data = NULL;
+}
+  } else tor_assert(cmux-policy_data == NULL);
 
   if (cmux-chanid_circid_map) {
 HT_CLEAR(chanid_circid_muxinfo_map, cmux-chanid_circid_map);
@@ -718,6 +719,7 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, 
circuit_t *circ,
 {
   circuit_t **next_active = NULL, **prev_active = NULL, **next_prev = NULL;
   circuitmux_t *circuit_cmux = NULL;
+  chanid_circid_muxinfo_t *hashent = NULL;
   channel_t *chan = NULL;
   circid_t circ_id;
   int already_active;
@@ -782,7 +784,19 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, 
circuit_t *circ,
   /* This becomes the new head of the list */
   cmux-active_circuits_head = circ;
 
-  /* TODO policy-specific notifications */
+  /* Policy-specific notification */
+  if (cmux-policy 
+  cmux-policy-notify_circ_active 
+  cmux-policy_data) {
+/* Okay, we need to check the circuit for policy data now */
+hashent = circuitmux_find_map_entry(cmux, circ);
+/* We should have found something */
+tor_assert(hashent);
+/* Check for policy data for the circuit and notify */
+if (hashent-muxinfo.policy_data)
+  cmux-policy-notify_circ_active(cmux, cmux-policy_data,
+   circ, hashent-muxinfo.policy_data);
+  }
 }
 
 /**
@@ -797,6 +811,7 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, 
circuit_t *circ,
   circuit_t **next_active = NULL, **prev_active = NULL;
   circuit_t **next_prev = NULL, **prev_next = NULL;
   circuitmux_t *circuit_cmux = NULL;
+  chanid_circid_muxinfo_t *hashent = NULL;
   channel_t *chan = NULL;
   circid_t circ_id;
   int already_inactive;
@@ -878,7 +893,19 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, 
circuit_t *circ,
   *prev_active = NULL;
   *next_active = NULL;
 
-  /* TODO policy-specific notifications */
+  /* Policy-specific notification */
+  if (cmux-policy 
+  cmux-policy-notify_circ_inactive 
+  cmux-policy_data) {
+/* Okay, we need to check the circuit for policy data now */
+hashent = circuitmux_find_map_entry(cmux, circ);
+/* We should have found something */
+tor_assert(hashent);
+/* Check for policy data for the circuit and notify */
+if (hashent-muxinfo.policy_data)
+  cmux-policy-notify_circ_inactive(cmux, cmux-policy_data,
+ circ, hashent-muxinfo.policy_data);
+  }
 }
 
 /**
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index ade544f..e344b6e 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -11,6 +11,57 @@
 
 #include or.h
 
+typedef struct circuitmux_policy_s circuitmux_policy_t;
+typedef struct circuitmux_policy_data_s circuitmux_policy_data_t;
+typedef struct circuitmux_policy_circ_data_s circuitmux_policy_circ_data_t;
+
+struct circuitmux_policy_s {
+  /* Allocate cmux-wide policy-specific data */
+  

[tor-commits] [tor/master] Implement circuitmux_clear_policy(), circuitmux_get_policy() and circuitmux_set_policy() in circuitmux.c

2012-10-10 Thread andrea
commit 86d9d85dfc177b7a24051f64a5c35997de5c9ac9
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 13:42:47 2012 -0700

Implement circuitmux_clear_policy(), circuitmux_get_policy() and 
circuitmux_set_policy() in circuitmux.c
---
 src/or/circuitmux.c |  159 ++-
 1 files changed, 158 insertions(+), 1 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 53d3a1b..4e33569 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -343,7 +343,13 @@ circuitmux_free(circuitmux_t *cmux)
   tor_assert(cmux-n_circuits == 0);
   tor_assert(cmux-n_active_circuits == 0);
 
-  /* Free policy-specific data if we have any */
+  /*
+   * Free policy-specific data if we have any; we don't
+   * need to do circuitmux_set_policy(cmux, NULL) to cover
+   * the circuits because they would have been handled in
+   * circuitmux_detach_all_circuits() before this was
+   * called.
+   */
   if (cmux-policy  cmux-policy-free_cmux_data) {
 if (cmux-policy_data) {
   cmux-policy-free_cmux_data(cmux, cmux-policy_data);
@@ -360,6 +366,157 @@ circuitmux_free(circuitmux_t *cmux)
 }
 
 /*
+ * Circuitmux policy control functions
+ */
+
+/**
+ * Remove any policy installed on cmux; all policy data will be freed and
+ * cmux behavior will revert to the built-in round-robin active_circuits
+ * mechanism.
+ */
+
+void
+circuitmux_clear_policy(circuitmux_t *cmux)
+{
+  tor_assert(cmux);
+
+  /* Internally, this is just setting policy to NULL */
+  if (cmux-policy) {
+circuitmux_set_policy(cmux, NULL);
+  }
+}
+
+/**
+ * Return the policy currently installed on a circuitmux_t
+ */
+
+const circuitmux_policy_t *
+circuitmux_get_policy(circuitmux_t *cmux)
+{
+  tor_assert(cmux);
+
+  return cmux-policy;
+}
+
+/**
+ * Set policy; allocate for new policy, detach all circuits from old policy
+ * if any, attach them to new policy, and free old policy data.
+ */
+
+void
+circuitmux_set_policy(circuitmux_t *cmux,
+  const circuitmux_policy_t *pol)
+{
+  const circuitmux_policy_t *old_pol = NULL, *new_pol = NULL;
+  circuitmux_policy_data_t *old_pol_data = NULL, *new_pol_data = NULL;
+  chanid_circid_muxinfo_t **i = NULL;
+  channel_t *chan = NULL;
+  uint64_t last_chan_id_searched = 0;
+  circuit_t *circ = NULL;
+
+  tor_assert(cmux);
+
+  /* Set up variables */
+  old_pol = cmux-policy;
+  old_pol_data = cmux-policy_data;
+  new_pol = pol;
+
+  /* Check if this is the trivial case */
+  if (old_pol == new_pol) return;
+
+  /* Allocate data for new policy, if any */
+  if (new_pol  new_pol-alloc_cmux_data) {
+/*
+ * If alloc_cmux_data is not null, then we expect to get some policy
+ * data.  Assert that we also have free_cmux_data so we can free it
+ * when the time comes, and allocate it.
+ */
+tor_assert(new_pol-free_cmux_data);
+new_pol_data = new_pol-alloc_cmux_data(cmux);
+tor_assert(new_pol_data);
+  }
+
+  /* Install new policy and new policy data on cmux */
+  cmux-policy = new_pol;
+  cmux-policy_data = new_pol_data;
+
+  /* Iterate over all circuits, attaching/detaching each one */
+  i = HT_START(chanid_circid_muxinfo_map, cmux-chanid_circid_map);
+  while (i) {
+/* Assert that this entry isn't NULL */
+tor_assert(*i);
+
+/*
+ * Get the channel; since normal case is all circuits on the mux share a
+ * channel, we cache last_chan_id_searched
+ */
+if (!chan || last_chan_id_searched != (*i)-chan_id) {
+  chan = channel_find_by_global_id((*i)-chan_id);
+  last_chan_id_searched = (*i)-chan_id;
+}
+tor_assert(chan);
+
+/* Get the circuit */
+circ = circuit_get_by_circid_channel((*i)-circ_id, chan);
+tor_assert(circ);
+
+/* Need to tell old policy it becomes inactive (i.e., it is active) ? */
+if (old_pol  old_pol-notify_circ_inactive 
+(*i)-muxinfo.cell_count  0) {
+  old_pol-notify_circ_inactive(cmux, old_pol_data, circ,
+(*i)-muxinfo.policy_data);
+}
+
+/* Need to free old policy data? */
+if ((*i)-muxinfo.policy_data) {
+  /* Assert that we have the means to free it if we have policy data */
+  tor_assert(old_pol);
+  tor_assert(old_pol-free_circ_data);
+  /* Free it */
+  old_pol-free_circ_data(cmux, old_pol_data, circ,
+ (*i)-muxinfo.policy_data);
+  (*i)-muxinfo.policy_data = NULL;
+}
+
+/* Need to allocate new policy data? */
+if (new_pol  new_pol-alloc_circ_data) {
+  /*
+   * If alloc_circ_data is not null, we expect to get some per-circuit
+   * policy data.  Assert that we also have free_circ_data so we can
+   * free it when the time comes, and allocate it.
+   */
+  tor_assert(new_pol-free_circ_data);
+  (*i)-muxinfo.policy_data =
+new_pol-alloc_circ_data(cmux, new_pol_data, circ,
+ (*i)-muxinfo.direction,
+  

[tor-commits] [tor/master] Implement circuitmux_notify_xmit_cells() and circuitmux_move_active_circ_to_tail() helper in circuitmux.c

2012-10-10 Thread andrea
commit aff77eb1a9dcbdf723d3f8e74e6502e5047bbe63
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 15:04:46 2012 -0700

Implement circuitmux_notify_xmit_cells() and 
circuitmux_move_active_circ_to_tail() helper in circuitmux.c
---
 src/or/circuitmux.c |  133 +++
 1 files changed, 133 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index b5dda9e..deb5bf1 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -141,6 +141,9 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, 
circuit_t *circ,
 static void
 circuitmux_make_circuit_inactive(circuitmux_t *cmux, circuit_t *circ,
  cell_direction_t direction);
+static INLINE void
+circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, circuit_t *circ,
+cell_direction_t direction);
 static INLINE circuit_t **
 circuitmux_next_active_circ_p(circuitmux_t *cmux, circuit_t *circ);
 static INLINE circuit_t **
@@ -152,6 +155,72 @@ circuitmux_prev_active_circ_p(circuitmux_t *cmux, 
circuit_t *circ);
  * Linked list helpers
  */
 
+static INLINE void
+circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, circuit_t *circ,
+cell_direction_t direction)
+{
+  circuit_t **next_p = NULL, **prev_p = NULL;
+  circuit_t **next_prev = NULL, **prev_next = NULL;
+  or_circuit_t *or_circ = NULL;
+
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  /* Figure out our next_p and prev_p for this cmux/direction */
+  if (direction) {
+if (direction == CELL_DIRECTION_OUT) {
+  tor_assert(circ-n_mux == cmux);
+  next_p = (circ-next_active_on_n_chan);
+  prev_p = (circ-prev_active_on_n_chan);
+} else {
+  or_circ = TO_OR_CIRCUIT(circ);
+  tor_assert(or_circ-p_mux == cmux);
+  next_p = (or_circ-next_active_on_p_chan);
+  prev_p = (or_circ-prev_active_on_p_chan);
+}
+  } else {
+if (circ-n_mux == cmux) {
+  next_p = (circ-next_active_on_n_chan);
+  prev_p = (circ-prev_active_on_n_chan);
+  direction = CELL_DIRECTION_OUT;
+} else {
+  or_circ = TO_OR_CIRCUIT(circ);
+  tor_assert(or_circ-p_mux == cmux);
+  next_p = (or_circ-next_active_on_p_chan);
+  prev_p = (or_circ-prev_active_on_p_chan);
+  direction = CELL_DIRECTION_IN;
+}
+  }
+  tor_assert(next_p);
+  tor_assert(prev_p);
+
+  /* Check if this really is an active circuit */
+  if ((*next_p == NULL  *prev_p == NULL) 
+  !(circ == cmux-active_circuits_head ||
+circ == cmux-active_circuits_tail)) {
+/* Not active, no-op */
+return;
+  }
+
+  /* Check if this is already the tail */
+  if (circ == cmux-active_circuits_tail) return;
+
+  /* Okay, we have to move it; figure out next_prev and prev_next */
+  if (*next_p) next_prev = circuitmux_prev_active_circ_p(cmux, *next_p);
+  if (*prev_p) prev_next = circuitmux_next_active_circ_p(cmux, *prev_p);
+  /* Adjust the previous node's next pointer, if any */
+  if (prev_next) *prev_next = *next_p;
+  /* Otherwise, we were the head */
+  else cmux-active_circuits_head = *next_p;
+  /* Adjust the next node's previous pointer, if any */
+  if (next_prev) *next_prev = *prev_p;
+  /* Adjust our next and prev pointers */
+  *next_p = NULL;
+  *prev_p = cmux-active_circuits_tail;
+  /* Set the tail to this circuit */
+  cmux-active_circuits_tail = circ;
+}
+
 static INLINE circuit_t **
 circuitmux_next_active_circ_p(circuitmux_t *cmux, circuit_t *circ)
 {
@@ -1175,3 +1244,67 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
   hashent-muxinfo.cell_count = n_cells;
 }
 
+/*
+ * Functions for channel code to call to get a circuit to transmit from or
+ * notify that cells have been transmitted.
+ */
+
+void
+circuitmux_notify_xmit_cells(circuitmux_t *cmux, circuit_t *circ,
+ unsigned int n_cells)
+{
+  chanid_circid_muxinfo_t *hashent = NULL;
+  int becomes_inactive = 0;
+
+  tor_assert(cmux);
+  tor_assert(circ);
+
+  if (n_cells == 0) return;
+
+  /*
+   * To handle this, we have to:
+   *
+   * 1.) Adjust the circuit's cell counter in the cmux hash table
+   * 2.) Move the circuit to the tail of the active_circuits linked list
+   * for this cmux, or make the circuit inactive if the cell count
+   * went to zero.
+   * 3.) Call cmux-policy-notify_xmit_cells(), if any
+   */
+
+  /* Find the hash entry */
+  hashent = circuitmux_find_map_entry(cmux, circ);
+  /* Assert that we found one */
+  tor_assert(hashent);
+
+  /* Adjust the cell counter and assert that we had that many cells to send */
+  tor_assert(n_cells = hashent-muxinfo.cell_count);
+  hashent-muxinfo.cell_count -= n_cells;
+  /* Do we need to make the circuit inactive? */
+  if (hashent-muxinfo.cell_count == 0) becomes_inactive = 1;
+
+  /* If we aren't making it inactive later, move it to the tail of the list */
+  if (!becomes_inactive) {
+

[tor-commits] [tor/master] Implement circuitmux_get_first_active_circuit() in circuitmux.c; add pick_active_circuit() to circuitmux_policy_t in circuitmux.h

2012-10-10 Thread andrea
commit 4a14c6aa67df6ced083e2d6a6e66dbf443a40e75
Author: Andrea Shepard and...@torproject.org
Date:   Fri Sep 28 16:56:46 2012 -0700

Implement circuitmux_get_first_active_circuit() in circuitmux.c; add 
pick_active_circuit() to circuitmux_policy_t in circuitmux.h
---
 src/or/circuitmux.c |   32 ++--
 src/or/circuitmux.h |3 +++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 824bf0b..4500c6a 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -359,7 +359,6 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
  U64_PRINTF_ARG(to_remove-chan_id));
   }
 
-
   /* Free policy-specific data if we have it */
   if (to_remove-muxinfo.policy_data) {
 /*
@@ -1255,6 +1254,35 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
  */
 
 /**
+ * Pick a circuit to send from, using the active circuits list or a
+ * circuitmux policy if one is available.  This is called from channel.c.
+ */
+
+circuit_t *
+circuitmux_get_first_active_circuit(circuitmux_t *cmux)
+{
+  circuit_t *circ = NULL;
+
+  tor_assert(cmux);
+
+  if (cmux-n_active_circuits  0) {
+/* We also must have a cell available for this to be the case */
+tor_assert(cmux-n_cells  0);
+/* Do we have a policy-provided circuit selector? */
+if (cmux-policy  cmux-policy-pick_active_circuit) {
+  circ = cmux-policy-pick_active_circuit(cmux, cmux-policy_data);
+}
+/* Fall back on the head of the active circuits list */
+if (!circ) {
+  tor_assert(cmux-active_circuits_head);
+  circ = cmux-active_circuits_head;
+}
+  } else tor_assert(cmux-n_cells == 0);
+
+  return circ;
+}
+
+/**
  * Notify the circuitmux that cells have been sent on a circuit; this
  * is called from channel.c.
  */
@@ -1310,7 +1338,7 @@ circuitmux_notify_xmit_cells(circuitmux_t *cmux, 
circuit_t *circ,
 
   /*
* Now make the circuit inactive if needed; this will call the policy's
-   * notify_circ_inactive() if present. 
+   * notify_circ_inactive() if present.
*/
   if (becomes_inactive) {
 --(cmux-n_active_circuits);
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index dcacb8e..f4eb73e 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -53,6 +53,9 @@ struct circuitmux_policy_s {
 circuit_t *circ,
 circuitmux_policy_circ_data_t *pol_circ_data,
 unsigned int n_cells);
+  /* Choose a circuit */
+  circuit_t * (*pick_active_circuit)(circuitmux_t *cmux,
+ circuitmux_policy_data_t *pol_data);
 };
 
 /*



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


[tor-commits] [tor/master] Add comment for circuitmux_notify_xmit_cells() in circuitmux.c

2012-10-10 Thread andrea
commit c4e5e4727ddcf639a3a50856f74f24f373262baf
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 15:17:48 2012 -0700

Add comment for circuitmux_notify_xmit_cells() in circuitmux.c
---
 src/or/circuitmux.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index c01f38f..824bf0b 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -1254,6 +1254,11 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
  * notify that cells have been transmitted.
  */
 
+/**
+ * Notify the circuitmux that cells have been sent on a circuit; this
+ * is called from channel.c.
+ */
+
 void
 circuitmux_notify_xmit_cells(circuitmux_t *cmux, circuit_t *circ,
  unsigned int n_cells)



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


[tor-commits] [tor/master] Consistently allow policy alloc_cmux_data() and alloc_circ_data() functions to return NULL if the policy does not use this in circuitmux.c

2012-10-10 Thread andrea
commit debef8f0cd8fbe72fb40bd811c636bb66c7a9001
Author: Andrea Shepard and...@torproject.org
Date:   Thu Sep 27 13:51:04 2012 -0700

Consistently allow policy alloc_cmux_data() and alloc_circ_data() functions 
to return NULL if the policy does not use this in circuitmux.c
---
 src/or/circuitmux.c |   35 ++-
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 4e33569..b5dda9e 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -293,7 +293,6 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
  * free it
  */
 tor_assert(cmux-policy);
-tor_assert(cmux-policy_data);
 tor_assert(cmux-policy-free_circ_data);
 /* Call free_circ_data() */
 cmux-policy-free_circ_data(cmux,
@@ -805,8 +804,10 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
 hashent-muxinfo.cell_count = cell_count;
 hashent-muxinfo.direction = direction;
 /* Allocate policy specific circuit data if we need it */
-if (cmux-policy  cmux-policy_data 
-cmux-policy-alloc_circ_data) {
+if (cmux-policy  cmux-policy-alloc_circ_data) {
+  /* Assert that we have the means to free policy-specific data */
+  tor_assert(cmux-policy-free_circ_data);
+  /* Allocate it */
   hashent-muxinfo.policy_data =
 cmux-policy-alloc_circ_data(cmux,
   cmux-policy_data,
@@ -898,7 +899,6 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
 if (hashent-muxinfo.policy_data) {
   /* If we have policy data, assert that we have the means to free it */
   tor_assert(cmux-policy);
-  tor_assert(cmux-policy_data);
   tor_assert(cmux-policy-free_circ_data);
   /* Call free_circ_data() */
   cmux-policy-free_circ_data(cmux,
@@ -997,16 +997,14 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, 
circuit_t *circ,
 
   /* Policy-specific notification */
   if (cmux-policy 
-  cmux-policy-notify_circ_active 
-  cmux-policy_data) {
+  cmux-policy-notify_circ_active) {
 /* Okay, we need to check the circuit for policy data now */
 hashent = circuitmux_find_map_entry(cmux, circ);
 /* We should have found something */
 tor_assert(hashent);
-/* Check for policy data for the circuit and notify */
-if (hashent-muxinfo.policy_data)
-  cmux-policy-notify_circ_active(cmux, cmux-policy_data,
-   circ, hashent-muxinfo.policy_data);
+/* Notify */
+cmux-policy-notify_circ_active(cmux, cmux-policy_data,
+ circ, hashent-muxinfo.policy_data);
   }
 }
 
@@ -1106,16 +1104,14 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, 
circuit_t *circ,
 
   /* Policy-specific notification */
   if (cmux-policy 
-  cmux-policy-notify_circ_inactive 
-  cmux-policy_data) {
+  cmux-policy-notify_circ_inactive) {
 /* Okay, we need to check the circuit for policy data now */
 hashent = circuitmux_find_map_entry(cmux, circ);
 /* We should have found something */
 tor_assert(hashent);
-/* Check for policy data for the circuit and notify */
-if (hashent-muxinfo.policy_data)
-  cmux-policy-notify_circ_inactive(cmux, cmux-policy_data,
- circ, hashent-muxinfo.policy_data);
+/* Notify */
+cmux-policy-notify_circ_inactive(cmux, cmux-policy_data,
+   circ, hashent-muxinfo.policy_data);
   }
 }
 
@@ -1153,11 +1149,8 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
   cmux-n_cells += n_cells;
 
   /* Do we need to notify a cmux policy? */
-  if (cmux-policy  cmux-policy_data 
-  cmux-policy-notify_set_n_cells) {
-/* Yeah; assert that we have circuit policy data */
-tor_assert(hashent-muxinfo.policy_data);
-/* ... and call notify_set_n_cells */
+  if (cmux-policy  cmux-policy-notify_set_n_cells) {
+/* Call notify_set_n_cells */
 cmux-policy-notify_set_n_cells(cmux,
  cmux-policy_data,
  circ,



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


[tor-commits] [tor/master] Add upcasts for circuitmux_policy_data_t and circuitmux_policy_circ_data_t to circuitmux.h

2012-10-10 Thread andrea
commit e1de2f1437ffe67ee0ae74ae6ac1d432f3981542
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:48:52 2012 -0700

Add upcasts for circuitmux_policy_data_t and circuitmux_policy_circ_data_t 
to circuitmux.h
---
 src/or/circuitmux.h |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index f4eb73e..a3eacaf 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -76,6 +76,23 @@ struct circuitmux_policy_circ_data_s {
   uint32_t magic;
 };
 
+/*
+ * Upcast #defines for the above types
+ */
+
+/**
+ * Convert a circuitmux_policy_data_t subtype to a circuitmux_policy_data_t.
+ */
+
+#define TO_CMUX_POL_DATA(x)  (((x)-_base))
+
+/**
+ * Convert a circuitmux_policy_circ_data_t subtype to a
+ * circuitmux_policy_circ_data_t.
+ */
+
+#define TO_CMUX_POL_CIRC_DATA(x)  (((x)-_base))
+
 /* Consistency check */
 void circuitmux_assert_okay(circuitmux_t *cmux);
 



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


[tor-commits] [tor/master] Update circuitmux-related TODOs in channeltls.c

2012-10-10 Thread andrea
commit 60ec46a2ec6fef36ec1891e89e0d73572eb60bfd
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:59:40 2012 -0700

Update circuitmux-related TODOs in channeltls.c
---
 src/or/channeltls.c |   10 ++
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 036d14f..bc7e3ec 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -129,10 +129,7 @@ channel_tls_connect(const tor_addr_t *addr, uint16_t port,
   channel_mark_outgoing(chan);
 
   chan-cmux = circuitmux_alloc();
-  /* TODO get rid of this and set policy once we have them
-  chan-cmux-active_circuit_pqueue_last_recalibrated =
-cell_ewma_get_tick();
-   */
+  /* TODO set cmux policy */
 
   /* Set up or_connection stuff */
   tlschan-conn = connection_or_connect(addr, port, id_digest, tlschan);
@@ -265,10 +262,7 @@ channel_tls_handle_incoming(or_connection_t *orconn)
   channel_mark_incoming(chan);
 
   chan-cmux = circuitmux_alloc();
-  /* TODO set cmux policy 
-  chan-active_circuit_pqueue_last_recalibrated =
-cell_ewma_get_tick();
-   */
+  /* TODO set cmux policy */
 
   /* If we got one, we should register it */
   if (chan) channel_register(chan);



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


[tor-commits] [tor/master] Add circuitmux.h, circuitmux_ewma.h includes now necessary in config.c

2012-10-10 Thread andrea
commit 5f9d37e74ec269be8d496e8e0d4157875ff1fe59
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:52:39 2012 -0700

Add circuitmux.h, circuitmux_ewma.h includes now necessary in config.c
---
 src/or/config.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index bac2b2e..babbfb0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -14,6 +14,8 @@
 #include or.h
 #include circuitbuild.h
 #include circuitlist.h
+#include circuitmux.h
+#include circuitmux_ewma.h
 #include config.h
 #include connection.h
 #include connection_edge.h



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


[tor-commits] [tor/master] Add initial circuitmux_ewma.{c,h}

2012-10-10 Thread andrea
commit 184560c4f6fa8262fe1316d5e169a16b47b11e6b
Author: Andrea Shepard and...@torproject.org
Date:   Sun Sep 30 21:41:25 2012 -0700

Add initial circuitmux_ewma.{c,h}
---
 src/or/Makefile.nmake|   16 
 src/or/circuitmux_ewma.c |   12 
 src/or/circuitmux_ewma.h |   18 ++
 src/or/include.am|2 ++
 4 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/src/or/Makefile.nmake b/src/or/Makefile.nmake
index 9f948d6..677618e 100644
--- a/src/or/Makefile.nmake
+++ b/src/or/Makefile.nmake
@@ -9,14 +9,14 @@ LIBS = ..\..\..\build-alpha\lib\libevent.a \
  ws2_32.lib advapi32.lib shell32.lib
 
 LIBTOR_OBJECTS = buffers.obj channel.obj channeltls.obj circuitbuild.obj \
-   circuitlist.obj circuitmux.obj circuituse.obj command.obj config.obj \
-   connection.obj connection_edge.obj connection_or.obj control.obj \
-   cpuworker.obj directory.obj dirserv.obj dirvote.obj dns.obj \
-   dnsserv.obj geoip.obj hibernate.obj main.obj microdesc.obj \
-   networkstatus.obj nodelist.obj onion.obj policies.obj reasons.obj \
-   relay.obj rendclient.obj rendcommon.obj rendmid.obj rendservice.obj \
-   rephist.obj router.obj routerlist.obj routerparse.obj status.obj \
-   config_codedigest.obj ntmain.obj
+   circuitlist.obj circuitmux.obj circuitmux_ewma.obj circuituse.obj \
+   command.obj config.obj connection.obj connection_edge.obj \
+   connection_or.obj control.obj cpuworker.obj directory.obj \
+   dirserv.obj dirvote.obj dns.obj dnsserv.obj geoip.obj hibernate.obj \
+   main.obj microdesc.obj networkstatus.obj nodelist.obj onion.obj \
+   policies.obj reasons.obj relay.obj rendclient.obj rendcommon.obj \
+   rendmid.obj rendservice.obj rephist.obj router.obj routerlist.obj \
+   routerparse.obj status.obj config_codedigest.obj ntmain.obj
 
 libtor.lib: $(LIBTOR_OBJECTS)
lib $(LIBTOR_OBJECTS) /out:libtor.lib
diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c
new file mode 100644
index 000..b31e908
--- /dev/null
+++ b/src/or/circuitmux_ewma.c
@@ -0,0 +1,12 @@
+/* * Copyright (c) 2012, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file circuitmux_ewma.c
+ * \brief EWMA circuit selection as a circuitmux_t policy
+ **/
+
+#include or.h
+#include circuitmux.h
+#include circuitmux_ewma.h
+
diff --git a/src/or/circuitmux_ewma.h b/src/or/circuitmux_ewma.h
new file mode 100644
index 000..fcbe298
--- /dev/null
+++ b/src/or/circuitmux_ewma.h
@@ -0,0 +1,18 @@
+/* * Copyright (c) 2012, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file circuitmux_ewma.h
+ * \brief Header file for circuitmux_ewma.c
+ **/
+
+#ifndef _TOR_CIRCUITMUX_EWMA_H
+#define _TOR_CIRCUITMUX_EWMA_H
+
+#include or.h
+#include circuitmux.h
+
+/* TODO */
+
+#endif /* _TOR_CIRCUITMUX_EWMA_H */
+
diff --git a/src/or/include.am b/src/or/include.am
index 3ec94e5..90dea44 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -22,6 +22,7 @@ src_or_libtor_a_SOURCES = \
src/or/circuitbuild.c   \
src/or/circuitlist.c\
src/or/circuitmux.c \
+   src/or/circuitmux_ewma.c\
src/or/circuituse.c \
src/or/command.c\
src/or/config.c \
@@ -94,6 +95,7 @@ ORHEADERS = \
src/or/circuitbuild.h   \
src/or/circuitlist.h\
src/or/circuitmux.h \
+   src/or/circuitmux_ewma.h\
src/or/circuituse.h \
src/or/command.h\
src/or/config.h \



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


[tor-commits] [tor/master] Remove EWMA code from relay.{c,h}; it goes to a circuitmux policy now

2012-10-10 Thread andrea
commit 14fe0d585916f4d8fdba64b419778c47ffd64b16
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:51:31 2012 -0700

Remove EWMA code from relay.{c,h}; it goes to a circuitmux policy now
---
 src/or/relay.c |  332 
 src/or/relay.h |3 -
 2 files changed, 0 insertions(+), 335 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index e3b383b..d034162 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -10,7 +10,6 @@
  *receiving from circuits, plus queuing on circuits.
  **/
 
-#include math.h
 #define RELAY_PRIVATE
 #include or.h
 #include buffers.h
@@ -1972,245 +1971,6 @@ cell_queue_pop(cell_queue_t *queue)
   return cell;
 }
 
-#if 0
-/** Helper for sorting cell_ewma_t values in their priority queue. */
-static int
-compare_cell_ewma_counts(const void *p1, const void *p2)
-{
-  const cell_ewma_t *e1=p1, *e2=p2;
-  if (e1-cell_count  e2-cell_count)
-return -1;
-  else if (e1-cell_count  e2-cell_count)
-return 1;
-  else
-return 0;
-}
-
-/** Given a cell_ewma_t, return a pointer to the circuit containing it. */
-static circuit_t *
-cell_ewma_to_circuit(cell_ewma_t *ewma)
-{
-  if (ewma-is_for_p_chan) {
-/* This is an or_circuit_t's p_cell_ewma. */
-or_circuit_t *orcirc = SUBTYPE_P(ewma, or_circuit_t, p_cell_ewma);
-return TO_CIRCUIT(orcirc);
-  } else {
-/* This is some circuit's n_cell_ewma. */
-return SUBTYPE_P(ewma, circuit_t, n_cell_ewma);
-  }
-}
-
-/*  Functions for scaling cell_ewma_t 
-
-   When choosing which cells to relay first, we favor circuits that have been
-   quiet recently.  This gives better latency on connections that aren't
-   pushing lots of data, and makes the network feel more interactive.
-
-   Conceptually, we take an exponentially weighted mean average of the number
-   of cells a circuit has sent, and allow active circuits (those with cells to
-   relay) to send cells in reverse order of their exponentially-weighted mean
-   average (EWMA) cell count.  [That is, a cell sent N seconds ago 'counts'
-   F^N times as much as a cell sent now, for 0F1.0, and we favor the
-   circuit that has sent the fewest cells]
-
-   If 'double' had infinite precision, we could do this simply by counting a
-   cell sent at startup as having weight 1.0, and a cell sent N seconds later
-   as having weight F^-N.  This way, we would never need to re-scale
-   any already-sent cells.
-
-   To prevent double from overflowing, we could count a cell sent now as
-   having weight 1.0 and a cell sent N seconds ago as having weight F^N.
-   This, however, would mean we'd need to re-scale *ALL* old circuits every
-   time we wanted to send a cell.
-
-   So as a compromise, we divide time into 'ticks' (currently, 10-second
-   increments) and say that a cell sent at the start of a current tick is
-   worth 1.0, a cell sent N seconds before the start of the current tick is
-   worth F^N, and a cell sent N seconds after the start of the current tick is
-   worth F^-N.  This way we don't overflow, and we don't need to constantly
-   rescale.
- */
-
-/** How long does a tick last (seconds)? */
-#define EWMA_TICK_LEN 10
-
-/** The default per-tick scale factor, if it hasn't been overridden by a
- * consensus or a configuration setting.  zero means disabled. */
-#define EWMA_DEFAULT_HALFLIFE 0.0
-
-/** Given a timeval bnow/b, compute the cell_ewma tick in which it occurs
- * and the fraction of the tick that has elapsed between the start of the tick
- * and bnow/b.  Return the former and store the latter in
- * *bremainder_out/b.
- *
- * These tick values are not meant to be shared between Tor instances, or used
- * for other purposes. */
-static unsigned
-cell_ewma_tick_from_timeval(const struct timeval *now,
-double *remainder_out)
-{
-  unsigned res = (unsigned) (now-tv_sec / EWMA_TICK_LEN);
-  /* rem */
-  double rem = (now-tv_sec % EWMA_TICK_LEN) +
-((double)(now-tv_usec)) / 1.0e6;
-  *remainder_out = rem / EWMA_TICK_LEN;
-  return res;
-}
-
-/** Compute and return the current cell_ewma tick. */
-unsigned
-cell_ewma_get_tick(void)
-{
-  return ((unsigned)approx_time() / EWMA_TICK_LEN);
-}
-
-/** The per-tick scale factor to be used when computing cell-count EWMA
- * values.  (A cell sent N ticks before the start of the current tick
- * has value ewma_scale_factor ** N.)
- */
-static double ewma_scale_factor = 0.1;
-/* DOCDOC ewma_enabled */
-static int ewma_enabled = 0;
-
-/*DOCDOC*/
-#define EPSILON 0.1
-/*DOCDOC*/
-#define LOG_ONEHALF -0.69314718055994529
-
-/** Adjust the global cell scale factor based on boptions/b */
-void
-cell_ewma_set_scale_factor(const or_options_t *options,
-   const networkstatus_t *consensus)
-{
-  int32_t halflife_ms;
-  double halflife;
-  const char *source;
-  if (options  options-CircuitPriorityHalflife = -EPSILON) {
-halflife = options-CircuitPriorityHalflife;
-source = 

[tor-commits] [tor/master] Fix circuitmux attach/detach logic in circuit_set_circid_chan_helper(); it's possible for id to be zero (not assigned yet) and shouldn't be attached then

2012-10-10 Thread andrea
commit 96a6eff8fe59325e58f0aa7eec7efece36980099
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 10:39:40 2012 -0700

Fix circuitmux attach/detach logic in circuit_set_circid_chan_helper(); 
it's possible for id to be zero (not assigned yet) and shouldn't be attached 
then
---
 src/or/circuitlist.c |   32 +---
 1 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index cfef0aa..a4dcec6 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -100,7 +100,7 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
   chan_circid_circuit_map_t *found;
   channel_t *old_chan, **chan_ptr;
   circid_t old_id, *circid_ptr;
-  int was_active, make_active;
+  int was_active, make_active, attached = 0;
 
   if (direction == CELL_DIRECTION_OUT) {
 chan_ptr = circ-n_chan;
@@ -128,7 +128,19 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
 _last_circid_chan_ent = NULL;
   }
 
-  if (old_chan) { /* we may need to remove it from the conn-circid map */
+  if (old_chan) {
+/*
+ * If we're changing channels or ID and had an old channel and a non
+ * zero old ID (i.e., we should have been attached), detach the circuit.
+ * ID changes require this because circuitmux hashes on (channel_id,
+ * circuit_id).
+ */
+if (id != 0  (old_chan != chan || old_id != id)) {
+  tor_assert(old_chan-cmux);
+  circuitmux_detach_circuit(old_chan-cmux, circ);
+}
+
+/* we may need to remove it from the conn-circid map */
 search.circ_id = old_id;
 search.chan = old_chan;
 found = HT_REMOVE(chan_circid_map, chan_circid_map, search);
@@ -142,12 +154,6 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
 --(old_chan-num_p_circuits);
   }
 }
-
-/* If we're changing channels, detach the circuit */
-if (old_chan != chan) {
-  tor_assert(old_chan-cmux);
-  circuitmux_detach_circuit(old_chan-cmux, circ);
-}
   }
 
   /* Change the values only after we have possibly made the circuit inactive
@@ -172,17 +178,21 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
 HT_INSERT(chan_circid_map, chan_circid_map, found);
   }
 
-  /* Attach to the circuitmux if we're changing channels */
-  if (old_chan != chan) {
+  /*
+   * Attach to the circuitmux if we're changing channels or IDs and
+   * have a new channel and ID to use.
+   */
+  if (chan  id != 0  (old_chan != chan || old_id != id)) {
 tor_assert(chan-cmux);
 circuitmux_attach_circuit(chan-cmux, circ, direction);
+attached = 1;
   }
 
   /*
* This is a no-op if we have no cells, but if we do it marks us active to
* the circuitmux
*/
-  if (make_active  old_chan != chan)
+  if (make_active  attached)
 update_circuit_on_cmux(circ, direction);
 
   /* Adjust circuit counts on new channel */



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


[tor-commits] [tor/master] Remove ewma setup code in init_circuit_base()/or_circuit_new() of circuitlist.c; it gets allocated when the circuit is attached to a circuitmux_t with that policy now

2012-10-10 Thread andrea
commit b7d5784c542f180c0fe7dc6ba999415cdbef3abe
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:50:05 2012 -0700

Remove ewma setup code in init_circuit_base()/or_circuit_new() of 
circuitlist.c; it gets allocated when the circuit is attached to a circuitmux_t 
with that policy now
---
 src/or/circuitlist.c |   16 
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index bec3dc8..cfef0aa 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -546,12 +546,6 @@ init_circuit_base(circuit_t *circ)
   circ-package_window = circuit_initial_package_window();
   circ-deliver_window = CIRCWINDOW_START;
 
-  /* Initialize the cell_ewma_t structure */
-  circ-n_cell_ewma.last_adjusted_tick = cell_ewma_get_tick();
-  circ-n_cell_ewma.cell_count = 0.0;
-  circ-n_cell_ewma.heap_index = -1;
-  circ-n_cell_ewma.is_for_p_chan = 0;
-
   circuit_add(circ);
 }
 
@@ -599,16 +593,6 @@ or_circuit_new(circid_t p_circ_id, channel_t *p_chan)
 
   init_circuit_base(TO_CIRCUIT(circ));
 
-  /* Initialize the cell_ewma_t structure */
-
-  /* Initialize the cell counts to 0 */
-  circ-p_cell_ewma.cell_count = 0.0;
-  circ-p_cell_ewma.last_adjusted_tick = cell_ewma_get_tick();
-  circ-p_cell_ewma.is_for_p_chan = 1;
-
-  /* It's not in any heap yet. */
-  circ-p_cell_ewma.heap_index = -1;
-
   return circ;
 }
 



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


[tor-commits] [tor/master] Fix comment on circuit_t.n_hop and remove circuitmux TODO in or.h

2012-10-10 Thread andrea
commit 2565710fd72f6f6ddf42e049c0973b848a86719e
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:58:13 2012 -0700

Fix comment on circuit_t.n_hop and remove circuitmux TODO in or.h
---
 src/or/or.h |   10 +-
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/src/or/or.h b/src/or/or.h
index dad81ed..96e0299 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2634,15 +2634,7 @@ typedef struct circuit_t {
 
   /**
* The hop to which we want to extend this circuit.  Should be NULL if
-   * the circuit has attached to a connection.
-   *
-   * TODO:
-   *  - If this is NULL, we have extended.  Is it true that if this is
-   *NULL then n_chan is not NULL?
-   *  - If n_chan is NULL, then what is n_circ_id?
-   *  - It doesn't matter, because we'll only ever attach to a circuitmux_t
-   *when n_chan is not NULL, and that's what needs to use a unique ID
-   *for circuits.
+   * the circuit has attached to a channel.
*/
   extend_info_t *n_hop;
 



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


[tor-commits] [tor/master] Add circuitmux.h, circuitmux_ewma.h includes now necessary in networkstatus.c

2012-10-10 Thread andrea
commit 0af2eab9a2698e6a50aec4238fc529f152b77a89
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:53:59 2012 -0700

Add circuitmux.h, circuitmux_ewma.h includes now necessary in 
networkstatus.c
---
 src/or/networkstatus.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 0cc6a21..619099b 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -12,6 +12,8 @@
 
 #include or.h
 #include circuitbuild.h
+#include circuitmux.h
+#include circuitmux_ewma.h
 #include config.h
 #include connection.h
 #include connection_or.h



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


[tor-commits] [tor/master] Adjust the circuitmux_t counter correctly in circuitmux_notify_xmit_cells()

2012-10-10 Thread andrea
commit 7598e669e866f2c1aa61e430c86a06f10dd03cc6
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 10:58:27 2012 -0700

Adjust the circuitmux_t counter correctly in circuitmux_notify_xmit_cells()
---
 src/or/circuitmux.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index b16eb63..fd59840 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -1324,6 +1324,8 @@ circuitmux_notify_xmit_cells(circuitmux_t *cmux, 
circuit_t *circ,
   hashent-muxinfo.cell_count -= n_cells;
   /* Do we need to make the circuit inactive? */
   if (hashent-muxinfo.cell_count == 0) becomes_inactive = 1;
+  /* Adjust the mux cell counter */
+  cmux-n_cells -= n_cells;
 
   /* If we aren't making it inactive later, move it to the tail of the list */
   if (!becomes_inactive) {



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


[tor-commits] [tor/master] Remove cell_ewma_t from or.h and from circuit_t/or_circuit_t; all that goes to the new circuitmux_ewma.c now

2012-10-10 Thread andrea
commit d194b8602ae0bcf6ffe711903b110193bdbcbab4
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 01:53:24 2012 -0700

Remove cell_ewma_t from or.h and from circuit_t/or_circuit_t; all that goes 
to the new circuitmux_ewma.c now
---
 src/or/or.h |   36 
 1 files changed, 0 insertions(+), 36 deletions(-)

diff --git a/src/or/or.h b/src/or/or.h
index a0fcf8f..dad81ed 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2581,29 +2581,6 @@ typedef struct {
   time_t expiry_time;
 } cpath_build_state_t;
 
-/**
- * The cell_ewma_t structure keeps track of how many cells a circuit has
- * transferred recently.  It keeps an EWMA (exponentially weighted moving
- * average) of the number of cells flushed from the circuit queue onto a
- * connection in connection_or_flush_from_first_active_circuit().
- */
-typedef struct {
-  /** The last 'tick' at which we recalibrated cell_count.
-   *
-   * A cell sent at exactly the start of this tick has weight 1.0. Cells sent
-   * since the start of this tick have weight greater than 1.0; ones sent
-   * earlier have less weight. */
-  unsigned last_adjusted_tick;
-  /** The EWMA of the cell count. */
-  double cell_count;
-  /** True iff this is the cell count for a circuit's previous
-   * channel. */
-  unsigned int is_for_p_chan : 1;
-  /** The position of the circuit within the OR connection's priority
-   * queue. */
-  int heap_index;
-} cell_ewma_t;
-
 #define ORIGIN_CIRCUIT_MAGIC 0x35315243u
 #define OR_CIRCUIT_MAGIC 0x98ABC04Fu
 
@@ -2721,12 +2698,8 @@ typedef struct circuit_t {
   /** Unique ID for measuring tunneled network status requests. */
   uint64_t dirreq_id;
 
-  /** TODO is this *all* circuits or all circuits on n_chan? */
   struct circuit_t *next; /** Next circuit in linked list of all circuits. */
 
-  /** TODO all this from here on down should go away in favor of
-   * circuitmux_t.
-   */
   /** Next circuit in the doubly-linked ring of circuits waiting to add
* cells to n_conn.  NULL if we have no cells pending, or if we're not
* linked to an OR connection. */
@@ -2735,11 +2708,6 @@ typedef struct circuit_t {
* cells to n_conn.  NULL if we have no cells pending, or if we're not
* linked to an OR connection. */
   struct circuit_t *prev_active_on_n_chan;
-
-  /** The EWMA count for the number of cells flushed from the
-   * n_chan_cells queue.  Used to determine which circuit to flush from next.
-   */
-  cell_ewma_t n_cell_ewma;
 } circuit_t;
 
 /** Largest number of relay_early cells that we can send on a given
@@ -2977,10 +2945,6 @@ typedef struct or_circuit_t {
* exit-ward queues of this circuit; reset every time when writing
* buffer stats to disk. */
   uint64_t total_cell_waiting_time;
-
-  /** The EWMA count for the number of cells flushed from the
-   * p_conn_cells queue. */
-  cell_ewma_t p_cell_ewma;
 } or_circuit_t;
 
 /** Convert a circuit subtype to a circuit_t. */



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


[tor-commits] [tor/master] Handle closing circuits correctly with circuitmux_t

2012-10-10 Thread andrea
commit 3d092ffbdd023a2be0307cb8a52bd48e2c85b257
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 13:06:10 2012 -0700

Handle closing circuits correctly with circuitmux_t
---
 src/or/circuitlist.c |   17 +---
 src/or/circuitmux.c  |  102 --
 2 files changed, 68 insertions(+), 51 deletions(-)

diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index a4dcec6..a87f989 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -131,11 +131,12 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
   if (old_chan) {
 /*
  * If we're changing channels or ID and had an old channel and a non
- * zero old ID (i.e., we should have been attached), detach the circuit.
- * ID changes require this because circuitmux hashes on (channel_id,
- * circuit_id).
+ * zero old ID and weren't marked for close (i.e., we should have been
+ * attached), detach the circuit. ID changes require this because
+ * circuitmux hashes on (channel_id, circuit_id).
  */
-if (id != 0  (old_chan != chan || old_id != id)) {
+if (id != 0  (old_chan != chan || old_id != id) 
+!(circ-marked_for_close)) {
   tor_assert(old_chan-cmux);
   circuitmux_detach_circuit(old_chan-cmux, circ);
 }
@@ -180,9 +181,11 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
 
   /*
* Attach to the circuitmux if we're changing channels or IDs and
-   * have a new channel and ID to use.
+   * have a new channel and ID to use and the circuit is not marked for
+   * close.
*/
-  if (chan  id != 0  (old_chan != chan || old_id != id)) {
+  if (chan  id != 0  (old_chan != chan || old_id != id) 
+  !(circ-marked_for_close)) {
 tor_assert(chan-cmux);
 circuitmux_attach_circuit(chan-cmux, circ, direction);
 attached = 1;
@@ -1398,6 +1401,7 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int 
line,
   if (circ-n_chan) {
 circuit_clear_cell_queue(circ, circ-n_chan);
 channel_send_destroy(circ-n_circ_id, circ-n_chan, reason);
+circuitmux_detach_circuit(circ-n_chan-cmux, circ);
   }
 
   if (! CIRCUIT_IS_ORIGIN(circ)) {
@@ -1425,6 +1429,7 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int 
line,
 if (or_circ-p_chan) {
   circuit_clear_cell_queue(circ, or_circ-p_chan);
   channel_send_destroy(or_circ-p_circ_id, or_circ-p_chan, reason);
+  circuitmux_detach_circuit(or_circ-p_chan-cmux, circ);
 }
   } else {
 origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 2bf511f..48336d8 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -130,6 +130,8 @@ struct chanid_circid_muxinfo_t {
  * Internal-use #defines
  */
 
+#define CMUX_PARANOIA
+
 #ifdef CMUX_PARANOIA
 #define circuitmux_assert_okay_paranoid(cmux) \
   circuitmux_assert_okay(cmux)
@@ -1476,53 +1478,63 @@ circuitmux_assert_okay_pass_one(circuitmux_t *cmux)
 chan = channel_find_by_global_id(chan_id);
 tor_assert(chan);
 circ = circuit_get_by_circid_channel(circ_id, chan);
-tor_assert(circ);
-
-/* Clear the circ_is_active bit to start */
-circ_is_active = 0;
-
-/* Assert that we know which direction this is going */
-tor_assert((*i)-muxinfo.direction == CELL_DIRECTION_OUT ||
-   (*i)-muxinfo.direction == CELL_DIRECTION_IN);
-
-if ((*i)-muxinfo.direction == CELL_DIRECTION_OUT) {
-  /* We should be n_mux on this circuit */
-  tor_assert(cmux == circ-n_mux);
-  tor_assert(chan == circ-n_chan);
-  /* Get next and prev for next test */
-  next_p = (circ-next_active_on_n_chan);
-  prev_p = (circ-prev_active_on_n_chan);
-} else {
-  /* This should be an or_circuit_t and we should be p_mux */
-  or_circ = TO_OR_CIRCUIT(circ);
-  tor_assert(cmux == or_circ-p_mux);
-  tor_assert(chan == or_circ-p_chan);
-  /* Get next and prev for next test */
-  next_p = (or_circ-next_active_on_p_chan);
-  prev_p = (or_circ-prev_active_on_p_chan);
-}
+if (circ) {
+  /* Clear the circ_is_active bit to start */
+  circ_is_active = 0;
+
+  /* Assert that we know which direction this is going */
+  tor_assert((*i)-muxinfo.direction == CELL_DIRECTION_OUT ||
+ (*i)-muxinfo.direction == CELL_DIRECTION_IN);
+
+  if ((*i)-muxinfo.direction == CELL_DIRECTION_OUT) {
+/* We should be n_mux on this circuit */
+tor_assert(cmux == circ-n_mux);
+tor_assert(chan == circ-n_chan);
+/* Get next and prev for next test */
+next_p = (circ-next_active_on_n_chan);
+prev_p = (circ-prev_active_on_n_chan);
+  } else {
+/* This should be an or_circuit_t and we should be p_mux */
+or_circ = TO_OR_CIRCUIT(circ);
+tor_assert(cmux == or_circ-p_mux);
+tor_assert(chan == or_circ-p_chan);
+/* Get next and prev for next test */
+next_p = 

[tor-commits] [tor/master] Add a bunch of paranoid-mode expensive asserts incircuitmux.c

2012-10-10 Thread andrea
commit 6830c9c232ff8d93461d18aa4fc729861804e00e
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 12:01:05 2012 -0700

Add a bunch of paranoid-mode expensive asserts incircuitmux.c
---
 src/or/circuitmux.c |   52 +-
 1 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index fd59840..2bf511f 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -127,6 +127,17 @@ struct chanid_circid_muxinfo_t {
 };
 
 /*
+ * Internal-use #defines
+ */
+
+#ifdef CMUX_PARANOIA
+#define circuitmux_assert_okay_paranoid(cmux) \
+  circuitmux_assert_okay(cmux)
+#else
+#define circuitmux_assert_okay_paranoid(cmux)
+#endif
+
+/*
  * Static function declarations
  */
 
@@ -176,6 +187,8 @@ circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, 
circuit_t *circ,
   tor_assert(cmux);
   tor_assert(circ);
 
+  circuitmux_assert_okay_paranoid(cmux);
+
   /* Figure out our next_p and prev_p for this cmux/direction */
   if (direction) {
 if (direction == CELL_DIRECTION_OUT) {
@@ -229,6 +242,8 @@ circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, 
circuit_t *circ,
   *prev_p = cmux-active_circuits_tail;
   /* Set the tail to this circuit */
   cmux-active_circuits_tail = circ;
+
+  circuitmux_assert_okay_paranoid(cmux);
 }
 
 static INLINE circuit_t **
@@ -324,6 +339,7 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
   circuit_t *circ = NULL;
 
   tor_assert(cmux);
+  circuitmux_assert_okay_paranoid(cmux);
 
   i = HT_START(chanid_circid_muxinfo_map, cmux-chanid_circid_map);
   while (i) {
@@ -794,6 +810,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
   tor_assert(circ);
   tor_assert(direction == CELL_DIRECTION_IN ||
  direction == CELL_DIRECTION_OUT);
+  circuitmux_assert_okay_paranoid(cmux);
 
   /*
* Figure out which channel we're using, and get the circuit's current
@@ -919,6 +936,8 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t 
*circ,
 }
 cmux-n_cells += cell_count;
   }
+
+  circuitmux_assert_okay_paranoid(cmux);
 }
 
 /**
@@ -940,6 +959,7 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
   tor_assert(cmux-chanid_circid_map);
   tor_assert(circ);
   tor_assert(circ-n_chan);
+  circuitmux_assert_okay_paranoid(cmux);
 
   /* See if we have it for n_chan/n_circ_id */
   search.chan_id = circ-n_chan-global_identifier;
@@ -995,6 +1015,8 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
 /* Free the hash entry */
 tor_free(hashent);
   }
+
+  circuitmux_assert_okay_paranoid(cmux);
 }
 
 /**
@@ -1017,6 +1039,11 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, 
circuit_t *circ,
   tor_assert(circ);
   tor_assert(direction == CELL_DIRECTION_OUT ||
  direction == CELL_DIRECTION_IN);
+  /*
+   * Don't circuitmux_assert_okay_paranoid(cmux) here because the cell count
+   * already got changed and we have to update the list for it to be consistent
+   * again.
+   */
 
   /* Get the right set of active list links for this direction */
   if (direction == CELL_DIRECTION_OUT) {
@@ -1084,6 +,8 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, 
circuit_t *circ,
 cmux-policy-notify_circ_active(cmux, cmux-policy_data,
  circ, hashent-muxinfo.policy_data);
   }
+
+  circuitmux_assert_okay_paranoid(cmux);
 }
 
 /**
@@ -1107,6 +1136,11 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, 
circuit_t *circ,
   tor_assert(circ);
   tor_assert(direction == CELL_DIRECTION_OUT ||
  direction == CELL_DIRECTION_IN);
+  /*
+   * Don't circuitmux_assert_okay_paranoid(cmux) here because the cell count
+   * already got changed and we have to update the list for it to be consistent
+   * again.
+   */
 
   /* Get the right set of active list links for this direction */
   if (direction == CELL_DIRECTION_OUT) {
@@ -1191,6 +1225,8 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, 
circuit_t *circ,
 cmux-policy-notify_circ_inactive(cmux, cmux-policy_data,
circ, hashent-muxinfo.policy_data);
   }
+
+  circuitmux_assert_okay_paranoid(cmux);
 }
 
 /**
@@ -1217,6 +1253,8 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
   tor_assert(cmux);
   tor_assert(circ);
 
+  circuitmux_assert_okay_paranoid(cmux);
+
   /* Search for this circuit's entry */
   hashent = circuitmux_find_map_entry(cmux, circ);
   /* Assert that we found one */
@@ -1242,15 +1280,22 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t 
*circ,
*/
   if (hashent-muxinfo.cell_count  0  n_cells == 0) {
 --(cmux-n_active_circuits);
+hashent-muxinfo.cell_count = n_cells;
 circuitmux_make_circuit_inactive(cmux, circ, hashent-muxinfo.direction);
   /* Is the old cell count == 0 and the new cell count  0 ? */
   } else if (hashent-muxinfo.cell_count == 0  n_cells  0) {
 ++(cmux-n_active_circuits);
+

[tor-commits] [tor/master] Fix detach when setting circuit ID to 0 bug in circuit_set_circid_chan_helper() and add circuit_get_by_circid_channel_even_if_marked()

2012-10-10 Thread andrea
commit b28119e6a86fb910c02f53ee5e0154f8d15dc1e4
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 14:22:53 2012 -0700

Fix detach when setting circuit ID to 0 bug in 
circuit_set_circid_chan_helper() and add 
circuit_get_by_circid_channel_even_if_marked()
---
 src/or/circuitlist.c |   14 +-
 src/or/circuitlist.h |3 +++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index a87f989..5140600 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -135,7 +135,7 @@ circuit_set_circid_chan_helper(circuit_t *circ, int 
direction,
  * attached), detach the circuit. ID changes require this because
  * circuitmux hashes on (channel_id, circuit_id).
  */
-if (id != 0  (old_chan != chan || old_id != id) 
+if (old_id != 0  (old_chan != chan || old_id != id) 
 !(circ-marked_for_close)) {
   tor_assert(old_chan-cmux);
   circuitmux_detach_circuit(old_chan-cmux, circ);
@@ -986,6 +986,18 @@ circuit_get_by_circid_channel(circid_t circ_id, channel_t 
*chan)
 return circ;
 }
 
+/** Return a circ such that:
+ *  - circ-\n_circ_id or circ-\p_circ_id is equal to bcirc_id/b, and
+ *  - circ is attached to bchan/b, either as p_chan or n_chan.
+ * Return NULL if no such circuit exists.
+ */
+circuit_t *
+circuit_get_by_circid_channel_even_if_marked(circid_t circ_id,
+ channel_t *chan)
+{
+  return circuit_get_by_circid_channel_impl(circ_id, chan);
+}
+
 /** Return true iff the circuit ID bcirc_id/b is currently used by a
  * circuit, marked or not, on bchan/b. */
 int
diff --git a/src/or/circuitlist.h b/src/or/circuitlist.h
index f0f4b2a..89e957c 100644
--- a/src/or/circuitlist.h
+++ b/src/or/circuitlist.h
@@ -30,6 +30,9 @@ origin_circuit_t *origin_circuit_new(void);
 or_circuit_t *or_circuit_new(circid_t p_circ_id, channel_t *p_chan);
 circuit_t *circuit_get_by_circid_channel(circid_t circ_id,
  channel_t *chan);
+circuit_t *
+circuit_get_by_circid_channel_even_if_marked(circid_t circ_id,
+ channel_t *chan);
 int circuit_id_in_use_on_channel(circid_t circ_id, channel_t *chan);
 circuit_t *circuit_get_by_edge_conn(edge_connection_t *conn);
 void circuit_unlink_all_from_channel(channel_t *chan, int reason);



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


[tor-commits] [tor/master] Detach circuits from circuitmux early when freeing channel so they can find the channel by ID

2012-10-10 Thread andrea
commit c097fb33fc081165a55f0b9417d7c8bf5dc91cd6
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 14:22:04 2012 -0700

Detach circuits from circuitmux early when freeing channel so they can find 
the channel by ID
---
 src/or/channel.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 8241556..4ad5bf1 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2766,6 +2766,10 @@ channel_free_list(smartlist_t *channels, int 
mark_for_close)
   in state %s (%d),
   curr, U64_PRINTF_ARG(curr-global_identifier),
   channel_state_to_string(curr-state), curr-state);
+/* Detach circuits early so they can find the channel */
+if (curr-cmux) {
+  circuitmux_detach_all_circuits(curr-cmux);
+}
 channel_unregister(curr);
 if (mark_for_close) {
   if (!(curr-state == CHANNEL_STATE_CLOSING ||



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


[tor-commits] [tor/master] Fix some circuitmux-related asserts in relay.c

2012-10-10 Thread andrea
commit 1498a6e84a871b2d1b05ab64e2a564a23e03e668
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 14:24:08 2012 -0700

Fix some circuitmux-related asserts in relay.c
---
 src/or/relay.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index d034162..7c81273 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1779,7 +1779,7 @@ circuit_consider_sending_sendme(circuit_t *circ, 
crypt_path_t *layer_hint)
 
 #ifdef ACTIVE_CIRCUITS_PARANOIA
 #define assert_cmux_ok_paranoid(chan) \
- assert_cmux_okay(chan)
+ assert_circuit_mux_okay(chan)
 #else
 #define assert_cmux_ok_paranoid(chan)
 #endif
@@ -2117,6 +2117,9 @@ channel_flush_from_first_active_circuit(channel_t *chan, 
int max)
   streams_blocked = circ-streams_blocked_on_p_chan;
 }
 
+/* Circuitmux told us this was active, so it should have cells */
+tor_assert(queue-n  0);
+
 /*
  * Get just one cell here; once we've sent it, that can change the circuit
  * selection, so we have to loop around for another even if this circuit



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


[tor-commits] [tor/master] Fix broken circuitmux_move_active_circ_to_tail(); don't assume n_chan is not NULL in circuitmux_detach_circuit()

2012-10-10 Thread andrea
commit 13972aee78542f654bcbbdaf09a49df9fed75738
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 17:33:41 2012 -0700

Fix broken circuitmux_move_active_circ_to_tail(); don't assume n_chan is 
not NULL in circuitmux_detach_circuit()
---
 src/or/circuitmux.c |   23 +--
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index b782fdb..d4ea643 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -182,6 +182,7 @@ circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, 
circuit_t *circ,
 {
   circuit_t **next_p = NULL, **prev_p = NULL;
   circuit_t **next_prev = NULL, **prev_next = NULL;
+  circuit_t **tail_next = NULL;
   or_circuit_t *or_circ = NULL;
 
   tor_assert(cmux);
@@ -237,9 +238,18 @@ circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, 
circuit_t *circ,
   else cmux-active_circuits_head = *next_p;
   /* Adjust the next node's previous pointer, if any */
   if (next_prev) *next_prev = *prev_p;
+  /* We're out of the list; now re-attach at the tail */
   /* Adjust our next and prev pointers */
   *next_p = NULL;
   *prev_p = cmux-active_circuits_tail;
+  /* Set the next pointer of the tail, or the head if none */
+  if (cmux-active_circuits_tail) {
+tail_next = circuitmux_next_active_circ_p(cmux,
+  cmux-active_circuits_tail);
+*tail_next = circ;
+  } else {
+cmux-active_circuits_head = circ;
+  }
   /* Set the tail to this circuit */
   cmux-active_circuits_tail = circ;
 
@@ -966,15 +976,16 @@ circuitmux_detach_circuit(circuitmux_t *cmux, circuit_t 
*circ)
   tor_assert(cmux);
   tor_assert(cmux-chanid_circid_map);
   tor_assert(circ);
-  tor_assert(circ-n_chan);
   circuitmux_assert_okay_paranoid(cmux);
 
   /* See if we have it for n_chan/n_circ_id */
-  search.chan_id = circ-n_chan-global_identifier;
-  search.circ_id = circ-n_circ_id;
-  hashent = HT_REMOVE(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
-  search);
-  last_searched_direction = CELL_DIRECTION_OUT;
+  if (circ-n_chan) {
+search.chan_id = circ-n_chan-global_identifier;
+search.circ_id = circ-n_circ_id;
+hashent = HT_REMOVE(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+search);
+last_searched_direction = CELL_DIRECTION_OUT;
+  }
 
   /* Got one? If not, see if it's an or_circuit_t and try p_chan/p_circ_id */
   if (!hashent) {



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


[tor-commits] [tor/master] Allow n_chan to be NULL in circuitmux_find_map_entry(); it can be but with non-NULL p_chan when extending a circuit

2012-10-10 Thread andrea
commit 903cc8acd12ae2484ba2ad2a7ac1cb1b9bb88638
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 14:55:33 2012 -0700

Allow n_chan to be NULL in circuitmux_find_map_entry(); it can be but with 
non-NULL p_chan when extending a circuit
---
 src/or/circuitmux.c |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index e27a790..b782fdb 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -655,15 +655,17 @@ circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t 
*circ)
   tor_assert(cmux);
   tor_assert(cmux-chanid_circid_map);
   tor_assert(circ);
-  tor_assert(circ-n_chan);
 
-  /* Okay, let's see if it's attached for n_chan/n_circ_id */
-  search.chan_id = circ-n_chan-global_identifier;
-  search.circ_id = circ-n_circ_id;
+  /* Check if we have n_chan */
+  if (circ-n_chan) {
+/* Okay, let's see if it's attached for n_chan/n_circ_id */
+search.chan_id = circ-n_chan-global_identifier;
+search.circ_id = circ-n_circ_id;
 
-  /* Query */
-  hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
-search);
+/* Query */
+hashent = HT_FIND(chanid_circid_muxinfo_map, cmux-chanid_circid_map,
+  search);
+  }
 
   /* Found something? */
   if (hashent) {



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


[tor-commits] [tor/master] Implement channel_set_cmux_policy_everywhere()

2012-10-10 Thread andrea
commit 8afe41b481caa984fa6b4a0fbbf626d4cd22ce59
Author: Andrea Shepard and...@torproject.org
Date:   Mon Oct 1 20:05:03 2012 -0700

Implement channel_set_cmux_policy_everywhere()
---
 src/or/channel.c |   16 
 src/or/channel.h |3 +++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 4ad5bf1..880fa63 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2696,6 +2696,22 @@ channel_listener_dumpstats(int severity)
 }
 
 /**
+ * Set the cmux policy on all active channels
+ */
+
+void
+channel_set_cmux_policy_everywhere(circuitmux_policy_t *pol)
+{
+  if (!active_channels) return;
+
+  SMARTLIST_FOREACH_BEGIN(active_channels, channel_t *, curr) {
+if (curr-cmux) {
+  circuitmux_set_policy(curr-cmux, pol);
+}
+  } SMARTLIST_FOREACH_END(curr);
+}
+
+/**
  * Clean up channels
  *
  * This gets called periodically from run_scheduled_events() in main.c;
diff --git a/src/or/channel.h b/src/or/channel.h
index 4d3db41..cb9835a 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -291,6 +291,9 @@ void channel_free_all(void);
 void channel_dumpstats(int severity);
 void channel_listener_dumpstats(int severity);
 
+/* Set the cmux policy on all active channels */
+void channel_set_cmux_policy_everywhere(circuitmux_policy_t *pol);
+
 #ifdef _TOR_CHANNEL_INTERNAL
 
 /* Channel operations for subclasses and internal use only */



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


  1   2   >