mirror of
https://github.com/adamdruppe/arsd.git
synced 2025-04-28 14:20:01 +03:00
lol ssl block just to finalize connecting
This commit is contained in:
parent
50592d35f3
commit
0d61b0ef04
1 changed files with 6 additions and 1 deletions
7
http2.d
7
http2.d
|
@ -1360,6 +1360,7 @@ class HttpRequest {
|
||||||
version(with_openssl) {
|
version(with_openssl) {
|
||||||
loadOpenSsl();
|
loadOpenSsl();
|
||||||
socket = new SslClientSocket(family(unixSocketPath), SocketType.STREAM, host, verifyPeer);
|
socket = new SslClientSocket(family(unixSocketPath), SocketType.STREAM, host, verifyPeer);
|
||||||
|
socket.blocking = false;
|
||||||
} else
|
} else
|
||||||
throw new Exception("SSL not compiled in");
|
throw new Exception("SSL not compiled in");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1763,7 +1764,10 @@ class HttpRequest {
|
||||||
|
|
||||||
if(auto s = cast(SslClientSocket) sock) {
|
if(auto s = cast(SslClientSocket) sock) {
|
||||||
try {
|
try {
|
||||||
|
// maybe not ideal to set the blocking but meh it simplifies the code
|
||||||
|
s.blocking = true;
|
||||||
s.do_ssl_connect();
|
s.do_ssl_connect();
|
||||||
|
s.blocking = false;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
request.state = State.aborted;
|
request.state = State.aborted;
|
||||||
|
|
||||||
|
@ -3693,8 +3697,9 @@ version(use_openssl) {
|
||||||
@trusted
|
@trusted
|
||||||
override void connect(Address to) {
|
override void connect(Address to) {
|
||||||
super.connect(to);
|
super.connect(to);
|
||||||
if(!blocking)
|
if(blocking) {
|
||||||
do_ssl_connect();
|
do_ssl_connect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@trusted
|
@trusted
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue