Previously with HTTP API enabled on brenchmarking run, it is possible
to cause a segfault due to an issue handling the m_httpd pointer and
rebinding.
- Initialize m_httpd to nullptr to indicate when it's not in use.
- Safely delete m_httpd in Api's destructor to prevent use-after-free
issues.
- Add checks to ensure m_httpd is not nullptr before usage in start,
stop, and tick methods.
- Log errors for HTTP server start failures to aid in debugging.
Fixes MoneroOcean/xmrig#120
Signed-off-by: Dave Walker (Daviey) <email@daviey.com>
|
||
|---|---|---|
| .. | ||
| interfaces | ||
| requests | ||
| Api.cpp | ||
| Api.h | ||
| Httpd.cpp | ||
| Httpd.h | ||