]> Repositorios git - scryer-prolog.git/commitdiff
remove TLS option in socket_client_open/3
authorAdrián Arroyo Calle <[email protected]>
Sun, 9 Jan 2022 16:04:54 +0000 (17:04 +0100)
committerAdrián Arroyo Calle <[email protected]>
Sun, 9 Jan 2022 16:04:54 +0000 (17:04 +0100)
crates/instructions-template/src/lib.rs
src/lib/sockets.pl
src/machine/system_calls.rs

index cc6e49f3396cf83622ac854479e4711544e39586..a20be30203e072be7faac6fa373aca0f61f62e10 100644 (file)
@@ -442,7 +442,7 @@ enum SystemClauseType {
     SkipMaxList,
     #[strum_discriminants(strum(props(Arity = "1", Name = "$sleep")))]
     Sleep,
-    #[strum_discriminants(strum(props(Arity = "8", Name = "$socket_client_open")))]
+    #[strum_discriminants(strum(props(Arity = "7", Name = "$socket_client_open")))]
     SocketClientOpen,
     #[strum_discriminants(strum(props(Arity = "3", Name = "$socket_server_open")))]
     SocketServerOpen,
index 2fb3a7fd21487f56f5e351979d6312845dbf1510..e2b1b7235fbfb398114b67441b08f373ee64937a 100644 (file)
@@ -25,7 +25,7 @@ socket_client_open(Addr, Stream, Options) :-
     builtins:parse_stream_options(Options,
                                   [Alias, EOFAction, Reposition, Type],
                                   socket_client_open/3),
-    '$socket_client_open'(Address, Port, Stream, Alias, EOFAction, Reposition, Type, false).
+    '$socket_client_open'(Address, Port, Stream, Alias, EOFAction, Reposition, Type).
 
 
 socket_server_open(Addr, ServerSocket) :-
index 88ccb42106ed8f60540e1dbe5b8dbed0e9a29377..800693af2a11be223bed95f60a474e0b514d8cf4 100644 (file)
@@ -4161,42 +4161,7 @@ impl Machine {
 
         let stream = match TcpStream::connect(socket_addr.as_str()).map_err(|e| e.kind()) {
             Ok(tcp_stream) => {
-                let mut stream = {
-                    let tls = cell_as_atom!(self.machine_st.store(self.machine_st.deref(
-                        self.machine_st.registers[8]
-                    )));
-
-                    match tls {
-                        atom!("false") => {
-                            Stream::from_tcp_stream(socket_addr, tcp_stream, &mut self.machine_st.arena)
-                        }
-                        atom!("true") => {
-                            let connector = TlsConnector::new().unwrap();
-                            let stream = Stream::from_tcp_stream(
-                                socket_addr,
-                                tcp_stream,
-                                &mut self.machine_st.arena,
-                            );
-
-                            let stream =
-                                match connector.connect(socket_atom.as_str(), stream) {
-                                    Ok(tls_stream) => tls_stream,
-                                    Err(_) => {
-                                        return Err(self.machine_st.open_permission_error(
-                                            addr,
-                                            atom!("socket_client_open"),
-                                            3,
-                                        ));
-                                    }
-                                };
-
-                            Stream::from_tls_stream(atom!("TLS"), stream, &mut self.machine_st.arena)
-                        }
-                        _ => {
-                            unreachable!()
-                        }
-                    }
-                };
+                let mut stream = Stream::from_tcp_stream(socket_addr, tcp_stream, &mut self.machine_st.arena);
 
                 *stream.options_mut() = options;