just call free instead of gnutls_free on windows

This commit is contained in:
Stephen Birarda 2014-04-10 12:24:41 -07:00
parent 38867a2f09
commit 9912c4c9a7
3 changed files with 6 additions and 16 deletions

View file

@ -59,7 +59,12 @@ int DTLSClientSession::verifyServerCertificate(gnutls_session_t session) {
}
qDebug() << "Gnutls certificate verification status:" << reinterpret_cast<char *>(printOut.data);
xgnutls_free(printOut.data);
#ifdef WIN32
free(printOut.data)
#else
gnutls_free(printOut.data);
#endif
if (verifyStatus != 0) {
qDebug() << "Server provided certificate for DTLS is not trusted. Can not complete handshake.";

View file

@ -14,10 +14,6 @@
#include "NodeList.h"
#include "DTLSSession.h"
void xgnutls_free(void* gnutlsPtr){
gnutls_free(gnutlsPtr);
}
int DTLSSession::socketPullTimeout(gnutls_transport_ptr_t ptr, unsigned int ms) {
DTLSSession* session = static_cast<DTLSSession*>(ptr);
QUdpSocket& dtlsSocket = session->_dtlsSocket;

View file

@ -19,17 +19,6 @@
#include "DummyDTLSSession.h"
#include "HifiSockAddr.h"
// 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
#ifdef WIN32
typedef void (*gnutls_free_function) (void *);
__declspec(dllimport) extern gnutls_free_function gnutls_free;
#endif
void xgnutls_free(void* gnutlsPtr);
class DTLSSession : public DummyDTLSSession {
Q_OBJECT
public: