mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +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,
|
tag_config: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let url_c = url.strdup();
|
let xml_raw = read_autoconf_file(context, url);
|
||||||
let xml_raw = read_autoconf_file(context, url_c);
|
|
||||||
free(url_c as *mut libc::c_void);
|
|
||||||
if xml_raw.is_null() {
|
if xml_raw.is_null() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ pub unsafe fn outlk_autodiscover(
|
|||||||
0,
|
0,
|
||||||
::std::mem::size_of::<outlk_autodiscover_t>(),
|
::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() {
|
if xml_raw.is_null() {
|
||||||
ok_to_continue = false;
|
ok_to_continue = false;
|
||||||
break;
|
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 {
|
pub fn read_autoconf_file(context: &Context, url: &str) -> *mut libc::c_char {
|
||||||
info!(context, 0, "Testing {} ...", to_string(url));
|
info!(context, 0, "Testing {} ...", url);
|
||||||
|
|
||||||
match reqwest::Client::new()
|
match reqwest::Client::new()
|
||||||
.get(as_str(url))
|
.get(url)
|
||||||
.send()
|
.send()
|
||||||
.and_then(|mut res| res.text())
|
.and_then(|mut res| res.text())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user