Skip to content

Commit f336fec

Browse files
authored
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.
1 parent e8cf540 commit f336fec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void webserver::sweet_kill() {
182182
}
183183

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

187187
#ifdef HAVE_GNUTLS
188188
*psk_size = key.length();

0 commit comments

Comments
 (0)