[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] 5935 - Store ip as string



commit 5f65706188a39ae5a3faeb1b97f499b2fdaa9ad8
Author: aagbsn <aagbsn@xxxxxxxx>
Date:   Wed Jun 13 19:17:25 2012 -0700

    5935 - Store ip as string
    
    bridge.ip is stored in the database as a string but ipaddr.IPAddress
    everywhere else.
---
 lib/bridgedb/Storage.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bridgedb/Storage.py b/lib/bridgedb/Storage.py
index da64a30..91c1a3c 100644
--- a/lib/bridgedb/Storage.py
+++ b/lib/bridgedb/Storage.py
@@ -218,14 +218,14 @@ class Database:
             # Update last_seen, address, port and (possibly) distributor.
             cur.execute("UPDATE Bridges SET address = ?, or_port = ?, "
                         "distributor = ?, last_seen = ? WHERE id = ?",
-                        (bridge.ip, bridge.orport, ring, timeToStr(seenAt), i))
+                        (str(bridge.ip), bridge.orport, ring, timeToStr(seenAt), i))
             return ring
         else:
             # Insert it.
             cur.execute("INSERT INTO Bridges (hex_key, address, or_port, "
                         "distributor, first_seen, last_seen) "
                         "VALUES (?, ?, ?, ?, ?, ?)",
-                        (h, bridge.ip, bridge.orport, setRing, t, t))
+                        (h, str(bridge.ip), bridge.orport, setRing, t, t))
             return setRing
 
     def cleanEmailedBridges(self, expireBefore):



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