mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 12:53:33 +00:00
fetch(1): suppress "Not Modified" in quiet mode
"fetch -qi" should skip printing "Not Modified" for successful http(s) request. Still print it by default (v_level == 1). MFC after: 1 week
This commit is contained in:
parent
3df987c99d
commit
7a6309fdc7
@ -582,16 +582,17 @@ again:
|
||||
if (sigalrm || sigint)
|
||||
goto signal;
|
||||
if (f == NULL) {
|
||||
warnx("%s: %s", URL, fetchLastErrString);
|
||||
if (i_flag && (strcmp(url->scheme, SCHEME_HTTP) == 0 ||
|
||||
strcmp(url->scheme, SCHEME_HTTPS) == 0) &&
|
||||
fetchLastErrCode == FETCH_OK &&
|
||||
if (i_flag && *is_http && fetchLastErrCode == FETCH_OK &&
|
||||
strcmp(fetchLastErrString, "Not Modified") == 0) {
|
||||
/* HTTP Not Modified Response, return OK. */
|
||||
if (v_level > 0)
|
||||
warnx("%s: %s", URL, fetchLastErrString);
|
||||
r = 0;
|
||||
goto done;
|
||||
} else
|
||||
} else {
|
||||
warnx("%s: %s", URL, fetchLastErrString);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
if (sigint)
|
||||
goto signal;
|
||||
|
Loading…
Reference in New Issue
Block a user