broken mhttpd alarm page "alarms on/off"

Issue #17 resolved
dd1 created an issue

mhttpd "alarms" page, press "alarms on/off" button, you get the ODB editor page, change the value to "y" or "n", press "set", you get an error page with text: "Error: cannot find key Alarms/Alarm<P>", the value of ODB "/Alarms/alarm system active" is not changed (that's what we are editing). K.O.

Comments (5)

  1. Stefan Ritt

    It works for me. I tried both with a running experiment and a pristine ODB starting from scratch. Can you try with a new ODB. If that works, can you figure out which ODB breaks this functionality? Only when I can reproduce this problem, I can fix it.

    Having the link to edit /Alarms/Alarm system active is actually only a poor man's short cut. It would now be better to have a JS which asks the user to "really turn it on/off" then issuing an ODBSet() to change the value. I will implement this as soon as your problem is fixed, since the JS method would probably have the same issue.

  2. dd1 reporter

    On Fri, Jan 10, 2014 at 12:47:27PM -0000, Stefan Ritt wrote:

    Okey, I am debugging this. The problem shows up through the mongoose web server - midas web server is feeding URLs before urlDecode() but mongoose decodes them first. At the same time found more inconsistent url decoding - mhttpd decode_get() does a double-decode of query parameters while decode_post() does not decode parameters at all.

    -- Konstantin Olchanski Data Acquisition Systems: The Bytes Must Flow! Email: olchansk-at-triumf-dot-ca Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada

  3. Stefan Ritt

    Ok, then it has probably to do with the fact that "/Alarms/Alarm system active" has two spaces, which are encoded/decoded incorrectly when using the mongoose server. You should search in this direction.

  4. dd1 reporter

    Fixed. Problem was caused by double decode of URL in the mongoose server - once by mongoose, second time by mhttpd.cxx::interprete(). The HTTP GET query string is not decoded by mongoose, so no problem there. K.O.

  5. Log in to comment