From 0b0ccfa46ca5f8c98d51e727e4129b3bcc696775 Mon Sep 17 00:00:00 2001 From: wyf <763257820@qq.com> Date: Wed, 4 Jan 2023 15:46:33 +0800 Subject: [PATCH 1/4] http.rs clippt --- rust/rust_project/src/http.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/rust/rust_project/src/http.rs b/rust/rust_project/src/http.rs index 2ef2eed..d5a45b2 100644 --- a/rust/rust_project/src/http.rs +++ b/rust/rust_project/src/http.rs @@ -253,6 +253,7 @@ extern "C" fn http_setup_conn(mut data: *mut Curl_easy, mut conn: *mut connectda * prefix without colon! */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_checkProxyheaders( mut data: *mut Curl_easy, mut conn: *const connectdata, @@ -300,6 +301,7 @@ pub extern "C" fn Curl_checkProxyheaders( * consists entirely of whitespace. */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_copy_header_value(mut header: *const libc::c_char) -> *mut libc::c_char { let mut start: *const libc::c_char = 0 as *const libc::c_char; let mut end: *const libc::c_char = 0 as *const libc::c_char; @@ -717,6 +719,7 @@ extern "C" fn http_perhapsrewind(mut data: *mut Curl_easy, mut conn: *mut connec * picked. */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_auth_act(mut data: *mut Curl_easy) -> CURLcode { let mut conn: *mut connectdata = unsafe { (*data).conn }; let mut pickhost: bool = false; @@ -1057,6 +1060,7 @@ extern "C" fn output_auth_headers( */ #[cfg(not(CURL_DISABLE_HTTP_AUTH))] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_output_auth( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -1228,6 +1232,7 @@ extern "C" fn is_valid_auth_separator(mut ch: libc::c_char) -> libc::c_int { } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_input_auth( mut data: *mut Curl_easy, mut proxy: bool, @@ -1705,6 +1710,7 @@ extern "C" fn readmoredata( */ #[cfg(not(USE_HYPER))] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_buffer_send( mut in_0: *mut dynbuf, mut data: *mut Curl_easy, @@ -2045,6 +2051,7 @@ pub extern "C" fn Curl_buffer_send( * Pass headers WITH the colon. */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_compareheader( mut headerline: *const libc::c_char, /* line to check */ mut header: *const libc::c_char, /* header keyword _with_ colon */ @@ -2106,6 +2113,7 @@ pub extern "C" fn Curl_compareheader( * the generic Curl_connect(). */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_connect(mut data: *mut Curl_easy, mut done: *mut bool) -> CURLcode { let mut result: CURLcode = CURLE_OK; let mut conn: *mut connectdata = unsafe { (*data).conn }; @@ -2331,6 +2339,7 @@ extern "C" fn https_getsock( } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_done( mut data: *mut Curl_easy, mut status: CURLcode, @@ -2409,6 +2418,7 @@ pub extern "C" fn Curl_http_done( * 1.0. */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_use_http_1_1plus( mut data: *const Curl_easy, mut conn: *const connectdata, @@ -2490,6 +2500,7 @@ extern "C" fn expect100( } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_compile_trailers( mut trailers: *mut curl_slist, mut b: *mut dynbuf, @@ -2783,6 +2794,7 @@ const HEADER_CONNECT: u32 = 2; /* sending CONNECT to a proxy */ #[cfg(not(USE_HYPER))] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_add_custom_headers( mut data: *mut Curl_easy, mut is_connect: bool, @@ -3149,6 +3161,7 @@ pub extern "C" fn Curl_add_timecondition( #[cfg(all(not(CURL_DISABLE_PARSEDATE), not(USE_HYPER)))] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_add_timecondition( mut data: *mut Curl_easy, mut req: *mut dynbuf, @@ -3235,6 +3248,7 @@ const PROTO_FAMILY_HTTP: u32 = 1 << 0 | 1 << 1; const CURLPROTO_FTP: u32 = 1 << 2; #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_method( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -3296,6 +3310,7 @@ pub extern "C" fn Curl_http_method( } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_useragent(mut data: *mut Curl_easy) -> CURLcode { unsafe { /* The User-Agent string might have been allocated in url.c already, because @@ -3321,6 +3336,7 @@ pub extern "C" fn Curl_http_useragent(mut data: *mut Curl_easy) -> CURLcode { } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_host(mut data: *mut Curl_easy, mut conn: *mut connectdata) -> CURLcode { let mut ptr: *const libc::c_char = 0 as *const libc::c_char; unsafe { @@ -3503,6 +3519,7 @@ pub extern "C" fn Curl_http_host(mut data: *mut Curl_easy, mut conn: *mut connec * Append the request-target to the HTTP request */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_target( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -3664,6 +3681,7 @@ pub extern "C" fn Curl_http_target( } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_body( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -3821,6 +3839,7 @@ pub extern "C" fn Curl_http_body( } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_bodysend( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4491,6 +4510,7 @@ pub extern "C" fn Curl_http_bodysend( #[cfg(not(CURL_DISABLE_COOKIES))] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_cookies( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4610,6 +4630,7 @@ pub extern "C" fn Curl_http_cookies( } } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_range(mut data: *mut Curl_easy, mut httpreq: Curl_HttpReq) -> CURLcode { unsafe { if ((*data).state).use_range() != 0 { @@ -4678,6 +4699,7 @@ pub extern "C" fn Curl_http_range(mut data: *mut Curl_easy, mut httpreq: Curl_Ht } } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_resume( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4758,6 +4780,7 @@ pub extern "C" fn Curl_http_resume( } } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_firstwrite( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4865,6 +4888,7 @@ pub extern "C" fn Curl_http_firstwrite( } #[cfg(HAVE_LIBZ)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_transferencode(mut data: *mut Curl_easy) -> CURLcode { unsafe { if (Curl_checkheaders(data, b"TE\0" as *const u8 as *const libc::c_char)).is_null() @@ -4919,6 +4943,7 @@ pub extern "C" fn Curl_transferencode(mut data: *mut Curl_easy) -> CURLcode { } #[cfg(not(USE_HYPER))] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http(mut data: *mut Curl_easy, mut done: *mut bool) -> CURLcode { unsafe { let mut conn: *mut connectdata = (*data).conn; @@ -5430,6 +5455,7 @@ extern "C" fn checkprotoprefix( } } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_header( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -6042,6 +6068,7 @@ pub extern "C" fn Curl_http_header( return CURLE_OK; } #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_statusline( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -6125,6 +6152,7 @@ pub extern "C" fn Curl_http_statusline( * Read any HTTP header lines from the server and pass them to the client app. */ #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_readwrite_headers( mut data: *mut Curl_easy, mut conn: *mut connectdata, -- Gitee From cee5a0693d05ed9f2c915bf267ba94aec3166351 Mon Sep 17 00:00:00 2001 From: wyf <763257820@qq.com> Date: Wed, 4 Jan 2023 16:04:58 +0800 Subject: [PATCH 2/4] http2 clippy --- rust/rust_project/src/http2.rs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/rust/rust_project/src/http2.rs b/rust/rust_project/src/http2.rs index 0d654fa..7941f46 100644 --- a/rust/rust_project/src/http2.rs +++ b/rust/rust_project/src/http2.rs @@ -80,6 +80,7 @@ fn HEADER_OVERFLOW(nva: nghttp2_nv) -> bool { #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_init_state(mut state: *mut UrlState) { unsafe { (*state).stream_weight = NGHTTP2_DEFAULT_WEIGHT; @@ -87,6 +88,7 @@ pub extern "C" fn Curl_http2_init_state(mut state: *mut UrlState) { } #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_init_userset(mut set: *mut UserDefined) { unsafe { (*set).stream_weight = NGHTTP2_DEFAULT_WEIGHT; @@ -328,6 +330,7 @@ extern "C" fn http2_conncheck( /* called from http_setup_conn */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_setup_req(data: *mut Curl_easy) { unsafe { let mut http: *mut HTTP = (*data).req.p.http; @@ -347,6 +350,7 @@ pub extern "C" fn Curl_http2_setup_req(data: *mut Curl_easy) { /* called from http_setup_conn */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_setup_conn(mut conn: *mut connectdata) { unsafe { (*conn).proto.httpc.settings.max_concurrent_streams = DEFAULT_MAX_CONCURRENT_STREAMS; @@ -479,6 +483,7 @@ static mut Curl_handler_http2_ssl: Curl_handler = Curl_handler { */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_ver(p: *mut i8, len: size_t) { unsafe { let h2: *mut nghttp2_info = nghttp2_version(0); @@ -542,6 +547,7 @@ extern "C" fn send_callback( */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn curl_pushheader_bynum(h: *mut curl_pushheaders, num: size_t) -> *mut i8 { unsafe { /* Verify that we got a good easy handle in the push header struct, mostly to @@ -563,6 +569,7 @@ pub extern "C" fn curl_pushheader_bynum(h: *mut curl_pushheaders, num: size_t) - */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn curl_pushheader_byname(h: *mut curl_pushheaders, header: *const i8) -> *mut i8 { unsafe { /* Verify that we got a good easy handle in the push header struct, @@ -693,7 +700,7 @@ extern "C" fn set_transfer_url(data: *mut Curl_easy, hp: *mut curl_pushheaders) 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); - + #[allow(clippy::never_loop)] 'fail: loop { if !v.is_null() { uc = curl_url_set(u, CURLUPART_SCHEME, v, 0); @@ -754,6 +761,7 @@ extern "C" fn push_promise( ) -> i32 { unsafe { let mut rv: i32 = 0; /* one of the CURL_PUSH_* defines */ + #[allow(clippy::never_loop)] 'fail: loop { if ((*(*data).multi).push_cb).is_some() { let mut stream: *mut HTTP = 0 as *mut HTTP; @@ -798,7 +806,7 @@ extern "C" fn push_promise( &mut heads, (*(*data).multi).push_userp, ); - Curl_set_in_callback(data, 0 != 0); + Curl_set_in_callback(data, false); /* free the headers again */ i = 0; while i < (*stream).push_headers_used { @@ -1653,6 +1661,7 @@ extern "C" fn populate_settings(data: *mut Curl_easy, mut httpc: *mut http_conn) #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_done(data: *mut Curl_easy, premature: bool) { unsafe { let mut http: *mut HTTP = (*data).req.p.http; @@ -1923,6 +1932,7 @@ extern "C" fn http2_init(data: *mut Curl_easy, conn: *mut connectdata) -> CURLco */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_request_upgrade(req: *mut dynbuf, data: *mut Curl_easy) -> CURLcode { unsafe { let mut result: CURLcode = CURLE_OK; @@ -2091,6 +2101,7 @@ extern "C" fn h2_process_pending_input( */ #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_done_sending( data: *mut Curl_easy, conn: *mut connectdata, @@ -2806,6 +2817,7 @@ unsafe extern "C" fn http2_send( } i = i.wrapping_add(1); } + #[allow(clippy::never_loop)] 'fail: loop { if nheader < 2 as u64 { break 'fail; @@ -3138,6 +3150,7 @@ unsafe extern "C" fn http2_send( #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_setup(data: *mut Curl_easy, mut conn: *mut connectdata) -> CURLcode { unsafe { let mut result: CURLcode = CURLE_OK; @@ -3209,6 +3222,7 @@ pub extern "C" fn Curl_http2_setup(data: *mut Curl_easy, mut conn: *mut connectd #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_switched( data: *mut Curl_easy, mem: *const i8, @@ -3382,6 +3396,7 @@ pub extern "C" fn Curl_http2_switched( #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_stream_pause(data: *mut Curl_easy, pause: bool) -> CURLcode { unsafe { #[cfg(all(DEBUGBUILD, HAVE_ASSERT_H))] @@ -3472,6 +3487,7 @@ pub extern "C" fn Curl_http2_stream_pause(data: *mut Curl_easy, pause: bool) -> #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_add_child( parent: *mut Curl_easy, child: *mut Curl_easy, @@ -3560,6 +3576,7 @@ pub extern "C" fn Curl_http2_add_child( #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_remove_child(parent: *mut Curl_easy, child: *mut Curl_easy) { unsafe { let mut last: *mut Curl_http2_dep = 0 as *mut Curl_http2_dep; @@ -3617,6 +3634,7 @@ pub extern "C" fn Curl_http2_remove_child(parent: *mut Curl_easy, child: *mut Cu #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_cleanup_dependencies(data: *mut Curl_easy) { unsafe { while !((*data).set.stream_dependents).is_null() { @@ -3635,6 +3653,7 @@ pub extern "C" fn Curl_http2_cleanup_dependencies(data: *mut Curl_easy) { #[cfg(USE_NGHTTP2)] #[no_mangle] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_h2_http_1_1_error(data: *mut Curl_easy) -> bool { unsafe { let stream: *mut HTTP = (*data).req.p.http; -- Gitee From 189c25b3a48588d8f3933e0d8cdca083de41ff70 Mon Sep 17 00:00:00 2001 From: wyf <763257820@qq.com> Date: Wed, 4 Jan 2023 16:32:28 +0800 Subject: [PATCH 3/4] mesalink wolfssl clippy --- rust/rust_project/src/vtls/mesalink.rs | 1 + rust/rust_project/src/vtls/wolfssl.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/rust/rust_project/src/vtls/mesalink.rs b/rust/rust_project/src/vtls/mesalink.rs index e75b482..6088bc6 100644 --- a/rust/rust_project/src/vtls/mesalink.rs +++ b/rust/rust_project/src/vtls/mesalink.rs @@ -1027,6 +1027,7 @@ extern "C" fn mesalink_connect_common( return result; } } + #[allow(clippy::while_immutable_condition)] while ssl_connect_2 as u32 == unsafe { (*connssl).connecting_state as u32 } || ssl_connect_2_reading as u32 == unsafe { (*connssl).connecting_state as u32 } || ssl_connect_2_writing as u32 == unsafe { (*connssl).connecting_state as u32 } diff --git a/rust/rust_project/src/vtls/wolfssl.rs b/rust/rust_project/src/vtls/wolfssl.rs index f70be8a..e658e2a 100644 --- a/rust/rust_project/src/vtls/wolfssl.rs +++ b/rust/rust_project/src/vtls/wolfssl.rs @@ -1475,6 +1475,7 @@ extern "C" fn wolfssl_connect_common( return result; } } + #[allow(clippy::while_immutable_condition)] while ssl_connect_2 as u32 == unsafe { (*connssl).connecting_state as u32 } || ssl_connect_2_reading as u32 == unsafe { (*connssl).connecting_state as u32 } || ssl_connect_2_writing as u32 == unsafe { (*connssl).connecting_state as u32 } -- Gitee From f00632db4579647ca7ca65ecb8edc1092c0855b1 Mon Sep 17 00:00:00 2001 From: wyf <763257820@qq.com> Date: Wed, 4 Jan 2023 16:32:39 +0800 Subject: [PATCH 4/4] cargo fmt --- rust/rust_project/src/http.rs | 56 +++++++++++++++++----------------- rust/rust_project/src/http2.rs | 28 ++++++++--------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/rust/rust_project/src/http.rs b/rust/rust_project/src/http.rs index d5a45b2..23a4e0a 100644 --- a/rust/rust_project/src/http.rs +++ b/rust/rust_project/src/http.rs @@ -253,7 +253,7 @@ extern "C" fn http_setup_conn(mut data: *mut Curl_easy, mut conn: *mut connectda * prefix without colon! */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_checkProxyheaders( mut data: *mut Curl_easy, mut conn: *const connectdata, @@ -301,7 +301,7 @@ pub extern "C" fn Curl_checkProxyheaders( * consists entirely of whitespace. */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_copy_header_value(mut header: *const libc::c_char) -> *mut libc::c_char { let mut start: *const libc::c_char = 0 as *const libc::c_char; let mut end: *const libc::c_char = 0 as *const libc::c_char; @@ -719,7 +719,7 @@ extern "C" fn http_perhapsrewind(mut data: *mut Curl_easy, mut conn: *mut connec * picked. */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_auth_act(mut data: *mut Curl_easy) -> CURLcode { let mut conn: *mut connectdata = unsafe { (*data).conn }; let mut pickhost: bool = false; @@ -1060,7 +1060,7 @@ extern "C" fn output_auth_headers( */ #[cfg(not(CURL_DISABLE_HTTP_AUTH))] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_output_auth( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -1232,7 +1232,7 @@ extern "C" fn is_valid_auth_separator(mut ch: libc::c_char) -> libc::c_int { } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_input_auth( mut data: *mut Curl_easy, mut proxy: bool, @@ -1710,7 +1710,7 @@ extern "C" fn readmoredata( */ #[cfg(not(USE_HYPER))] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_buffer_send( mut in_0: *mut dynbuf, mut data: *mut Curl_easy, @@ -2051,7 +2051,7 @@ pub extern "C" fn Curl_buffer_send( * Pass headers WITH the colon. */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_compareheader( mut headerline: *const libc::c_char, /* line to check */ mut header: *const libc::c_char, /* header keyword _with_ colon */ @@ -2113,7 +2113,7 @@ pub extern "C" fn Curl_compareheader( * the generic Curl_connect(). */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_connect(mut data: *mut Curl_easy, mut done: *mut bool) -> CURLcode { let mut result: CURLcode = CURLE_OK; let mut conn: *mut connectdata = unsafe { (*data).conn }; @@ -2339,7 +2339,7 @@ extern "C" fn https_getsock( } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_done( mut data: *mut Curl_easy, mut status: CURLcode, @@ -2418,7 +2418,7 @@ pub extern "C" fn Curl_http_done( * 1.0. */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_use_http_1_1plus( mut data: *const Curl_easy, mut conn: *const connectdata, @@ -2500,7 +2500,7 @@ extern "C" fn expect100( } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_compile_trailers( mut trailers: *mut curl_slist, mut b: *mut dynbuf, @@ -2794,7 +2794,7 @@ const HEADER_CONNECT: u32 = 2; /* sending CONNECT to a proxy */ #[cfg(not(USE_HYPER))] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_add_custom_headers( mut data: *mut Curl_easy, mut is_connect: bool, @@ -3161,7 +3161,7 @@ pub extern "C" fn Curl_add_timecondition( #[cfg(all(not(CURL_DISABLE_PARSEDATE), not(USE_HYPER)))] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_add_timecondition( mut data: *mut Curl_easy, mut req: *mut dynbuf, @@ -3248,7 +3248,7 @@ const PROTO_FAMILY_HTTP: u32 = 1 << 0 | 1 << 1; const CURLPROTO_FTP: u32 = 1 << 2; #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_method( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -3310,7 +3310,7 @@ pub extern "C" fn Curl_http_method( } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_useragent(mut data: *mut Curl_easy) -> CURLcode { unsafe { /* The User-Agent string might have been allocated in url.c already, because @@ -3336,7 +3336,7 @@ pub extern "C" fn Curl_http_useragent(mut data: *mut Curl_easy) -> CURLcode { } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_host(mut data: *mut Curl_easy, mut conn: *mut connectdata) -> CURLcode { let mut ptr: *const libc::c_char = 0 as *const libc::c_char; unsafe { @@ -3519,7 +3519,7 @@ pub extern "C" fn Curl_http_host(mut data: *mut Curl_easy, mut conn: *mut connec * Append the request-target to the HTTP request */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_target( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -3681,7 +3681,7 @@ pub extern "C" fn Curl_http_target( } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_body( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -3839,7 +3839,7 @@ pub extern "C" fn Curl_http_body( } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_bodysend( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4510,7 +4510,7 @@ pub extern "C" fn Curl_http_bodysend( #[cfg(not(CURL_DISABLE_COOKIES))] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_cookies( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4630,7 +4630,7 @@ pub extern "C" fn Curl_http_cookies( } } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_range(mut data: *mut Curl_easy, mut httpreq: Curl_HttpReq) -> CURLcode { unsafe { if ((*data).state).use_range() != 0 { @@ -4699,7 +4699,7 @@ pub extern "C" fn Curl_http_range(mut data: *mut Curl_easy, mut httpreq: Curl_Ht } } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_resume( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4780,7 +4780,7 @@ pub extern "C" fn Curl_http_resume( } } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_firstwrite( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -4888,7 +4888,7 @@ pub extern "C" fn Curl_http_firstwrite( } #[cfg(HAVE_LIBZ)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_transferencode(mut data: *mut Curl_easy) -> CURLcode { unsafe { if (Curl_checkheaders(data, b"TE\0" as *const u8 as *const libc::c_char)).is_null() @@ -4943,7 +4943,7 @@ pub extern "C" fn Curl_transferencode(mut data: *mut Curl_easy) -> CURLcode { } #[cfg(not(USE_HYPER))] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http(mut data: *mut Curl_easy, mut done: *mut bool) -> CURLcode { unsafe { let mut conn: *mut connectdata = (*data).conn; @@ -5455,7 +5455,7 @@ extern "C" fn checkprotoprefix( } } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_header( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -6068,7 +6068,7 @@ pub extern "C" fn Curl_http_header( return CURLE_OK; } #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_statusline( mut data: *mut Curl_easy, mut conn: *mut connectdata, @@ -6152,7 +6152,7 @@ pub extern "C" fn Curl_http_statusline( * Read any HTTP header lines from the server and pass them to the client app. */ #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http_readwrite_headers( mut data: *mut Curl_easy, mut conn: *mut connectdata, diff --git a/rust/rust_project/src/http2.rs b/rust/rust_project/src/http2.rs index 7941f46..1873164 100644 --- a/rust/rust_project/src/http2.rs +++ b/rust/rust_project/src/http2.rs @@ -80,7 +80,7 @@ fn HEADER_OVERFLOW(nva: nghttp2_nv) -> bool { #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_init_state(mut state: *mut UrlState) { unsafe { (*state).stream_weight = NGHTTP2_DEFAULT_WEIGHT; @@ -88,7 +88,7 @@ pub extern "C" fn Curl_http2_init_state(mut state: *mut UrlState) { } #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_init_userset(mut set: *mut UserDefined) { unsafe { (*set).stream_weight = NGHTTP2_DEFAULT_WEIGHT; @@ -330,7 +330,7 @@ extern "C" fn http2_conncheck( /* called from http_setup_conn */ #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_setup_req(data: *mut Curl_easy) { unsafe { let mut http: *mut HTTP = (*data).req.p.http; @@ -350,7 +350,7 @@ pub extern "C" fn Curl_http2_setup_req(data: *mut Curl_easy) { /* called from http_setup_conn */ #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_setup_conn(mut conn: *mut connectdata) { unsafe { (*conn).proto.httpc.settings.max_concurrent_streams = DEFAULT_MAX_CONCURRENT_STREAMS; @@ -483,7 +483,7 @@ static mut Curl_handler_http2_ssl: Curl_handler = Curl_handler { */ #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_ver(p: *mut i8, len: size_t) { unsafe { let h2: *mut nghttp2_info = nghttp2_version(0); @@ -547,7 +547,7 @@ extern "C" fn send_callback( */ #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn curl_pushheader_bynum(h: *mut curl_pushheaders, num: size_t) -> *mut i8 { unsafe { /* Verify that we got a good easy handle in the push header struct, mostly to @@ -569,7 +569,7 @@ pub extern "C" fn curl_pushheader_bynum(h: *mut curl_pushheaders, num: size_t) - */ #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn curl_pushheader_byname(h: *mut curl_pushheaders, header: *const i8) -> *mut i8 { unsafe { /* Verify that we got a good easy handle in the push header struct, @@ -3150,7 +3150,7 @@ unsafe extern "C" fn http2_send( #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_setup(data: *mut Curl_easy, mut conn: *mut connectdata) -> CURLcode { unsafe { let mut result: CURLcode = CURLE_OK; @@ -3222,7 +3222,7 @@ pub extern "C" fn Curl_http2_setup(data: *mut Curl_easy, mut conn: *mut connectd #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_switched( data: *mut Curl_easy, mem: *const i8, @@ -3396,7 +3396,7 @@ pub extern "C" fn Curl_http2_switched( #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_stream_pause(data: *mut Curl_easy, pause: bool) -> CURLcode { unsafe { #[cfg(all(DEBUGBUILD, HAVE_ASSERT_H))] @@ -3487,7 +3487,7 @@ pub extern "C" fn Curl_http2_stream_pause(data: *mut Curl_easy, pause: bool) -> #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_add_child( parent: *mut Curl_easy, child: *mut Curl_easy, @@ -3576,7 +3576,7 @@ pub extern "C" fn Curl_http2_add_child( #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_remove_child(parent: *mut Curl_easy, child: *mut Curl_easy) { unsafe { let mut last: *mut Curl_http2_dep = 0 as *mut Curl_http2_dep; @@ -3634,7 +3634,7 @@ pub extern "C" fn Curl_http2_remove_child(parent: *mut Curl_easy, child: *mut Cu #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_http2_cleanup_dependencies(data: *mut Curl_easy) { unsafe { while !((*data).set.stream_dependents).is_null() { @@ -3653,7 +3653,7 @@ pub extern "C" fn Curl_http2_cleanup_dependencies(data: *mut Curl_easy) { #[cfg(USE_NGHTTP2)] #[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn Curl_h2_http_1_1_error(data: *mut Curl_easy) -> bool { unsafe { let stream: *mut HTTP = (*data).req.p.http; -- Gitee