Example #1
0
}
$msg = mqreq('msg');
$debug = mqreq('debug');
$debugmsgs = mqreq('debugmsgs');
if ($msg) {
    require_once "lib/fsdb.php";
    require_once "lib/ssl.php";
    require_once "lib/server.php";
    require_once "lib/perf.php";
    $db = new fsdb($dbdir);
    $ssl = new ssl();
    $server = new server($db, $ssl, false, $bank_name, $bankurl);
    if ($debugmsgs) {
        $server->setdebugmsgs($debugmsgs);
        perf_init();
        $perf_idx = perf_start('The rest');
    }
    // Do the dirty deed
    $res = $server->process($msg);
    // Add debugging info, if it's there
    if ($debugmsgs) {
        perf_stop($perf_idx);
        $times = perf_times();
        if (count($times) > 0) {
            $server->debugmsg("===times===\n" . serialize($times));
        }
        if ($server->debugstr) {
            // Should probably escape ">>\n", but live dangerously
            $res = "<<" . $server->debugstr . ">>\n{$res}";
        }
    }
Example #2
0
 function get($key)
 {
     $idx = perf_start('fsdb->get');
     $res = $this->get_internal($key);
     perf_stop($idx);
     return $res;
 }
Example #3
0
 function tokenize($str)
 {
     $idx = perf_start('parser->tokenize');
     $res = $this->tokenize_internal($str);
     perf_stop($idx);
     return $res;
 }
Example #4
0
 function verify($msg, $signature, $pubkey)
 {
     $idx = perf_start('ssl->verify');
     $res = openssl_verify($msg, base64_decode($signature), $pubkey) == 1;
     perf_stop($idx);
     return $res;
 }