From 8d83e375e14ef056b1dd8273934812213e5bf20a Mon Sep 17 00:00:00 2001 From: wyf <763257820@qq.com> Date: Tue, 18 Apr 2023 16:52:39 +0800 Subject: [PATCH] change i8 to libc::c_char --- rust/rust_project/src/http2.rs | 142 ++++++++++++------------- rust/rust_project/src/vtls/bearssl.rs | 82 +++++++------- rust/rust_project/src/vtls/mesalink.rs | 96 ++++++++--------- 3 files changed, 160 insertions(+), 160 deletions(-) diff --git a/rust/rust_project/src/http2.rs b/rust/rust_project/src/http2.rs index 1873164..7e99a29 100644 --- a/rust/rust_project/src/http2.rs +++ b/rust/rust_project/src/http2.rs @@ -222,7 +222,7 @@ extern "C" fn http2_connisdead(data: *mut Curl_easy, conn: *mut connectdata) -> Curl_infof( data, b"%d bytes stray data read before trying h2 connection\0" as *const u8 - as *const i8, + as *const libc::c_char, nread, ); (*httpc).nread_inbuf = 0; @@ -303,7 +303,7 @@ extern "C" fn http2_conncheck( } else { Curl_failf( data, - b"nghttp2_submit_ping() failed: %s(%d)\0" as *const u8 as *const i8, + b"nghttp2_submit_ping() failed: %s(%d)\0" as *const u8 as *const libc::c_char, nghttp2_strerror(rc), rc, ); @@ -317,7 +317,7 @@ extern "C" fn http2_conncheck( if rc != 0 { Curl_failf( data, - b"nghttp2_session_send() failed: %s(%d)\0" as *const u8 as *const i8, + b"nghttp2_session_send() failed: %s(%d)\0" as *const u8 as *const libc::c_char, nghttp2_strerror(rc), rc, ); @@ -365,7 +365,7 @@ pub extern "C" fn Curl_http2_setup_conn(mut conn: *mut connectdata) { #[cfg(USE_NGHTTP2)] static mut Curl_handler_http2: Curl_handler = Curl_handler { /* scheme */ - scheme: b"HTTP\0" as *const u8 as *const i8, + scheme: b"HTTP\0" as *const u8 as *const libc::c_char, /* setup_connection */ setup_connection: None, /* do_it */ @@ -423,7 +423,7 @@ static mut Curl_handler_http2: Curl_handler = Curl_handler { #[cfg(USE_NGHTTP2)] static mut Curl_handler_http2_ssl: Curl_handler = Curl_handler { /* scheme */ - scheme: b"HTTPS\0" as *const u8 as *const i8, + scheme: b"HTTPS\0" as *const u8 as *const libc::c_char, /* setup_connection */ setup_connection: None, /* do_it */ @@ -490,7 +490,7 @@ pub extern "C" fn Curl_http2_ver(p: *mut i8, len: size_t) { curl_msnprintf( p, len, - b"nghttp2/%s\0" as *const u8 as *const i8, + b"nghttp2/%s\0" as *const u8 as *const libc::c_char, (*h2).version_str, ); } @@ -531,7 +531,7 @@ extern "C" fn send_callback( if written == -1 { Curl_failf( data, - b"Failed sending HTTP2 data\0" as *const u8 as *const i8, + b"Failed sending HTTP2 data\0" as *const u8 as *const libc::c_char, ); return NGHTTP2_ERR_CALLBACK_FAILURE as ssize_t; } @@ -582,7 +582,7 @@ pub extern "C" fn curl_pushheader_byname(h: *mut curl_pushheaders, header: *cons || !(!((*h).data).is_null() && GOOD_EASY_HANDLE((*h).data)) || header.is_null() || *header.offset(0) == 0 - || strcmp(header, b":\0" as *const u8 as *const i8) == 0 + || strcmp(header, b":\0" as *const u8 as *const libc::c_char) == 0 || !(strchr(header.offset(1), ':' as i32)).is_null() { return 0 as *mut i8; @@ -694,12 +694,12 @@ extern "C" fn duphandle(data: *mut Curl_easy) -> *mut Curl_easy { extern "C" fn set_transfer_url(data: *mut Curl_easy, hp: *mut curl_pushheaders) -> i32 { unsafe { let mut current_block: u64; - let mut v: *const i8 = 0 as *const i8; + let mut v: *const i8 = 0 as *const libc::c_char; let u: *mut CURLU = curl_url(); let mut uc: CURLUcode = CURLUE_OK; let mut url: *mut i8 = 0 as *mut i8; let mut rc: i32 = 0; - v = curl_pushheader_byname(hp, b":scheme\0" as *const u8 as *const i8); + v = curl_pushheader_byname(hp, b":scheme\0" as *const u8 as *const libc::c_char); #[allow(clippy::never_loop)] 'fail: loop { if !v.is_null() { @@ -709,7 +709,7 @@ extern "C" fn set_transfer_url(data: *mut Curl_easy, hp: *mut curl_pushheaders) break 'fail; } } - v = curl_pushheader_byname(hp, b":authority\0" as *const u8 as *const i8); + v = curl_pushheader_byname(hp, b":authority\0" as *const u8 as *const libc::c_char); if !v.is_null() { uc = curl_url_set(u, CURLUPART_HOST, v, 0); if uc != 0 { @@ -717,7 +717,7 @@ extern "C" fn set_transfer_url(data: *mut Curl_easy, hp: *mut curl_pushheaders) break 'fail; } } - v = curl_pushheader_byname(hp, b":path\0" as *const u8 as *const i8); + v = curl_pushheader_byname(hp, b":path\0" as *const u8 as *const libc::c_char); if !v.is_null() { uc = curl_url_set(u, CURLUPART_PATH, v, 0); if uc != 0 { @@ -778,7 +778,7 @@ extern "C" fn push_promise( if newhandle.is_null() { Curl_infof( data, - b"failed to duplicate handle\0" as *const u8 as *const i8, + b"failed to duplicate handle\0" as *const u8 as *const libc::c_char, ); rv = CURL_PUSH_DENY; /* FAIL HARD */ break 'fail; @@ -787,7 +787,7 @@ extern "C" fn push_promise( heads.frame = frame; stream = (*data).req.p.http; if stream.is_null() { - Curl_failf(data, b"Internal NULL stream!\0" as *const u8 as *const i8); + Curl_failf(data, b"Internal NULL stream!\0" as *const u8 as *const libc::c_char); Curl_close(&mut newhandle); rv = CURL_PUSH_DENY; break 'fail; @@ -870,7 +870,7 @@ extern "C" fn push_promise( if rc as u64 != 0 { Curl_infof( data, - b"failed to add handle to multi\0" as *const u8 as *const i8, + b"failed to add handle to multi\0" as *const u8 as *const libc::c_char, ); http2_stream_free((*newhandle).req.p.http); (*newhandle).req.p.http = 0 as *mut HTTP; @@ -889,7 +889,7 @@ extern "C" fn push_promise( if rv != 0 { Curl_infof( data, - b"failed to set user_data for stream %d\0" as *const u8 as *const i8, + b"failed to set user_data for stream %d\0" as *const u8 as *const libc::c_char, (*frame).promised_stream_id, ); #[cfg(all(DEBUGBUILD, HAVE_ASSERT_H))] @@ -965,7 +965,7 @@ extern "C" fn on_frame_recv( Curl_infof( data, b"Connection state changed (MAX_CONCURRENT_STREAMS == %u)!\0" as *const u8 - as *const i8, + as *const libc::c_char, (*httpc).settings.max_concurrent_streams, ); multi_connchanged((*data).multi); @@ -1016,7 +1016,7 @@ extern "C" fn on_frame_recv( result = Curl_dyn_add( &mut (*stream).header_recvbuf, - b"\r\n\0" as *const u8 as *const i8, + b"\r\n\0" as *const u8 as *const libc::c_char, ); if result as u64 != 0 { @@ -1225,7 +1225,7 @@ extern "C" fn on_stream_close( if rv != 0 { Curl_infof( data_s, - b"http/2: failed to clear user_data for stream %d!\0" as *const u8 as *const i8, + b"http/2: failed to clear user_data for stream %d!\0" as *const u8 as *const libc::c_char, stream_id, ); #[cfg(all(DEBUGBUILD, HAVE_ASSERT_H))] @@ -1352,7 +1352,7 @@ extern "C" fn on_header( stream = (*data_s).req.p.http; if stream.is_null() { - Curl_failf(data_s, b"Internal NULL stream!\0" as *const u8 as *const i8); + Curl_failf(data_s, b"Internal NULL stream!\0" as *const u8 as *const libc::c_char); return NGHTTP2_ERR_CALLBACK_FAILURE; } @@ -1360,11 +1360,11 @@ extern "C" fn on_header( PUSH_PROMISE callback comes */ if (*frame).hd.type_0 == NGHTTP2_PUSH_PROMISE { let mut h: *mut i8 = 0 as *mut i8; - if strcmp(b":authority\0" as *const u8 as *const i8, name as *const i8) == 0 { + if strcmp(b":authority\0" as *const u8 as *const libc::c_char, name as *const libc::c_char) == 0 { /* pseudo headers are lower case */ let mut rc: i32 = 0; let check: *mut i8 = curl_maprintf( - b"%s:%d\0" as *const u8 as *const i8, + b"%s:%d\0" as *const u8 as *const libc::c_char, (*conn).host.name, (*conn).remote_port, ); @@ -1372,9 +1372,9 @@ extern "C" fn on_header( /* no memory */ return NGHTTP2_ERR_CALLBACK_FAILURE; } - if Curl_strcasecompare(check, value as *const i8) == 0 + if Curl_strcasecompare(check, value as *const libc::c_char) == 0 && ((*conn).remote_port != (*(*conn).given).defport - || Curl_strcasecompare((*conn).host.name, value as *const i8) == 0) + || Curl_strcasecompare((*conn).host.name, value as *const libc::c_char) == 0) { nghttp2_submit_rst_stream( session, @@ -1448,7 +1448,7 @@ extern "C" fn on_header( } (*stream).push_headers = headp; } - h = curl_maprintf(b"%s:%s\0" as *const u8 as *const i8, name, value); + h = curl_maprintf(b"%s:%s\0" as *const u8 as *const libc::c_char, name, value); if !h.is_null() { let ref mut fresh25 = (*stream).push_headers_used; let fresh26 = *fresh25; @@ -1462,7 +1462,7 @@ extern "C" fn on_header( /* This is a trailer */ result = Curl_dyn_addf( &mut (*stream).trailer_recvbuf as *mut dynbuf, - b"%.*s: %.*s\r\n\0" as *const u8 as *const i8, + b"%.*s: %.*s\r\n\0" as *const u8 as *const libc::c_char, namelen, name, valuelen, @@ -1477,7 +1477,7 @@ extern "C" fn on_header( if namelen == (::std::mem::size_of::<[i8; 8]>() as u64).wrapping_sub(1 as u64) && memcmp( - b":status\0" as *const u8 as *const i8 as *const libc::c_void, + b":status\0" as *const u8 as *const libc::c_char as *const libc::c_void, name as *const libc::c_void, namelen, ) == 0 @@ -1504,7 +1504,7 @@ extern "C" fn on_header( } result = Curl_dyn_add( &mut (*stream).header_recvbuf, - b"HTTP/2 \0" as *const u8 as *const i8, + b"HTTP/2 \0" as *const u8 as *const libc::c_char, ); if result as u64 != 0 { @@ -1521,7 +1521,7 @@ extern "C" fn on_header( /* the space character after the status code is mandatory */ result = Curl_dyn_add( &mut (*stream).header_recvbuf, - b" \r\n\0" as *const u8 as *const i8, + b" \r\n\0" as *const u8 as *const libc::c_char, ); if result as u64 != 0 { return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -1546,7 +1546,7 @@ extern "C" fn on_header( } result = Curl_dyn_add( &mut (*stream).header_recvbuf, - b": \0" as *const u8 as *const i8, + b": \0" as *const u8 as *const libc::c_char, ); if result as u64 != 0 { return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -1561,7 +1561,7 @@ extern "C" fn on_header( } result = Curl_dyn_add( &mut (*stream).header_recvbuf, - b"\r\n\0" as *const u8 as *const i8, + b"\r\n\0" as *const u8 as *const libc::c_char, ); if result as u64 != 0 { return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -1727,7 +1727,7 @@ pub extern "C" fn Curl_http2_done(data: *mut Curl_easy, premature: bool) { if (*http).stream_id == (*httpc).pause_stream_id { Curl_infof( data, - b"stopped the pause stream!\0" as *const u8 as *const i8, + b"stopped the pause stream!\0" as *const u8 as *const libc::c_char, ); (*httpc).pause_stream_id = 0; } @@ -1748,7 +1748,7 @@ pub extern "C" fn Curl_http2_done(data: *mut Curl_easy, premature: bool) { if rv != 0 { Curl_infof( data, - b"http/2: failed to clear user_data for stream %d!\0" as *const u8 as *const i8, + b"http/2: failed to clear user_data for stream %d!\0" as *const u8 as *const libc::c_char, (*http).stream_id, ); #[cfg(all(DEBUGBUILD, HAVE_ASSERT_H))] @@ -1805,7 +1805,7 @@ extern "C" fn http2_init(data: *mut Curl_easy, conn: *mut connectdata) -> CURLco if rc != 0 { Curl_failf( data, - b"Couldn't initialize nghttp2 callbacks!\0" as *const u8 as *const i8, + b"Couldn't initialize nghttp2 callbacks!\0" as *const u8 as *const libc::c_char, ); return CURLE_OUT_OF_MEMORY; } @@ -1918,7 +1918,7 @@ extern "C" fn http2_init(data: *mut Curl_easy, conn: *mut connectdata) -> CURLco if rc != 0 { Curl_failf( data, - b"Couldn't initialize nghttp2!\0" as *const u8 as *const i8, + b"Couldn't initialize nghttp2!\0" as *const u8 as *const libc::c_char, ); return CURLE_OUT_OF_MEMORY; /* most likely at least */ } @@ -1957,7 +1957,7 @@ pub extern "C" fn Curl_http2_request_upgrade(req: *mut dynbuf, data: *mut Curl_e if binlen <= 0 { Curl_failf( data, - b"nghttp2 unexpectedly failed on pack_settings_payload\0" as *const u8 as *const i8, + b"nghttp2 unexpectedly failed on pack_settings_payload\0" as *const u8 as *const libc::c_char, ); Curl_dyn_free(req); return CURLE_FAILED_INIT; @@ -1966,7 +1966,7 @@ pub extern "C" fn Curl_http2_request_upgrade(req: *mut dynbuf, data: *mut Curl_e result = Curl_base64url_encode( data, - binsettings as *const i8, + binsettings as *const libc::c_char, binlen as size_t, &mut base64, &mut blen, @@ -1980,8 +1980,8 @@ pub extern "C" fn Curl_http2_request_upgrade(req: *mut dynbuf, data: *mut Curl_e result = Curl_dyn_addf( req, b"Connection: Upgrade, HTTP2-Settings\r\nUpgrade: %s\r\nHTTP2-Settings: %s\r\n\0" - as *const u8 as *const i8, - b"h2c\0" as *const u8 as *const i8, + as *const u8 as *const libc::c_char, + b"h2c\0" as *const u8 as *const libc::c_char, base64, ); #[cfg(not(CURLDEBUG))] @@ -2037,7 +2037,7 @@ extern "C" fn h2_process_pending_input( Curl_failf( data, b"h2_process_pending_input: nghttp2_session_mem_recv() returned %zd:%s\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, rv, nghttp2_strerror(rv as i32), ); @@ -2517,7 +2517,7 @@ extern "C" fn http2_recv( if *err != CURLE_AGAIN { Curl_failf( data, - b"Failed receiving HTTP2 data\0" as *const u8 as *const i8, + b"Failed receiving HTTP2 data\0" as *const u8 as *const libc::c_char, ); } else if (*stream).closed { /* received when the stream was already closed! */ @@ -2613,7 +2613,7 @@ extern "C" fn contains_trailers(mut p: *const i8, len: size_t) -> bool { return false; } if Curl_strncasecompare( - b"trailers\0" as *const u8 as *const i8, + b"trailers\0" as *const u8 as *const libc::c_char, p, (::std::mem::size_of::<[i8; 9]>() as u64).wrapping_sub(1 as u64), ) != 0 @@ -2651,7 +2651,7 @@ extern "C" fn inspect_header( unsafe { match namelen { 2 => { - if Curl_strncasecompare(b"te\0" as *const u8 as *const i8, name, namelen) == 0 { + if Curl_strncasecompare(b"te\0" as *const u8 as *const libc::c_char, name, namelen) == 0 { return HEADERINST_FORWARD; } return (if contains_trailers(value, valuelen) as i32 != 0 { @@ -2674,12 +2674,12 @@ extern "C" fn inspect_header( } 10 => { return (if Curl_strncasecompare( - b"connection\0" as *const u8 as *const i8, + b"connection\0" as *const u8 as *const libc::c_char, name, namelen, ) != 0 || Curl_strncasecompare( - b"keep-alive\0" as *const u8 as *const i8, + b"keep-alive\0" as *const u8 as *const libc::c_char, name, namelen, ) != 0 @@ -2691,7 +2691,7 @@ extern "C" fn inspect_header( } 16 => { return (if Curl_strncasecompare( - b"proxy-connection\0" as *const u8 as *const i8, + b"proxy-connection\0" as *const u8 as *const libc::c_char, name, namelen, ) != 0 @@ -2703,7 +2703,7 @@ extern "C" fn inspect_header( } 17 => { return (if Curl_strncasecompare( - b"transfer-encoding\0" as *const u8 as *const i8, + b"transfer-encoding\0" as *const u8 as *const libc::c_char, name, namelen, ) != 0 @@ -2758,7 +2758,7 @@ unsafe extern "C" fn http2_send( if (*stream).close_handled { Curl_infof( data, - b"stream %d closed\0" as *const u8 as *const i8, + b"stream %d closed\0" as *const u8 as *const libc::c_char, (*stream).stream_id, ); *err = CURLE_HTTP2_STREAM; @@ -2865,7 +2865,7 @@ unsafe extern "C" fn http2_send( if end.is_null() || end == hdbuf { break 'fail; } - (*nva.offset(0)).name = b":method\0" as *const u8 as *const i8 as *mut u8; + (*nva.offset(0)).name = b":method\0" as *const u8 as *const libc::c_char as *mut u8; (*nva.offset(0)).namelen = strlen((*nva.offset(0)).name as *mut i8); (*nva.offset(0)).value = hdbuf as *mut u8; (*nva.offset(0)).valuelen = end.offset_from(hdbuf) as size_t; @@ -2873,7 +2873,7 @@ unsafe extern "C" fn http2_send( if HEADER_OVERFLOW(*nva.offset(0 as isize)) { Curl_failf( data, - b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const i8, + b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const libc::c_char, ); break 'fail; } @@ -2894,7 +2894,7 @@ unsafe extern "C" fn http2_send( if end.is_null() || end == hdbuf { break 'fail; } - (*nva.offset(1)).name = b":path\0" as *const u8 as *const i8 as *mut u8; + (*nva.offset(1)).name = b":path\0" as *const u8 as *const libc::c_char as *mut u8; (*nva.offset(1)).namelen = strlen((*nva.offset(1)).name as *mut i8); (*nva.offset(1)).value = hdbuf as *mut u8; (*nva.offset(1)).valuelen = end.offset_from(hdbuf) as size_t; @@ -2902,17 +2902,17 @@ unsafe extern "C" fn http2_send( if HEADER_OVERFLOW(*nva.offset(1 as isize)) { Curl_failf( data, - b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const i8, + b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const libc::c_char, ); break 'fail; } - (*nva.offset(2)).name = b":scheme\0" as *const u8 as *const i8 as *mut u8; + (*nva.offset(2)).name = b":scheme\0" as *const u8 as *const libc::c_char as *mut u8; (*nva.offset(2)).namelen = strlen((*nva.offset(2)).name as *mut i8); if (*(*conn).handler).flags & ((1 as i32) << 0 as i32) as u32 != 0 { - (*nva.offset(2)).value = b"https\0" as *const u8 as *const i8 as *mut u8; + (*nva.offset(2)).value = b"https\0" as *const u8 as *const libc::c_char as *mut u8; } else { - (*nva.offset(2)).value = b"http\0" as *const u8 as *const i8 as *mut u8; + (*nva.offset(2)).value = b"http\0" as *const u8 as *const libc::c_char as *mut u8; } (*nva.offset(2)).valuelen = strlen((*nva.offset(2)).value as *mut i8); (*nva.offset(2)).flags = NGHTTP2_NV_FLAG_NONE as uint8_t; @@ -2921,7 +2921,7 @@ unsafe extern "C" fn http2_send( { Curl_failf( data, - b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const i8, + b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const libc::c_char, ); break 'fail; } @@ -2958,11 +2958,11 @@ unsafe extern "C" fn http2_send( } hlen = end.offset_from(hdbuf) as size_t; - if hlen == 4 && Curl_strncasecompare(b"host\0" as *const u8 as *const i8, hdbuf, 4) != 0 + if hlen == 4 && Curl_strncasecompare(b"host\0" as *const u8 as *const libc::c_char, hdbuf, 4) != 0 { authority_idx = i; (*nva.offset(i as isize)).name = - b":authority\0" as *const u8 as *const i8 as *mut u8; + b":authority\0" as *const u8 as *const libc::c_char as *mut u8; (*nva.offset(i as isize)).namelen = strlen((*nva.offset(i as isize)).name as *mut i8); } else { @@ -2980,7 +2980,7 @@ unsafe extern "C" fn http2_send( const HEADERINST_IGNORE: u32 = 1; const HEADERINST_TE_TRAILERS: u32 = 2; match inspect_header( - (*nva.offset(i as isize)).name as *const i8, + (*nva.offset(i as isize)).name as *const libc::c_char, (*nva.offset(i as isize)).namelen, hdbuf, end.offset_from(hdbuf) as size_t, @@ -2992,7 +2992,7 @@ unsafe extern "C" fn http2_send( } HEADERINST_TE_TRAILERS => { (*nva.offset(i as isize)).value = - b"trailers\0" as *const u8 as *const i8 as *mut uint8_t; + b"trailers\0" as *const u8 as *const libc::c_char as *mut uint8_t; (*nva.offset(i as isize)).valuelen = (::std::mem::size_of::<[i8; 9]>() as u64).wrapping_sub(1); } @@ -3006,7 +3006,7 @@ unsafe extern "C" fn http2_send( if HEADER_OVERFLOW(*nva.offset(i as isize)) { Curl_failf( data, - b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const i8, + b"Failed sending HTTP request: Header overflow\0" as *const u8 as *const libc::c_char, ); break 'fail; } @@ -3042,7 +3042,7 @@ unsafe extern "C" fn http2_send( Curl_infof( data, b"http2_send: Warning: The cumulative length of all headers exceeds %d bytes and that could cause the stream to be rejected.\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, MAX_ACC, ); } @@ -3108,7 +3108,7 @@ unsafe extern "C" fn http2_send( Curl_infof( data, - b"Using Stream ID: %x (easy handle %p)\0" as *const u8 as *const i8, + b"Using Stream ID: %x (easy handle %p)\0" as *const u8 as *const libc::c_char, stream_id, data as *mut libc::c_void, ); @@ -3203,7 +3203,7 @@ pub extern "C" fn Curl_http2_setup(data: *mut Curl_easy, mut conn: *mut connectd } Curl_infof( data, - b"Using HTTP2, server supports multiplexing\0" as *const u8 as *const i8, + b"Using HTTP2, server supports multiplexing\0" as *const u8 as *const libc::c_char, ); ((*conn).bits).set_multiplex(1 as bit); (*conn).httpversion = 20 as u8; @@ -3214,7 +3214,7 @@ pub extern "C" fn Curl_http2_setup(data: *mut Curl_easy, mut conn: *mut connectd (*httpc).drain_total = 0 as size_t; Curl_infof( data, - b"Connection state changed (HTTP/2 confirmed)\0" as *const u8 as *const i8, + b"Connection state changed (HTTP/2 confirmed)\0" as *const u8 as *const libc::c_char, ); return CURLE_OK; } @@ -3272,7 +3272,7 @@ pub extern "C" fn Curl_http2_switched( if rv != 0 { Curl_failf( data, - b"nghttp2_session_upgrade2() failed: %s(%d)\0" as *const u8 as *const i8, + b"nghttp2_session_upgrade2() failed: %s(%d)\0" as *const u8 as *const libc::c_char, nghttp2_strerror(rv), rv, ); @@ -3288,7 +3288,7 @@ pub extern "C" fn Curl_http2_switched( if rv != 0 { Curl_infof( data, - b"http/2: failed to set user_data for stream %d!\0" as *const u8 as *const i8, + b"http/2: failed to set user_data for stream %d!\0" as *const u8 as *const libc::c_char, (*stream).stream_id, ); #[cfg(all(DEBUGBUILD, HAVE_ASSERT_H))] @@ -3316,7 +3316,7 @@ pub extern "C" fn Curl_http2_switched( if rv != 0 { Curl_failf( data, - b"nghttp2_submit_settings() failed: %s(%d)\0" as *const u8 as *const i8, + b"nghttp2_submit_settings() failed: %s(%d)\0" as *const u8 as *const libc::c_char, nghttp2_strerror(rv), rv, ); @@ -3350,7 +3350,7 @@ pub extern "C" fn Curl_http2_switched( Curl_failf( data, b"connection buffer size is too small to store data following HTTP Upgrade response header: buflen=%d, datalen=%zu\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, H2_BUFSIZE , nread, ); @@ -3360,7 +3360,7 @@ pub extern "C" fn Curl_http2_switched( Curl_infof( data, b"Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=%zu\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, nread, ); @@ -3446,7 +3446,7 @@ pub extern "C" fn Curl_http2_stream_pause(data: *mut Curl_easy, pause: bool) -> Curl_failf( data, b"nghttp2_session_set_local_window_size() failed: %s(%d)\0" as *const u8 - as *const i8, + as *const libc::c_char, nghttp2_strerror(rv), rv, ); diff --git a/rust/rust_project/src/vtls/bearssl.rs b/rust/rust_project/src/vtls/bearssl.rs index d3047b9..0dda256 100755 --- a/rust/rust_project/src/vtls/bearssl.rs +++ b/rust/rust_project/src/vtls/bearssl.rs @@ -134,7 +134,7 @@ extern "C" fn br_ssl_engine_get_selected_protocol( unsafe { k = (*ctx).selected_protocol as u32; return if k == 0 as u32 || k == 0xffff as u32 { - 0 as *const i8 + 0 as *const libc::c_char } else { *((*ctx).protocol_names).offset(k.wrapping_sub(1 as u32) as isize) }; @@ -241,7 +241,7 @@ extern "C" fn load_cafile( let mut fp: *mut FILE = 0 as *mut FILE; let mut buf: [u8; 8192] = [0; 8192]; let mut p: *const u8 = 0 as *const u8; - let mut name: *const i8 = 0 as *const i8; + let mut name: *const i8 = 0 as *const libc::c_char; let mut n: size_t = 0; let mut i: size_t = 0; let mut pushed: size_t = 0; @@ -264,7 +264,7 @@ extern "C" fn load_cafile( } unsafe { if (*source).type_0 == 1 as i32 { - fp = fopen((*source).data, b"rb\0" as *const u8 as *const i8); + fp = fopen((*source).data, b"rb\0" as *const u8 as *const libc::c_char); if fp.is_null() { return CURLE_SSL_CACERT_BADFILE; } @@ -326,8 +326,8 @@ extern "C" fn load_cafile( 1 => { name = br_pem_decoder_name(&mut pc); unsafe { - if !(strcmp(name, b"CERTIFICATE\0" as *const u8 as *const i8) != 0 - && strcmp(name, b"X509 CERTIFICATE\0" as *const u8 as *const i8) + if !(strcmp(name, b"CERTIFICATE\0" as *const u8 as *const libc::c_char) != 0 + && strcmp(name, b"X509 CERTIFICATE\0" as *const u8 as *const libc::c_char) != 0) { br_x509_decoder_init( @@ -548,7 +548,7 @@ extern "C" fn x509_start_chain(mut ctx: *mut *const br_x509_class, mut server_na let mut x509: *mut x509_context = ctx as *mut x509_context; unsafe { if !(*x509).verifyhost { - server_name = 0 as *const i8; + server_name = 0 as *const libc::c_char; } ((*(*x509).minimal.vtable).start_chain).expect("non-null function pointer")( &mut (*x509).minimal.vtable, @@ -755,14 +755,14 @@ extern "C" fn bearssl_connect_step1( 2 => { Curl_failf( data, - b"BearSSL does not support SSLv2\0" as *const u8 as *const i8, + b"BearSSL does not support SSLv2\0" as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } 3 => { Curl_failf( data, - b"BearSSL does not support SSLv3\0" as *const u8 as *const i8, + b"BearSSL does not support SSLv3\0" as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } @@ -785,7 +785,7 @@ extern "C" fn bearssl_connect_step1( _ => { Curl_failf( data, - b"BearSSL: unknown CURLOPT_SSLVERSION\0" as *const u8 as *const i8, + b"BearSSL: unknown CURLOPT_SSLVERSION\0" as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } @@ -794,7 +794,7 @@ extern "C" fn bearssl_connect_step1( let mut source: cafile_source = { cafile_source { type_0: 2 as i32, - data: (*ca_info_blob).data as *const i8, + data: (*ca_info_blob).data as *const libc::c_char, len: (*ca_info_blob).len, } }; @@ -807,14 +807,14 @@ extern "C" fn bearssl_connect_step1( if verifypeer { Curl_failf( data, - b"error importing CA certificate blob\0" as *const u8 as *const i8, + b"error importing CA certificate blob\0" as *const u8 as *const libc::c_char, ); return ret; } Curl_infof( data, b"error importing CA certificate blob, continuing anyway\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } } @@ -836,7 +836,7 @@ extern "C" fn bearssl_connect_step1( Curl_failf( data, b"error setting certificate verify locations. CAfile: %s\0" as *const u8 - as *const i8, + as *const libc::c_char, ssl_cafile, ); return ret; @@ -845,7 +845,7 @@ extern "C" fn bearssl_connect_step1( Curl_infof( data, b"error setting certificate verify locations, continuing anyway:\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } } @@ -911,7 +911,7 @@ extern "C" fn bearssl_connect_step1( ); Curl_infof( data, - b"BearSSL: re-using session ID\0" as *const u8 as *const i8, + b"BearSSL: re-using session ID\0" as *const u8 as *const libc::c_char, ); } Curl_ssl_sessionid_unlock(data); @@ -942,11 +942,11 @@ extern "C" fn bearssl_connect_step1( { let fresh11 = cur; cur = cur + 1; - (*backend).protocols[fresh11 as usize] = b"h2\0" as *const u8 as *const i8; + (*backend).protocols[fresh11 as usize] = b"h2\0" as *const u8 as *const libc::c_char; Curl_infof( data, - b"ALPN, offering %s\0" as *const u8 as *const i8, - b"h2\0" as *const u8 as *const i8, + b"ALPN, offering %s\0" as *const u8 as *const libc::c_char, + b"h2\0" as *const u8 as *const libc::c_char, ); } } @@ -955,11 +955,11 @@ extern "C" fn bearssl_connect_step1( } let fresh13 = cur; cur = cur + 1; - (*backend).protocols[fresh13 as usize] = b"http/1.1\0" as *const u8 as *const i8; + (*backend).protocols[fresh13 as usize] = b"http/1.1\0" as *const u8 as *const libc::c_char; Curl_infof( data, - b"ALPN, offering %s\0" as *const u8 as *const i8, - b"http/1.1\0" as *const u8 as *const i8, + b"ALPN, offering %s\0" as *const u8 as *const libc::c_char, + b"http/1.1\0" as *const u8 as *const libc::c_char, ); br_ssl_engine_set_protocol_names( &mut (*backend).bear_ctx.eng, @@ -992,11 +992,11 @@ extern "C" fn bearssl_connect_step1( Curl_failf( data, b"BearSSL: host verification of IP address is not supported\0" as *const u8 - as *const i8, + as *const libc::c_char, ); return CURLE_PEER_FAILED_VERIFICATION; } - hostname = 0 as *const i8; + hostname = 0 as *const libc::c_char; } if br_ssl_client_reset(&mut (*backend).bear_ctx, hostname, 0 as i32) == 0 { return CURLE_FAILED_INIT; @@ -1034,7 +1034,7 @@ extern "C" fn bearssl_run_until( Curl_failf( data, b"SSL: connection closed during handshake\0" as *const u8 - as *const i8, + as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } @@ -1044,7 +1044,7 @@ extern "C" fn bearssl_run_until( Curl_failf( data, b"SSL: X.509 verification: certificate is expired or not yet valid\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, ); return CURLE_PEER_FAILED_VERIFICATION; } @@ -1052,7 +1052,7 @@ extern "C" fn bearssl_run_until( Curl_failf( data, b"SSL: X.509 verification: expected server name was not found in the chain\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, ); return CURLE_PEER_FAILED_VERIFICATION; } @@ -1060,7 +1060,7 @@ extern "C" fn bearssl_run_until( Curl_failf( data, b"SSL: X.509 verification: chain could not be linked to a trust anchor\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, ); return CURLE_PEER_FAILED_VERIFICATION; } @@ -1094,7 +1094,7 @@ extern "C" fn bearssl_run_until( if ret == 0 as i64 { Curl_failf( data, - b"SSL: EOF without close notify\0" as *const u8 as *const i8, + b"SSL: EOF without close notify\0" as *const u8 as *const libc::c_char, ); return CURLE_READ_ERROR; } @@ -1131,7 +1131,7 @@ extern "C" fn bearssl_connect_step2( if br_ssl_engine_current_state(&mut (*backend).bear_ctx.eng) == 0x1 as u32 { Curl_failf( data, - b"SSL: connection closed during handshake\0" as *const u8 as *const i8, + b"SSL: connection closed during handshake\0" as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } @@ -1171,16 +1171,16 @@ extern "C" fn bearssl_connect_step3( ); } if ((*conn).bits).tls_enable_alpn() != 0 { - let mut protocol: *const i8 = 0 as *const i8; + let mut protocol: *const i8 = 0 as *const libc::c_char; protocol = br_ssl_engine_get_selected_protocol(&mut (*backend).bear_ctx.eng); if !protocol.is_null() { Curl_infof( data, - b"ALPN, server accepted to use %s\0" as *const u8 as *const i8, + b"ALPN, server accepted to use %s\0" as *const u8 as *const libc::c_char, protocol, ); #[cfg(USE_HTTP2)] - let USE_HTTP2_flag = strcmp(protocol, b"h2\0" as *const u8 as *const i8) == 0; + let USE_HTTP2_flag = strcmp(protocol, b"h2\0" as *const u8 as *const libc::c_char) == 0; #[cfg(not(USE_HTTP2))] let USE_HTTP2_flag = false; if USE_HTTP2_flag { @@ -1192,12 +1192,12 @@ extern "C" fn bearssl_connect_step3( #[cfg(not(USE_HTTP2))] _ => {} } - } else if strcmp(protocol, b"http/1.1\0" as *const u8 as *const i8) == 0 { + } else if strcmp(protocol, b"http/1.1\0" as *const u8 as *const libc::c_char) == 0 { (*conn).negnpn = CURL_HTTP_VERSION_1_1 as i32; } else { Curl_infof( data, - b"ALPN, unrecognized protocol %s\0" as *const u8 as *const i8, + b"ALPN, unrecognized protocol %s\0" as *const u8 as *const libc::c_char, protocol, ); } @@ -1212,7 +1212,7 @@ extern "C" fn bearssl_connect_step3( } else { Curl_infof( data, - b"ALPN, server did not agree to a protocol\0" as *const u8 as *const i8, + b"ALPN, server did not agree to a protocol\0" as *const u8 as *const libc::c_char, ); } } @@ -1337,7 +1337,7 @@ extern "C" fn bearssl_send( if app.is_null() { Curl_failf( data, - b"SSL: connection closed during write\0" as *const u8 as *const i8, + b"SSL: connection closed during write\0" as *const u8 as *const libc::c_char, ); *err = CURLE_SEND_ERROR; return -(1 as i32) as ssize_t; @@ -1423,7 +1423,7 @@ extern "C" fn bearssl_connect_common( timeout_ms = Curl_timeleft(data, 0 as *mut curltime, 1 as i32 != 0); if timeout_ms < 0 as i64 { /* no need to continue if time already is up */ - Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const i8); + Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const libc::c_char); return CURLE_OPERATION_TIMEDOUT; } /* if ssl is expecting something, check if it's available. */ @@ -1456,7 +1456,7 @@ extern "C" fn bearssl_connect_common( /* fatal error */ Curl_failf( data, - b"select/poll on SSL socket, errno: %d\0" as *const u8 as *const i8, + b"select/poll on SSL socket, errno: %d\0" as *const u8 as *const libc::c_char, *__errno_location(), ); return CURLE_SSL_CONNECT_ERROR; @@ -1467,7 +1467,7 @@ extern "C" fn bearssl_connect_common( *done = 0 as i32 != 0; return CURLE_OK; } else { - Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const i8); + Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const libc::c_char); return CURLE_OPERATION_TIMEDOUT; } } @@ -1530,7 +1530,7 @@ extern "C" fn bearssl_connect_common( extern "C" fn bearssl_version(mut buffer: *mut i8, mut size: size_t) -> size_t { unsafe { - return curl_msnprintf(buffer, size, b"BearSSL\0" as *const u8 as *const i8) as size_t; + return curl_msnprintf(buffer, size, b"BearSSL\0" as *const u8 as *const libc::c_char) as size_t; } } extern "C" fn bearssl_data_pending(mut conn: *const connectdata, mut connindex: i32) -> bool { @@ -1688,7 +1688,7 @@ pub static mut Curl_ssl_bearssl: Curl_ssl = Curl_ssl { info: { curl_ssl_backend { id: CURLSSLBACKEND_BEARSSL, - name: b"bearssl\0" as *const u8 as *const i8, + name: b"bearssl\0" as *const u8 as *const libc::c_char, } }, supports: ((1 as i32) << 6 as i32) as u32, diff --git a/rust/rust_project/src/vtls/mesalink.rs b/rust/rust_project/src/vtls/mesalink.rs index 6088bc6..d9fb1e4 100644 --- a/rust/rust_project/src/vtls/mesalink.rs +++ b/rust/rust_project/src/vtls/mesalink.rs @@ -23,10 +23,10 @@ extern "C" fn do_file_type(mut type_0: *const i8) -> i32 { if type_0.is_null() || unsafe { *type_0.offset(0 as isize) == 0 } { return MESALINK_FILETYPE_PEM as i32; } - if unsafe { Curl_strcasecompare(type_0, b"PEM\0" as *const u8 as *const i8) } != 0 { + if unsafe { Curl_strcasecompare(type_0, b"PEM\0" as *const u8 as *const libc::c_char) } != 0 { return MESALINK_FILETYPE_PEM as i32; } - if unsafe { Curl_strcasecompare(type_0, b"DER\0" as *const u8 as *const i8) } != 0 { + if unsafe { Curl_strcasecompare(type_0, b"DER\0" as *const u8 as *const libc::c_char) } != 0 { return MESALINK_FILETYPE_ASN1 as i32; } return -(1 as i32); @@ -102,7 +102,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"MesaLink does not support to set maximum SSL/TLS version\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } return CURLE_SSL_CONNECT_ERROR; @@ -132,7 +132,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"MesaLink does not support SSL 3.0, TLS 1.0, or TLS 1.1\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } return CURLE_NOT_BUILT_IN; @@ -147,7 +147,7 @@ extern "C" fn mesalink_connect_step1( unsafe { Curl_failf( data, - b"MesaLink does not support SSLv2\0" as *const u8 as *const i8, + b"MesaLink does not support SSLv2\0" as *const u8 as *const libc::c_char, ); } return CURLE_SSL_CONNECT_ERROR; @@ -157,7 +157,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"Unrecognized parameter passed via CURLOPT_SSLVERSION\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } return CURLE_SSL_CONNECT_ERROR; @@ -167,7 +167,7 @@ extern "C" fn mesalink_connect_step1( unsafe { Curl_failf( data, - b"SSL: couldn't create a method!\0" as *const u8 as *const i8, + b"SSL: couldn't create a method!\0" as *const u8 as *const libc::c_char, ); } return CURLE_OUT_OF_MEMORY; @@ -182,7 +182,7 @@ extern "C" fn mesalink_connect_step1( unsafe { Curl_failf( data, - b"SSL: couldn't create a context!\0" as *const u8 as *const i8, + b"SSL: couldn't create a context!\0" as *const u8 as *const libc::c_char, ); } return CURLE_OUT_OF_MEMORY; @@ -308,16 +308,16 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"error setting certificate verify locations: CAfile: %s CApath: %s\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, if CURL_DISABLE_PROXY_CAfile_1 { - CURL_DISABLE_PROXY_CAfile_2 as *const i8 + CURL_DISABLE_PROXY_CAfile_2 as *const libc::c_char } else { - b"none\0" as *const u8 as *const i8 + b"none\0" as *const u8 as *const libc::c_char }, if CURL_DISABLE_PROXY_CApath_1 { - CURL_DISABLE_PROXY_CApath_2 as *const i8 + CURL_DISABLE_PROXY_CApath_2 as *const libc::c_char } else { - b"none\0" as *const u8 as *const i8 + b"none\0" as *const u8 as *const libc::c_char }, ); } @@ -327,36 +327,36 @@ extern "C" fn mesalink_connect_step1( Curl_infof( data, b"error setting certificate verify locations, continuing anyway:\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } } else { unsafe { Curl_infof( data, - b"successfully set certificate verify locations:\0" as *const u8 as *const i8, + b"successfully set certificate verify locations:\0" as *const u8 as *const libc::c_char, ); } } unsafe { Curl_infof( data, - b" CAfile: %s\0" as *const u8 as *const i8, + b" CAfile: %s\0" as *const u8 as *const libc::c_char, if CURL_DISABLE_PROXY_CAfile_1 { - CURL_DISABLE_PROXY_CAfile_2 as *const i8 + CURL_DISABLE_PROXY_CAfile_2 as *const libc::c_char } else { - b"none\0" as *const u8 as *const i8 + b"none\0" as *const u8 as *const libc::c_char }, ); } unsafe { Curl_infof( data, - b" CApath: %s\0" as *const u8 as *const i8, + b" CApath: %s\0" as *const u8 as *const libc::c_char, if CURL_DISABLE_PROXY_CApath_1 { - CURL_DISABLE_PROXY_CApath_2 as *const i8 + CURL_DISABLE_PROXY_CApath_2 as *const libc::c_char } else { - b"none\0" as *const u8 as *const i8 + b"none\0" as *const u8 as *const libc::c_char }, ); } @@ -434,7 +434,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"unable to use client certificate (no key or wrong pass phrase?)\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } @@ -477,13 +477,13 @@ extern "C" fn mesalink_connect_step1( { Curl_failf( data, - b"unable to set private key\0" as *const u8 as *const i8, + b"unable to set private key\0" as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } Curl_infof( data, - b"client cert: %s\0" as *const u8 as *const i8, + b"client cert: %s\0" as *const u8 as *const libc::c_char, if !if CURLPROXY_HTTPS as u32 == (*conn).http_proxy.proxytype as u32 && ssl_connection_complete as u32 != (*conn).proxy_ssl[(if (*conn).sock[1 as usize] == -(1 as i32) { @@ -511,9 +511,9 @@ extern "C" fn mesalink_connect_step1( (*conn).proxy_ssl_config.clientcert } else { (*conn).ssl_config.clientcert - }) as *const i8 + }) as *const libc::c_char } else { - b"none\0" as *const u8 as *const i8 + b"none\0" as *const u8 as *const libc::c_char }, ); } @@ -532,7 +532,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"unable to use client certificate (no key or wrong pass phrase?)\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } @@ -545,17 +545,17 @@ extern "C" fn mesalink_connect_step1( { Curl_failf( data, - b"unable to set private key\0" as *const u8 as *const i8, + b"unable to set private key\0" as *const u8 as *const libc::c_char, ); return CURLE_SSL_CONNECT_ERROR; } Curl_infof( data, - b"client cert: %s\0" as *const u8 as *const i8, + b"client cert: %s\0" as *const u8 as *const libc::c_char, if !((*conn).ssl_config.clientcert).is_null() { - (*conn).ssl_config.clientcert as *const i8 + (*conn).ssl_config.clientcert as *const libc::c_char } else { - b"none\0" as *const u8 as *const i8 + b"none\0" as *const u8 as *const libc::c_char }, ); } @@ -589,7 +589,7 @@ extern "C" fn mesalink_connect_step1( unsafe { Curl_infof( data, - b"Cipher selection: %s\0" as *const u8 as *const i8, + b"Cipher selection: %s\0" as *const u8 as *const libc::c_char, ciphers, ); } @@ -603,7 +603,7 @@ extern "C" fn mesalink_connect_step1( if ((*(*connssl).backend).mesalink_handle).is_null() { Curl_failf( data, - b"SSL: couldn't create a context (handle)!\0" as *const u8 as *const i8, + b"SSL: couldn't create a context (handle)!\0" as *const u8 as *const libc::c_char, ); return CURLE_OUT_OF_MEMORY; } @@ -640,7 +640,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"WARNING: failed to configure server name indication (SNI) TLS extension\n\0" - as *const u8 as *const i8, + as *const u8 as *const libc::c_char, ); } return CURLE_SSL_CONNECT_ERROR; @@ -679,7 +679,7 @@ extern "C" fn mesalink_connect_step1( Curl_failf( data, b"ERROR: MesaLink does not accept an IP address as a hostname\n\0" as *const u8 - as *const i8, + as *const libc::c_char, ); } return CURLE_SSL_CONNECT_ERROR; @@ -692,7 +692,7 @@ extern "C" fn mesalink_connect_step1( != MESALINK_SUCCESS as i32 } { unsafe { - Curl_failf(data, b"SSL: SSL_set_fd failed\0" as *const u8 as *const i8); + Curl_failf(data, b"SSL: SSL_set_fd failed\0" as *const u8 as *const libc::c_char); } return CURLE_SSL_CONNECT_ERROR; } @@ -731,7 +731,7 @@ extern "C" fn mesalink_connect_step2( unsafe { Curl_failf( data, - b"SSL_connect failed with error %d: %s\0" as *const u8 as *const i8, + b"SSL_connect failed with error %d: %s\0" as *const u8 as *const libc::c_char, detail, mesalink_ERR_error_string_n( detail as u64, @@ -764,7 +764,7 @@ extern "C" fn mesalink_connect_step2( detail &= !(0xff as i32); if detail == TLS_ERROR_WEBPKI_ERRORS as i32 { unsafe { - Curl_failf(data, b"Cert verify failed\0" as *const u8 as *const i8); + Curl_failf(data, b"Cert verify failed\0" as *const u8 as *const libc::c_char); } return CURLE_PEER_FAILED_VERIFICATION; } @@ -776,7 +776,7 @@ extern "C" fn mesalink_connect_step2( (*connssl).connecting_state = ssl_connect_3; Curl_infof( data, - b"SSL connection using %s / %s\0" as *const u8 as *const i8, + b"SSL connection using %s / %s\0" as *const u8 as *const libc::c_char, mesalink_SSL_get_version((*(*connssl).backend).mesalink_handle), mesalink_SSL_get_cipher_name((*(*connssl).backend).mesalink_handle), ); @@ -853,7 +853,7 @@ extern "C" fn mesalink_send( unsafe { Curl_failf( data, - b"SSL write: %s, errno %d\0" as *const u8 as *const i8, + b"SSL write: %s, errno %d\0" as *const u8 as *const libc::c_char, mesalink_ERR_error_string_n( err as u64, error_buffer.as_mut_ptr(), @@ -932,7 +932,7 @@ extern "C" fn mesalink_recv( unsafe { Curl_failf( data, - b"SSL read: %s, errno %d\0" as *const u8 as *const i8, + b"SSL read: %s, errno %d\0" as *const u8 as *const libc::c_char, mesalink_ERR_error_string_n( err as u64, error_buffer.as_mut_ptr(), @@ -955,8 +955,8 @@ extern "C" fn mesalink_version(mut buffer: *mut i8, mut size: size_t) -> size_t return curl_msnprintf( buffer, size, - b"MesaLink/%s\0" as *const u8 as *const i8, - b"0.10.1\0" as *const u8 as *const i8, + b"MesaLink/%s\0" as *const u8 as *const libc::c_char, + b"0.10.1\0" as *const u8 as *const libc::c_char, ) as size_t; } } @@ -1018,7 +1018,7 @@ extern "C" fn mesalink_connect_common( if timeout_ms < 0 as i64 { /* no need to continue if time already is up */ unsafe { - Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const i8); + Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const libc::c_char); } return CURLE_OPERATION_TIMEDOUT; } @@ -1036,7 +1036,7 @@ extern "C" fn mesalink_connect_common( timeout_ms = unsafe { Curl_timeleft(data, 0 as *mut curltime, 1 as i32 != 0) }; if timeout_ms < 0 as i64 { /* no need to continue if time already is up */ - unsafe { Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const i8) }; + unsafe { Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const libc::c_char) }; return CURLE_OPERATION_TIMEDOUT; } /* if ssl is expecting something, check if it's available. */ @@ -1073,7 +1073,7 @@ extern "C" fn mesalink_connect_common( unsafe { Curl_failf( data, - b"select/poll on SSL socket, errno: %d\0" as *const u8 as *const i8, + b"select/poll on SSL socket, errno: %d\0" as *const u8 as *const libc::c_char, *__errno_location(), ); } @@ -1088,7 +1088,7 @@ extern "C" fn mesalink_connect_common( } else { /* timeout */ unsafe { - Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const i8); + Curl_failf(data, b"SSL connection timeout\0" as *const u8 as *const libc::c_char); } return CURLE_OPERATION_TIMEDOUT; } @@ -1198,7 +1198,7 @@ pub static mut Curl_ssl_mesalink: Curl_ssl = Curl_ssl { info: { curl_ssl_backend { id: CURLSSLBACKEND_MESALINK, - name: b"MesaLink\0" as *const u8 as *const i8, + name: b"MesaLink\0" as *const u8 as *const libc::c_char, } }, supports: ((1 as i32) << 3 as i32) as u32, -- Gitee