mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 22:55:04 -04:00
Few fixes after rebase
This commit is contained in:
parent
df87fe53b1
commit
f4f7b8a1ea
4 changed files with 46 additions and 33 deletions
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* RetroShare JSON API
|
||||
*
|
||||
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
* Copyright (C) 2018-2020 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
* Copyright (C) 2019-2020 Asociación Civil Altermundi <info@altermundi.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License as published by the
|
||||
|
@ -588,19 +589,12 @@ bool JsonApiServer::restart()
|
|||
return true;
|
||||
}
|
||||
|
||||
void JsonApiServer::onStopRequested()
|
||||
{ if(mService->is_up()) mService->stop(); }
|
||||
|
||||
bool JsonApiServer::fullstop()
|
||||
{
|
||||
if(!mService->is_up()) return true;
|
||||
|
||||
mService->stop();
|
||||
RsThread::ask_for_stop();
|
||||
|
||||
while(isRunning())
|
||||
{
|
||||
RsDbg() << __PRETTY_FUNCTION__ << " shutting down JSON API service."
|
||||
<< std::endl;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
}
|
||||
RsThread::fullstop();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -610,7 +604,7 @@ void JsonApiServer::setBindingAddress(const std::string& bindAddress)
|
|||
{ mBindingAddress = bindAddress; }
|
||||
std::string JsonApiServer::getBindingAddress() const { return mBindingAddress; }
|
||||
|
||||
void JsonApiServer::runloop()
|
||||
void JsonApiServer::run()
|
||||
{
|
||||
auto settings = std::make_shared<restbed::Settings>();
|
||||
settings->set_port(mListeningPort);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* RetroShare JSON API
|
||||
*
|
||||
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
* Copyright (C) 2018-2020 Gioacchino Mazzurco <gio@eigenlab.org>
|
||||
* Copyright (C) 2019-2020 Asociación Civil Altermundi <info@altermundi.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License as published by the
|
||||
|
@ -139,6 +140,10 @@ public:
|
|||
const std::function<bool(const std::string&, const std::string&)>&
|
||||
callback );
|
||||
|
||||
protected:
|
||||
/// @see RsThread
|
||||
void onStopRequested() override;
|
||||
|
||||
private:
|
||||
/// @see RsThread
|
||||
void run() override;
|
||||
|
@ -187,9 +192,6 @@ private:
|
|||
std::reference_wrapper<const JsonApiResourceProvider>,
|
||||
std::less<const JsonApiResourceProvider> > mResourceProviders;
|
||||
|
||||
/// @see RsThread
|
||||
void runloop() override;
|
||||
|
||||
std::shared_ptr<restbed::Service> mService;
|
||||
|
||||
uint16_t mListeningPort;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue