From ff8a58b4af1a5e24bd45ee2695e1624143284d35 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 30 Mar 2011 16:58:45 +0000 Subject: better sanity check for music carts diff --git a/rhnop-server/nopsyncd.conf b/rhnop-server/nopsyncd.conf index ec7ba0a..a80d620 100644 --- a/rhnop-server/nopsyncd.conf +++ b/rhnop-server/nopsyncd.conf @@ -2,8 +2,8 @@ queue_name=/rhnop tcp_host=* tcp_port=2345 -dummy_now_cart=50001 -dummy_next_cart=50002 +music_carts_lo=400000 +music_carts_hi=499999 rddb_db=rivendell rddb_host=127.0.0.1 diff --git a/rhnop-server/qlistener.lua b/rhnop-server/qlistener.lua index 0371a02..dcea7bb 100644 --- a/rhnop-server/qlistener.lua +++ b/rhnop-server/qlistener.lua @@ -49,8 +49,7 @@ function handle_message(msg) if not timestamp or not nowcart or not nowlen or not nextcart or not nextlen then io.stderr:write("ignoring malformed message\n") else - -- TODO better sanity checks: is now info new or just next? - if last_cart ~= nowcart and nowcart ~= conf.dummy_now_cart then + if last_cart ~= nowcart and nowcart >= conf.music_carts_lo and nowcart <= conf.music_carts_hi and nowlen > 0 then last_cart = nowcart handle_now(timestamp, nowcart, nowlen) end -- cgit v0.10.2