1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Fix mixed-indentation in http.c

* http.c: Fix mix indentation. Visual change only.
This commit is contained in:
Darshit Shah 2015-08-29 09:45:13 +05:30
parent 7bed9a6f8f
commit 5c4489db9b

View File

@ -1281,28 +1281,28 @@ parse_strict_transport_security (const char *header, time_t *max_age, bool *incl
/* pass the parsed values over */ /* pass the parsed values over */
if (c_max_age) if (c_max_age)
{ {
/* If the string value goes out of a long's bounds, strtol() will return LONG_MIN or LONG_MAX. /* If the string value goes out of a long's bounds, strtol() will return LONG_MIN or LONG_MAX.
* In theory, the HSTS engine should be able to handle it. * In theory, the HSTS engine should be able to handle it.
* Also, time_t is normally defined as a long, so this should not break. * Also, time_t is normally defined as a long, so this should not break.
*/ */
if (max_age) if (max_age)
*max_age = (time_t) strtol (c_max_age, NULL, 10); *max_age = (time_t) strtol (c_max_age, NULL, 10);
if (include_subdomains) if (include_subdomains)
*include_subdomains = is; *include_subdomains = is;
DEBUGP (("Parsed Strict-Transport-Security max-age = %s, includeSubDomains = %s\n", DEBUGP (("Parsed Strict-Transport-Security max-age = %s, includeSubDomains = %s\n",
c_max_age, (is ? "true" : "false"))); c_max_age, (is ? "true" : "false")));
xfree (c_max_age); xfree (c_max_age);
success = true; success = true;
} }
else else
{ {
/* something weird happened */ /* something weird happened */
logprintf (LOG_VERBOSE, "Could not parse String-Transport-Security header\n"); logprintf (LOG_VERBOSE, "Could not parse String-Transport-Security header\n");
success = false; success = false;
} }
} }
return success; return success;
@ -3386,21 +3386,21 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
{ {
hsts_params = resp_header_strdup (resp, "Strict-Transport-Security"); hsts_params = resp_header_strdup (resp, "Strict-Transport-Security");
if (parse_strict_transport_security (hsts_params, &max_age, &include_subdomains)) if (parse_strict_transport_security (hsts_params, &max_age, &include_subdomains))
{ {
/* process strict transport security */ /* process strict transport security */
if (hsts_store_entry (hsts_store, u->scheme, u->host, u->port, max_age, include_subdomains)) if (hsts_store_entry (hsts_store, u->scheme, u->host, u->port, max_age, include_subdomains))
DEBUGP(("Added new HSTS host: %s:%u (max-age: %u, includeSubdomains: %s)\n", DEBUGP(("Added new HSTS host: %s:%u (max-age: %u, includeSubdomains: %s)\n",
u->host, u->host,
u->port, u->port,
(unsigned int) max_age, (unsigned int) max_age,
(include_subdomains ? "true" : "false"))); (include_subdomains ? "true" : "false")));
else else
DEBUGP(("Updated HSTS host: %s:%u (max-age: %u, includeSubdomains: %s)\n", DEBUGP(("Updated HSTS host: %s:%u (max-age: %u, includeSubdomains: %s)\n",
u->host, u->host,
u->port, u->port,
(unsigned int) max_age, (unsigned int) max_age,
(include_subdomains ? "true" : "false"))); (include_subdomains ? "true" : "false")));
} }
} }
#endif #endif