[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r3766: Pull out the USE_QSSLSOCKET stuff since we now require Qt >= (in vidalia/trunk: . src/common src/vidalia src/vidalia/network)
Author: edmanm
Date: 2009-05-08 22:17:47 -0400 (Fri, 08 May 2009)
New Revision: 3766
Modified:
vidalia/trunk/CMakeLists.txt
vidalia/trunk/config.h.in
vidalia/trunk/src/common/CMakeLists.txt
vidalia/trunk/src/vidalia/Vidalia.cpp
vidalia/trunk/src/vidalia/network/GeoIpResolver.cpp
Log:
Pull out the USE_QSSLSOCKET stuff since we now require Qt >= 4.3, which
always has QSslSocket and allowing people to disable it doesn't make much
sense.
Modified: vidalia/trunk/CMakeLists.txt
===================================================================
--- vidalia/trunk/CMakeLists.txt 2009-05-08 15:20:57 UTC (rev 3765)
+++ vidalia/trunk/CMakeLists.txt 2009-05-09 02:17:47 UTC (rev 3766)
@@ -51,6 +51,9 @@
if (WIN32)
include(${CMAKE_SOURCE_DIR}/cmake/FindWiX.cmake)
endif(WIN32)
+if (MSVC OR UNIX)
+ include(${CMAKE_SOURCE_DIR}/cmake/FindOpenSSL.cmake)
+endif(MSVC OR UNIX)
if(MSVC_IDE)
set(CMAKE_SUPPRESS_REGENERATION TRUE)
@@ -69,21 +72,6 @@
endif(OSX_FAT_BINARY)
endif(APPLE)
-## Check for QSslSocket
-set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${QT_INCLUDES})
-check_include_file_cxx("qsslsocket.h" HAVE_QSSLSOCKET_H)
-if (HAVE_QSSLSOCKET_H)
- check_symbol_exists(QT_NO_OPENSSL "QtGlobal" QT_NO_SSL_SUPPORT)
- if (NOT QT_NO_SSL_SUPPORT)
- option(USE_QSSLSOCKET "Use Qt's QSslSocket for GeoIP lookups." ON)
- endif(NOT QT_NO_SSL_SUPPORT)
-endif(HAVE_QSSLSOCKET_H)
-if (USE_QSSLSOCKET)
- if (MSVC OR UNIX)
- include(${CMAKE_SOURCE_DIR}/cmake/FindOpenSSL.cmake)
- endif(MSVC OR UNIX)
-endif(USE_QSSLSOCKET)
-
## UPnP support is currently optional (enabled by default)
option(USE_MINIUPNPC "Enable UPnP support using the MiniUPnPc library." ON)
Modified: vidalia/trunk/config.h.in
===================================================================
--- vidalia/trunk/config.h.in 2009-05-08 15:20:57 UTC (rev 3765)
+++ vidalia/trunk/config.h.in 2009-05-09 02:17:47 UTC (rev 3766)
@@ -16,10 +16,6 @@
#define VIDALIA_VERSION "@VERSION@"
-#cmakedefine HAVE_QSSLSOCKET_H
-
-#cmakedefine USE_QSSLSOCKET
-
#cmakedefine HAVE_LIMITS_H
#cmakedefine HAVE_SYS_LIMITS_H
Modified: vidalia/trunk/src/common/CMakeLists.txt
===================================================================
--- vidalia/trunk/src/common/CMakeLists.txt 2009-05-08 15:20:57 UTC (rev 3765)
+++ vidalia/trunk/src/common/CMakeLists.txt 2009-05-09 02:17:47 UTC (rev 3766)
@@ -21,19 +21,15 @@
procutil.cpp
stringutil.cpp
TorSocket.cpp
+ TorSslSocket.cpp
ZlibByteArray.cpp
)
qt4_wrap_cpp(common_SRCS
CountryInfo.h
TorSocket.h
+ TorSslSocket.h
)
-
-if(USE_QSSLSOCKET)
- set(common_SRCS ${common_SRCS} TorSslSocket.cpp)
- qt4_wrap_cpp(common_SRCS TorSslSocket.h)
-endif(USE_QSSLSOCKET)
-
if(WIN32)
set(common_SRCS ${common_SRCS}
win32.cpp
@@ -44,7 +40,7 @@
add_library(common STATIC ${common_SRCS})
target_link_libraries(common ${QT_LIBRARIES})
-if(USE_QSSLSOCKET AND OPENSSL_LIBRARIES)
+if(OPENSSL_LIBRARIES)
target_link_libraries(common ${OPENSSL_LIBRARIES})
-endif(USE_QSSLSOCKET AND OPENSSL_LIBRARIES)
+endif(OPENSSL_LIBRARIES)
Modified: vidalia/trunk/src/vidalia/Vidalia.cpp
===================================================================
--- vidalia/trunk/src/vidalia/Vidalia.cpp 2009-05-08 15:20:57 UTC (rev 3765)
+++ vidalia/trunk/src/vidalia/Vidalia.cpp 2009-05-09 02:17:47 UTC (rev 3766)
@@ -33,9 +33,7 @@
#include <QShortcut>
#include <QTranslator>
#include <QLibraryInfo>
-#ifdef USE_QSSLSOCKET
#include <QSslSocket>
-#endif
#ifdef Q_OS_MACX
#include <Carbon/Carbon.h>
@@ -492,7 +490,6 @@
void
Vidalia::loadDefaultCaCertificates() const
{
-#ifdef USE_QSSLSOCKET
QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
if (! QSslSocket::addDefaultCaCertificates(":/pki/cacert_root.crt"))
@@ -506,6 +503,5 @@
if (! QSslSocket::addDefaultCaCertificates(":/pki/gd-class2-root.crt"))
vWarn("Failed to add the GoDaddy Class 2 CA certificate to the "
"default CA certificate database.");
-#endif
}
Modified: vidalia/trunk/src/vidalia/network/GeoIpResolver.cpp
===================================================================
--- vidalia/trunk/src/vidalia/network/GeoIpResolver.cpp 2009-05-08 15:20:57 UTC (rev 3765)
+++ vidalia/trunk/src/vidalia/network/GeoIpResolver.cpp 2009-05-09 02:17:47 UTC (rev 3766)
@@ -14,19 +14,13 @@
** \brief Requests GeoIP information and caches the result
*/
-#include "config.h"
#include "GeoIpResolver.h"
#include "Vidalia.h"
-#include "TorSocket.h"
-#if defined(USE_QSSLSOCKET)
#include "TorSslSocket.h"
-#endif
/** Host for the geo ip information. */
#define GEOIP_HOST "geoip.vidalia-project.net"
-/** The non-encrypted GeoIP service lives on port 80. */
-#define GEOIP_PORT 80
/** The SSL GeoIP service runs on port 1443 (443 was taken). */
#define GEOIP_SSL_PORT 1443
/** Page that we request the geo ip information from. */
@@ -220,11 +214,7 @@
}
/* Create a socket used to request the geo ip information. */
-#if defined(USE_QSSLSOCKET)
TorSslSocket *socket = new TorSslSocket(_socksAddr, _socksPort);
-#else
- TorSocket *socket = new TorSocket(_socksAddr, _socksPort);
-#endif
connect(socket, SIGNAL(connectedToRemoteHost()), this, SLOT(connected()),
Qt::QueuedConnection);
@@ -237,21 +227,10 @@
_requestList.insert(socket, request);
/* Connect so we can send our request and return the request ID. */
-#if defined(USE_QSSLSOCKET)
- if (TorSslSocket::supportsSsl()) {
- vInfo("Opening an SSL connection to the GeoIP host at %1:%2 (request id %3)")
- .arg(GEOIP_HOST).arg(GEOIP_SSL_PORT).arg(request->id());
- socket->connectToRemoteHost(GEOIP_HOST, GEOIP_SSL_PORT, true);
- } else {
- vInfo("Opening an unencrypted connection to the GeoIP host at %1:%2 "
- "(request id %3)").arg(GEOIP_HOST).arg(GEOIP_PORT).arg(request->id());
- socket->connectToRemoteHost(GEOIP_HOST, GEOIP_PORT, false);
- }
-#else
- vInfo("Opening an unencrypted connection to the GeoIP host at %1:%2 "
- "(request id %3)").arg(GEOIP_HOST).arg(GEOIP_PORT).arg(request->id());
- socket->connectToRemoteHost(GEOIP_HOST, GEOIP_PORT);
-#endif
+ vInfo("Opening an SSL connection to the GeoIP host at %1:%2 (request id %3)")
+ .arg(GEOIP_HOST).arg(GEOIP_SSL_PORT).arg(request->id());
+ socket->connectToRemoteHost(GEOIP_HOST, GEOIP_SSL_PORT, true);
+
return request->id();
}