|
@@ -30,6 +30,10 @@
|
|
|
#include <LibCrypto/PK/Code/EMSA_PSS.h>
|
|
|
#include <LibTLS/TLSv12.h>
|
|
|
|
|
|
+#ifndef SOCK_NONBLOCK
|
|
|
+# include <sys/ioctl.h>
|
|
|
+#endif
|
|
|
+
|
|
|
//#define TLS_DEBUG
|
|
|
|
|
|
namespace {
|
|
@@ -701,7 +705,13 @@ TLSv12::TLSv12(Core::Object* parent, Version version)
|
|
|
m_context.version = version;
|
|
|
m_context.is_server = false;
|
|
|
m_context.tls_buffer = ByteBuffer::create_uninitialized(0);
|
|
|
+#ifdef SOCK_NONBLOCK
|
|
|
int fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
|
|
+#else
|
|
|
+ int fd = socket(AF_INET, SOCK_STREAM, 0);
|
|
|
+ int option = 1;
|
|
|
+ ioctl(fd, FIONBIO, &option);
|
|
|
+#endif
|
|
|
if (fd < 0) {
|
|
|
set_error(errno);
|
|
|
} else {
|