Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update webserver.cpp
Address an error that _key_ in the static PSK handler function is assigned a value that is never used in the case if the Gnu TLS libary is not present, i.e. HAVE_GNUTLS has not been defined.

The intended behavior is such that calling the static callback handler function of the webserver guarantees that the user registered callback function is invoked.
  • Loading branch information
oberdorc authored Mar 3, 2024
commit f336fecfefb5fc81fee374e5fb65746a43f80bb7
2 changes: 1 addition & 1 deletion src/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void webserver::sweet_kill() {
}

void webserver::psk_cred_handler_func(void* cls, const struct MHD_Connection*, const char* username, void** psk, size_t* psk_size) {
std::string key = std::invoke(static_cast<const webserver*>(cls)->psk_cred_handler,username);
[[maybe_unused]] std::string key = std::invoke(static_cast<const webserver*>(cls)->psk_cred_handler,username);

#ifdef HAVE_GNUTLS
*psk_size = key.length();
Expand Down