mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Accept str instead of char* in read_autoconf_file
This commit is contained in:
@@ -39,9 +39,7 @@ pub unsafe fn moz_autoconfigure(
|
||||
tag_config: 0,
|
||||
};
|
||||
|
||||
let url_c = url.strdup();
|
||||
let xml_raw = read_autoconf_file(context, url_c);
|
||||
free(url_c as *mut libc::c_void);
|
||||
let xml_raw = read_autoconf_file(context, url);
|
||||
if xml_raw.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ pub unsafe fn outlk_autodiscover(
|
||||
0,
|
||||
::std::mem::size_of::<outlk_autodiscover_t>(),
|
||||
);
|
||||
xml_raw = read_autoconf_file(context, url);
|
||||
xml_raw = read_autoconf_file(context, as_str(url));
|
||||
if xml_raw.is_null() {
|
||||
ok_to_continue = false;
|
||||
break;
|
||||
|
||||
@@ -663,11 +663,11 @@ pub fn dc_stop_ongoing_process(context: &Context) {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn read_autoconf_file(context: &Context, url: *const libc::c_char) -> *mut libc::c_char {
|
||||
info!(context, 0, "Testing {} ...", to_string(url));
|
||||
pub fn read_autoconf_file(context: &Context, url: &str) -> *mut libc::c_char {
|
||||
info!(context, 0, "Testing {} ...", url);
|
||||
|
||||
match reqwest::Client::new()
|
||||
.get(as_str(url))
|
||||
.get(url)
|
||||
.send()
|
||||
.and_then(|mut res| res.text())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user