From: Remi Gacogne Date: Fri, 11 Jun 2021 12:24:28 +0000 (+0200) Subject: dnsdist: Fix compilation with GnuTLS < 3.4.0 X-Git-Tag: dnsdist-1.7.0-alpha1~45^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2be8e45d628012999e60bcce389aa7edc4d70ddb;p=thirdparty%2Fpdns.git dnsdist: Fix compilation with GnuTLS < 3.4.0 --- diff --git a/pdns/tcpiohandler.cc b/pdns/tcpiohandler.cc index 7efb0a410b..8532c03af5 100644 --- a/pdns/tcpiohandler.cc +++ b/pdns/tcpiohandler.cc @@ -871,7 +871,12 @@ public: gnutls_handshake_set_hook_function(d_conn.get(), GNUTLS_HANDSHAKE_NEW_SESSION_TICKET, GNUTLS_HOOK_POST, newTicketFromServerCb); } + /* The callback prototype changed in 3.4.0. */ +#if GNUTLS_VERSION_NUMBER >= 0x030400 static int newTicketFromServerCb(gnutls_session_t session, unsigned int htype, unsigned post, unsigned int incoming, const gnutls_datum_t* msg) +#else + static int newTicketFromServerCb(gnutls_session_t session, unsigned int htype, unsigned post, unsigned int incoming) +#endif /* GNUTLS_VERSION_NUMBER >= 0x030400 */ { if (htype != GNUTLS_HANDSHAKE_NEW_SESSION_TICKET || post != GNUTLS_HOOK_POST || session == nullptr) { return 0;