mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 13:10:29 +01:00
connectivity: conclude the check as soon as we see the magic header
No need to read the rest of the reponse.
This commit is contained in:
parent
71b8d16eb8
commit
ac0f454cfb
1 changed files with 3 additions and 8 deletions
|
|
@ -204,7 +204,6 @@ typedef struct {
|
|||
size_t msg_size;
|
||||
char *msg;
|
||||
struct curl_slist *request_headers;
|
||||
gboolean online_header;
|
||||
} ConCheckCbData;
|
||||
|
||||
static void
|
||||
|
|
@ -276,12 +275,6 @@ curl_check_connectivity (CURLM *mhandle, CURLMcode ret)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
if (cb_data->online_header) {
|
||||
_LOGD ("check for uri '%s' with Status header successful.", cb_data->uri);
|
||||
new_state = NM_CONNECTIVITY_FULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Check response */
|
||||
if (cb_data->msg && g_str_has_prefix (cb_data->msg, cb_data->response)) {
|
||||
_LOGD ("Check for uri '%s' successful.", cb_data->uri);
|
||||
|
|
@ -414,7 +407,9 @@ easy_header_cb (char *buffer, size_t size, size_t nitems, void *userdata)
|
|||
|
||||
if ( len >= sizeof (HEADER_STATUS_ONLINE) - 1
|
||||
&& !g_ascii_strncasecmp (buffer, HEADER_STATUS_ONLINE, sizeof (HEADER_STATUS_ONLINE) - 1)) {
|
||||
cb_data->online_header = TRUE;
|
||||
_LOGD ("check for uri '%s' with Status header successful.", cb_data->uri);
|
||||
finish_cb_data (cb_data, NM_CONNECTIVITY_FULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return len;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue