/*
This file is part of Bolixo.
Bolixo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bolixo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bolixo. If not, see .
*/
#include
#include
#include
#include
#include "trlitool.h"
#include "../bolixo.h"
#include "../instrument.h"
#define bolixod_client_getnode_NOTNEED
#include "../proto/bolixod_client.protoch"
#include "../proto/bolixoapi.protoh"
#include
#include
#include
string util_readsecret();
extern "C" void tlmp_initmod()
{
translat_load ("bolixo");
}
static void webmain_real()
{
glocal CONNECT_INFO con;
glocal.con.port = "/dev/bolixod.sock";
glocal.con.secret = util_readsecret();
bool endserver,endclient;
REQUEST_JSON_INFO req;
const char *json = tlmpweb_getpost();
tlmpweb_flushheader();
(NULL, req, json, strlen(json), endserver, endclient);
(glocal.con);
tlmp_error ("msg=%s sessiond=%d db=%d\n",msg,sessiond,db);
glocal.bolixoapi.rep_test(msg,sessiond,db);
// nodename = success:b msg
(glocal.con,nodename);
glocal.bolixoapi.rep_registernode(success,msg);
// session = success:b msg
(glocal.con,session);
glocal.bolixoapi.rep_nodelogout(success,msg);
// nodename = success:b msg session
(glocal.con,nodename);
glocal.bolixoapi.rep_nodelogin(success,msg,session);
// session sign = success:b msg
(glocal.con,session,sign);
glocal.bolixoapi.rep_nodepass(success,msg);
// session user info:U{USERINFO} = success:b msg
(glocal.con,session,info);
glocal.bolixoapi.rep_publish(success,msg);
// session user = success:b msg
(glocal.con,session,user);
glocal.bolixoapi.rep_remove(success,msg);
// session userid email = success:b msg
(glocal.con,session,userid,email);
glocal.bolixoapi.rep_recordemail(success,msg);
htmlprintf ("Invalid request\n");
}
extern "C" void webmain()
{
("unix:","/tmp/stop.sock",1);
webmain_real();
end=true;
webmain_real();
}