summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMarko Kreen2011-06-20 10:49:02 +0000
committerMarko Kreen2011-06-20 10:49:02 +0000
commit65003af1895cfdc004ad7abc09e3d4e02da6ac3a (patch)
tree8715798ee20d9a0b69afdff6c60ab553b0d0e7f6 /python
parent18168025ae2cfff37b1fff8ccf64cf2a50a61ad3 (diff)
handlers.dispatch: move encoding validator upwards
Otherwise it may miss bad pkey values.
Diffstat (limited to 'python')
-rw-r--r--python/londiste/handlers/dispatch.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/londiste/handlers/dispatch.py b/python/londiste/handlers/dispatch.py
index 0dd4d4b7..56fc964c 100644
--- a/python/londiste/handlers/dispatch.py
+++ b/python/londiste/handlers/dispatch.py
@@ -774,6 +774,8 @@ class Dispatcher(BaseHandler):
return
# get data
data = skytools.db_urldecode(ev.data)
+ if self.encoding_validator:
+ data = self.encoding_validator.validate_dict(data)
if len(ev.ev_type) < 2 or ev.ev_type[1] != ':':
raise Exception('Unsupported event type: %s/extra1=%s/data=%s' % (
ev.ev_type, ev.ev_extra1, ev.ev_data))
@@ -799,8 +801,6 @@ class Dispatcher(BaseHandler):
if dst not in self.row_handler.table_map:
self.row_handler.add_table(dst, LOADERS[self.conf.load_mode],
self.pkeys, self.conf)
- if self.encoding_validator:
- data = self.encoding_validator.validate_dict(data)
self.row_handler.process(dst, op, data)
#BaseHandler.process_event(self, ev, sql_queue_func, arg)