[Pkg-privacy-commits] [onionbalance] 71/117: Add comment describing how descriptor not found events are handled

Donncha O'Cearbahill donncha-guest at moszumanska.debian.org
Wed Dec 16 23:18:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

donncha-guest pushed a commit to branch debian/sid
in repository onionbalance.

commit d63b9135ca2ffc039e812e92b414222eefa6ace1
Author: Donncha O'Cearbhaill <donncha at donncha.is>
Date:   Tue Jun 30 12:54:22 2015 +0100

    Add comment describing how descriptor not found events are handled
---
 onionbalance/eventhandler.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/onionbalance/eventhandler.py b/onionbalance/eventhandler.py
index 86a3d6b..dc049de 100644
--- a/onionbalance/eventhandler.py
+++ b/onionbalance/eventhandler.py
@@ -32,6 +32,10 @@ class EventHandler(object):
 
         #  Check that the HSDir returned a descriptor that is not empty
         descriptor_text = str(desc_content_event.descriptor).encode('utf-8')
+
+        # HSDir's provide a HS_DESC_CONTENT response with either one or two
+        # CRLF lines when they do not have a matching descriptor. Using
+        # len() < 5 should ensure all empty HS_DESC_CONTENT events are matched.
         if len(descriptor_text) < 5:
             logger.debug("Empty descriptor received for %s.onion",
                          desc_content_event.address)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionbalance.git



More information about the Pkg-privacy-commits mailing list