Problem: null_mechanism duplicates zap_client_t::send_zap_request\nSolution: use zap_client_t::send_zap_request

This commit is contained in:
sigiesec
2017-08-16 10:29:41 +02:00
parent f3884f3380
commit b324c66b6f
3 changed files with 14 additions and 71 deletions

View File

@@ -111,12 +111,15 @@ int zap_client_t::send_zap_request (const char *mechanism,
return close_and_return (&msg, -1);
// Credentials frame
rc = msg.init_size (credentials_size);
errno_assert (rc == 0);
memcpy (msg.data (), credentials, credentials_size);
rc = session->write_zap_msg (&msg);
if (rc != 0)
return close_and_return (&msg, -1);
// Skip if credential is NULL
if (credentials) {
rc = msg.init_size (credentials_size);
errno_assert (rc == 0);
memcpy (msg.data (), credentials, credentials_size);
rc = session->write_zap_msg (&msg);
if (rc != 0)
return close_and_return (&msg, -1);
}
return 0;
}