-
Suggestion
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.8.0 Alpha
-
None
There is such code here:
enum SslMode {
#ifndef QT_NO_SSL
SecureMode,
#endif
NonSecureMode
};
It means, that the value of NonSecureMode enumerator depends on QT_NO_SSL. If Qt is built with QT_NO_SSL defined, NonSecureMode is equal to 0, otherwise it is equal to 1.
It causes the annoying collision. Lets we have the following code in our program:
QWebSocketServer *server = new QWebSocketServer("TestServer", QWebSocketServer::NonSecureMode);
If we build it with Qt, built with QT_NO_SSL defined, the value of SslMode in out server is equal to 0. If we run this program with such Qt, it works ok.
But if we try to execute the same program with Qt, built without QT_NO_SSL defined (i.e. where SecureMode is equal to 0), the server "thinks", that it is run in secure mode. As a result such server tries to work with QSslSocket instead of QTcpSocket as we want.
Ans vise versa if we create QWebSocketServer with SecureMode, build it with Qt, built without QT_NO_SSL defined, and then try to execute it with different Qt, built with QT_NO_SSL defined, the server will "think", that it is run in non-secure mode.
SUGGESTION
I think one should make the following definition of SslMode enumeration:
enum SslMode {
SecureMode,
NonSecureMode
};
It gets rid the described collision.