1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: remove some tests from skip_with_werror in v test-self

This commit is contained in:
Delyan Angelov
2021-04-14 12:47:24 +03:00
parent 980521824f
commit 3e297bced4
16 changed files with 59 additions and 70 deletions

View File

@ -72,9 +72,10 @@ pub fn resolve_addr(addr string, family SocketFamily, typ SocketType) ?Addr {
// This might look silly but is recommended by MSDN
$if windows {
socket_error(0 - C.getaddrinfo(address.str, sport.str, &hints, &info)) ?
socket_error(0 - C.getaddrinfo(&char(address.str), &char(sport.str), &hints,
&info)) ?
} $else {
x := C.getaddrinfo(address.str, sport.str, &hints, &info)
x := C.getaddrinfo(&char(address.str), &char(sport.str), &hints, &info)
wrap_error(x) ?
}

View File

@ -12,7 +12,7 @@ const (
fn (req &Request) ssl_do(port int, method Method, host_name string, path string) ?Response {
// ssl_method := C.SSLv23_method()
ctx := C.SSL_CTX_new(C.TLSv1_2_method())
ctx := C.SSL_CTX_new(C.TLS_method())
C.SSL_CTX_set_verify_depth(ctx, 4)
flags := C.SSL_OP_NO_SSLv2 | C.SSL_OP_NO_SSLv3 | C.SSL_OP_NO_COMPRESSION
C.SSL_CTX_set_options(ctx, flags)
@ -23,7 +23,7 @@ fn (req &Request) ssl_do(port int, method Method, host_name string, path string)
ssl := &openssl.SSL(0)
C.BIO_get_ssl(web, &ssl)
preferred_ciphers := 'HIGH:!aNULL:!kRSA:!PSK:!SRP:!MD5:!RC4'
res = C.SSL_set_cipher_list(voidptr(ssl), preferred_ciphers.str)
res = C.SSL_set_cipher_list(voidptr(ssl), &char(preferred_ciphers.str))
if res != 1 {
println('http: openssl: cipher failed')
}
@ -41,7 +41,7 @@ fn (req &Request) ssl_do(port int, method Method, host_name string, path string)
eprintln('> $req_headers')
}
// println(req_headers)
C.BIO_puts(web, req_headers.str)
C.BIO_puts(web, &char(req_headers.str))
mut content := strings.new_builder(100)
mut buff := [bufsize]byte{}
bp := &buff[0]

View File

@ -159,7 +159,7 @@ pub fn (c &TcpConn) peer_addr() ?Addr {
}
pub fn (c &TcpConn) peer_ip() ?string {
buf := [44]byte{}
buf := [44]char{}
peeraddr := C.sockaddr_in{}
speeraddr := sizeof(peeraddr)
socket_error(C.getpeername(c.sock.handle, unsafe { &C.sockaddr(&peeraddr) }, &speeraddr)) ?

View File

@ -41,7 +41,8 @@ fn error_code() int {
}
fn new_stream_socket() ?StreamSocket {
sockfd := net.socket_error(C.socket(net.SocketFamily.unix, net.SocketType.stream, 0)) ?
sockfd := net.socket_error(C.socket(net.SocketFamily.unix, net.SocketType.stream,
0)) ?
mut s := StreamSocket{
handle: sockfd
}
@ -64,7 +65,7 @@ fn (mut s StreamSocket) connect(a string) ? {
mut addr := C.sockaddr_un{}
unsafe { C.memset(&addr, 0, sizeof(C.sockaddr_un)) }
addr.sun_family = C.AF_UNIX
unsafe { C.strncpy(&addr.sun_path[0], a.str, max_sun_path) }
unsafe { C.strncpy(&addr.sun_path[0], &char(a.str), max_sun_path) }
size := C.SUN_LEN(&addr)
sockaddr := unsafe { &C.sockaddr(&addr) }
res := C.connect(s.handle, sockaddr, size)
@ -97,7 +98,7 @@ pub fn listen_stream(sock string) ?&StreamListener {
mut addr := C.sockaddr_un{}
unsafe { C.memset(&addr, 0, sizeof(C.sockaddr_un)) }
addr.sun_family = C.AF_UNIX
unsafe { C.strncpy(&addr.sun_path[0], sock.str, max_sun_path) }
unsafe { C.strncpy(&addr.sun_path[0], &char(sock.str), max_sun_path) }
size := C.SUN_LEN(&addr)
sockaddr := unsafe { &C.sockaddr(&addr) }
net.socket_error(C.bind(s.handle, sockaddr, size)) ?
@ -170,14 +171,14 @@ pub fn (mut c StreamConn) close() ? {
}
// write_ptr blocks and attempts to write all data
pub fn (mut c StreamConn) write_ptr(b byteptr, len int) ?int {
pub fn (mut c StreamConn) write_ptr(b &byte, len int) ?int {
$if trace_unix ? {
eprintln(
'>>> StreamConn.write_ptr | c.sock.handle: $c.sock.handle | b: ${ptr_str(b)} len: $len |\n' +
unsafe { b.vstring_with_len(len) })
}
unsafe {
mut ptr_base := byteptr(b)
mut ptr_base := &byte(b)
mut total_sent := 0
for total_sent < len {
ptr := ptr_base + total_sent
@ -214,7 +215,7 @@ pub fn (mut c StreamConn) write_string(s string) ?int {
return c.write_ptr(s.str, s.len)
}
pub fn (mut c StreamConn) read_ptr(buf_ptr byteptr, len int) ?int {
pub fn (mut c StreamConn) read_ptr(buf_ptr &byte, len int) ?int {
mut res := wrap_read_result(C.recv(c.sock.handle, buf_ptr, len, 0)) ?
$if trace_unix ? {
eprintln('<<< StreamConn.read_ptr | c.sock.handle: $c.sock.handle | buf_ptr: ${ptr_str(buf_ptr)} len: $len | res: $res')