mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: fix building of vlib/x/websocket/websocket_test.v
This commit is contained in:
@ -36,7 +36,7 @@ fn new_addr(addr C.sockaddr) ?Addr {
|
||||
socket_error(-1) ?
|
||||
}
|
||||
} $else {
|
||||
res := C.inet_ntop(SocketFamily.inet, &addr, buf.data, buf.len)
|
||||
res := charptr(C.inet_ntop(SocketFamily.inet, &addr, buf.data, buf.len))
|
||||
if res == 0 {
|
||||
socket_error(-1) ?
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ module openssl
|
||||
#include <openssl/rand.h> # Please install OpenSSL development headers
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
pub struct C.SSL {
|
||||
}
|
||||
|
||||
@ -59,11 +60,11 @@ fn C.SSL_CTX_load_verify_locations() int
|
||||
|
||||
fn C.SSL_CTX_free()
|
||||
|
||||
fn C.SSL_new() &C.SSL
|
||||
fn C.SSL_new(&C.SSL_CTX) &C.SSL
|
||||
|
||||
fn C.SSL_set_fd() int
|
||||
fn C.SSL_set_fd(&C.SSL) int
|
||||
|
||||
fn C.SSL_connect() int
|
||||
fn C.SSL_connect(&C.SSL) int
|
||||
|
||||
fn C.SSL_set_cipher_list() int
|
||||
|
||||
@ -77,17 +78,17 @@ fn C.SSL_get_verify_result() int
|
||||
|
||||
fn C.SSL_set_tlsext_host_name() int
|
||||
|
||||
fn C.SSL_shutdown() int
|
||||
fn C.SSL_shutdown(&C.SSL) int
|
||||
|
||||
fn C.SSL_free()
|
||||
fn C.SSL_free(&C.SSL)
|
||||
|
||||
fn C.SSL_write() int
|
||||
fn C.SSL_write(ssl &C.SSL, buf voidptr, buflen int) int
|
||||
|
||||
fn C.SSL_read() int
|
||||
fn C.SSL_read(ssl &C.SSL, buf voidptr, buflen int) int
|
||||
|
||||
fn C.SSL_load_error_strings()
|
||||
|
||||
fn C.SSL_library_init()
|
||||
fn C.SSL_library_init() int
|
||||
|
||||
fn C.SSLv23_client_method() &C.SSL_METHOD
|
||||
|
||||
|
@ -157,11 +157,11 @@ pub fn (c &TcpConn) peer_ip() ?string {
|
||||
peeraddr := C.sockaddr_in{}
|
||||
speeraddr := sizeof(peeraddr)
|
||||
socket_error(C.getpeername(c.sock.handle, unsafe { &C.sockaddr(&peeraddr) }, &speeraddr)) ?
|
||||
cstr := C.inet_ntop(C.AF_INET, &peeraddr.sin_addr, buf, sizeof(buf))
|
||||
cstr := charptr(C.inet_ntop(C.AF_INET, &peeraddr.sin_addr, buf, sizeof(buf)))
|
||||
if cstr == 0 {
|
||||
return error('net.peer_ip: inet_ntop failed')
|
||||
}
|
||||
res := unsafe {cstring_to_vstring(cstr)}
|
||||
res := unsafe { cstring_to_vstring(cstr) }
|
||||
return res
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user