tree checksum vpatch file split hunks

all signers:

antecedents: 9985-single-thread 9984-unbork-at-command

press order:

genesis
9992-handle-edge-cases-add-feedback
9991-improved-logging
9990-keep-ephemeral-ports-open
9989-show-wot-nicks
9988-hash-dedup
9987-embargoing
9986-rebroadcast-simple-hearsay-and-more
9985-single-thread
9984-unbork-at-command
9983-knobs

patch:

- 2E8BADABCB9694CAC1263BE7CC37E5DDEE7E2719520E6A8CA50BEE27F1AC28508C38FCF217056E37FC552E74987B4134B3C43D9B96A7D53E0AD0AA214827D6E1
+ 259E95AF9FD927FA7A5733E3485ED3F1D4C11CE76DA8D093320878914F48149E06A3D9800F39BD978BCC910D8586B8FA0671AA38EDCBBF432FC5ED14259624FE
blatta/lib/client.py
(8 . 6)(8 . 7)
5 import traceback
6 import logging
7 from state import State
8 from state import KNOBS
9 from message import Message
10 from server import VERSION
11 from funcs import *
(529 . 6)(530 . 26)
13 else:
14 self.pest_reply("no results")
15
16 def knob_handler():
17 if len(arguments) == 0:
18 knobs = self.state.get_knobs()
19 if len(knobs) > 0:
20 for key in knobs.keys():
21 self.pest_reply("%s %s" % (key, knobs[key]))
22 else:
23 self.pest_reply("no knobs configured")
24 elif len(arguments) == 1:
25 knob_value = self.state.get_knob(arguments[0])
26 if knob:
27 self.pest_reply("%s %s" % (arguments[0], knob_value))
28 else:
29 self.pest_reply("no such knob")
30 elif len(arguments) == 2:
31 self.state.set_knob(arguments[0], arguments[1])
32 self.pest_reply("set %s to %s" % (arguments[0], arguments[1]))
33 else:
34 self.pest_reply("Usage: KNOB [<NAME>] [<VALUE>]")
35
36 handler_table = {
37 "AWAY": away_handler,
38 "AT": at_handler,
(554 . 7)(575 . 8)
40 "WALLOPS": wallops_handler,
41 "WHO": who_handler,
42 "WHOIS": whois_handler,
43 "WOT": wot_handler
44 "WOT": wot_handler,
45 "KNOB": knob_handler
46 }
47 server = self.server
48 valid_channel_re = self.__valid_channelname_regexp
- 842D56751FD2E61CAA10C290815B740C3D4A0170D705C8F47FF4CE5604B73FB82494B3B4CBE656F25DF2ADC8D348E001C4FB6568B3149BC2F977417D29DF4668
+ 2A3C3DF167D4BA0F838A3E9DDDDCCBE6D924C3608F742C68E56E107F1F2FC68E4569CD141C992A87565B958815DDE0DB6998179B1398562D6D4CF5963D1C980C
blatta/lib/infosec.py
(27 . 7)(27 . 6)
53 RED_PACKET_LENGTH_WITH_PADDING = 448
54 MESSAGE_PACKET_FORMAT = "<q32s32s32s324s"
55 MAX_MESSAGE_LENGTH = 428
56 MAX_BOUNCES = 3
57 STALE_PACKET = 0
58 DUPLICATE_PACKET = 1
59 MALFORMED_PACKET = 2
- 110BBA88AE7779DC404B10C2B80F93C6BBBCDF72F05511702CC4AFACC22640BDC3C0326FD8D7AAAFA92F22E35C39AA808A7BA0CFD892259AA292946FBAEC8F17
+ 2003B827BA1E77B0E67A9A00BDF37ED146DDAF00BB0EC9EB72AF3AEFCED8541F948FA2B8A7770975165F96029E489A6E609E188700F5655C697E05271419D9EF
blatta/lib/server.py
(1 . 4)(1 . 4)
64 VERSION = "9984"
65 VERSION = "9983"
66
67 import os
68 import select
(14 . 8)(14 . 6)
70 from client import Client
71 from channel import Channel
72 from station import Station
73 from station import EMBARGO_INTERVAL
74 from station import RUBBISH_INTERVAL
75 from message import Message
76 from infosec import PACKET_SIZE
77 import imp
(201 . 12)(199 . 12)
79 last_aliveness_check = now
80
81 # clear embargo queue if enough time has elapsed
82 if last_embargo_queue_check + EMBARGO_INTERVAL < now:
83 if last_embargo_queue_check + int(self.station.state.get_knob('embargo_interval')) < now:
84 self.station.check_embargo_queue()
85 last_embargo_queue_check = now
86
87 # spray rubbish
88 if last_rubbish_dispatch + RUBBISH_INTERVAL < now:
89 if last_rubbish_dispatch + int(self.station.state.get_knob('rubbish_interval')) < now:
90 self.station.send_rubbish()
91 last_rubbish_dispatch = now
92
- 19D07B2CC67C9BFD80A99EA29C8B9064D30253381E6AFE2A4CB6BB30D329D6A92258D4D9671588896D71B0619973604C07312FE005F1E926A955EFBE40784A52
+ 302F32CC4525B593ED2B8E61AE3610003F5811F59778E1085B3E6CB28DD87646D77758A48B7BB7643D41D7602524B2CB35F2D7C9D96FC1D3E4F5136CD5A1A6F8
blatta/lib/state.py
(6 . 6)(6 . 10)
97 import datetime
98 from itertools import chain
99
100 KNOBS=({'max_bounces': 3,
101 'embargo_interval': 1,
102 'rubbish_interval': 10})
103
104 class State(object):
105 __instance = None
106 @staticmethod
(48 . 11)(52 . 43)
108 cursor.execute("create table if not exists dedup_queue(\
109 hash text not null,\
110 created_at datetime default current_timestamp)")
111 cursor.execute("create table if not exists knobs(\
112 name text not null,\
113 value text not null)")
114 State.__instance = self
115
116 def cursor(self):
117 return self.conn.cursor()
118
119 def get_knobs(self):
120 cursor = self.cursor()
121 results = cursor.execute("select name, value from knobs order by name asc").fetchall()
122 knobs = {}
123 for result in results:
124 knobs[result[0]] = result[1]
125 for key in KNOBS.keys():
126 if not knobs.get(key):
127 knobs[key] = KNOBS[key]
128 return knobs
129
130 def get_knob(self, knob_name):
131 cursor = self.cursor()
132 result = cursor.execute("select value from knobs where name=?", (knob_name,)).fetchone()
133 if result:
134 return result[0]
135 elif KNOBS.get(knob_name):
136 return KNOBS.get(knob_name)
137 else:
138 return None
139
140 def set_knob(self, knob_name, knob_value):
141 cursor = self.cursor()
142 result = cursor.execute("select value from knobs where name=?", (knob_name,)).fetchone()
143 if result:
144 cursor.execute("update knobs set value=? where name=?", (knob_value, knob_name,))
145 else:
146 cursor.execute("insert into knobs(name, value) values(?, ?)", (knob_name, knob_value,))
147
148 def get_at(self, handle=None):
149 cursor = self.cursor()
150 at = []
- 05F39E51685760A96A63D9D96565FF66C8D6A44A521787AF7E992EC7F0FD50B589DF8EE69FF81DB69823D98CBE223FB157047157F43C43F4CCC504498530F027
+ F53458362F6D7C18A066F42DBA0D1F8370DEF5BE9DD1A89A972082F3D387E34881CC879688AD66D1F5FE0D5930132FFCC176D32FA34487C0F5226394C17E6169
blatta/lib/station.py
(3 . 7)(3 . 6)
155 import logging
156 import os
157 from state import State
158 from infosec import MAX_BOUNCES
159 from infosec import STALE_PACKET
160 from infosec import DUPLICATE_PACKET
161 from infosec import MALFORMED_PACKET
(16 . 9)(15 . 6)
163 from commands import DIRECT
164 from peer import Peer
165
166 RUBBISH_INTERVAL = 10
167 EMBARGO_INTERVAL = 1
168
169 class Station(object):
170 def __init__(self, options):
171 self.client = None
(153 . 7)(149 . 7)
173 })
174
175 def rebroadcast(self, message):
176 if message.bounces < MAX_BOUNCES:
177 if message.bounces < int(self.state.get_knob("max_bounces")):
178 message.command = BROADCAST
179 message.bounces = message.bounces + 1
180 self.infosec.message(message)