Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement nbd-proxy as a part of bmcweb
Nbd-proxy is responsible for exposing websocket endpoint in bmcweb. It matches WS endpoints with unix socket paths using configuration exposed on D-Bus by Virtual-Media. Virtual-Media is then notified about unix socket availability through mount/unmount D-Bus methods. Currently, this feature is disabled by default. Tested: Integrated with initial version of Virtual-Media. Change-Id: I9c572e9841b16785727e5676fea1bb63b0311c63 Signed-off-by: Iwona Klimaszewska <iwona.klimaszewska@intel.com> Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
- Loading branch information
Iwona Klimaszewska
committed
Nov 21, 2019
1 parent
e6604b1
commit c0a1c8a
Showing
10 changed files
with
446 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
|
||
namespace bmcweb | ||
{ | ||
|
||
/** | ||
* AsyncResp | ||
* Gathers data needed for response processing after async calls are done | ||
*/ | ||
|
||
class AsyncResp | ||
{ | ||
public: | ||
AsyncResp(crow::Response& response) : res(response) | ||
{ | ||
} | ||
|
||
AsyncResp(crow::Response& response, std::function<void()>&& function) : | ||
res(response), func(std::move(function)) | ||
{ | ||
} | ||
|
||
~AsyncResp() | ||
{ | ||
if (func && res.result() == boost::beast::http::status::ok) | ||
{ | ||
func(); | ||
} | ||
|
||
res.end(); | ||
} | ||
|
||
crow::Response& res; | ||
std::function<void()> func = 0; | ||
}; | ||
|
||
} // namespace bmcweb | ||
} // namespace bmcweb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.