mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
add stackoverflow fix for lnk2001 error in gnutls_free
This commit is contained in:
parent
cfc2431a59
commit
2c96ce08ae
1 changed files with 12 additions and 1 deletions
|
@ -33,6 +33,17 @@ void DTLSClientSession::globalDeinit() {
|
|||
gnutls_global_deinit();
|
||||
}
|
||||
|
||||
// fix for lnk2001 link error on windows
|
||||
// call xgnutls_free instead of gnutls_free
|
||||
// http://stackoverflow.com/questions/14593949/getting-error-lnk2001-unresolved-external-symbol-gnutls-free-when-using-gnut
|
||||
|
||||
typedef void (*gnutls_free_function) (void *);
|
||||
__declspec(dllimport) extern gnutls_free_function gnutls_free;
|
||||
|
||||
void xgnutls_free(void* p){
|
||||
gnutls_free(p);
|
||||
}
|
||||
|
||||
int DTLSClientSession::verifyServerCertificate(gnutls_session_t session) {
|
||||
unsigned int verifyStatus = 0;
|
||||
|
||||
|
@ -60,7 +71,7 @@ int DTLSClientSession::verifyServerCertificate(gnutls_session_t session) {
|
|||
}
|
||||
|
||||
qDebug() << "Gnutls certificate verification status:" << reinterpret_cast<char *>(printOut.data);
|
||||
gnutls_free(printOut.data);
|
||||
xgnutls_free(printOut.data);
|
||||
|
||||
if (verifyStatus != 0) {
|
||||
qDebug() << "Server provided certificate for DTLS is not trusted. Can not complete handshake.";
|
||||
|
|
Loading…
Reference in a new issue