mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-14 08:07:14 +03:00
Merge branch 'master' of https://github.com/yrutschle/sslh
This commit is contained in:
commit
bae16ab29e
4
common.c
4
common.c
@ -97,12 +97,12 @@ int make_listen_tfo(int s)
|
||||
|
||||
/* Don't do it if not supported */
|
||||
if (!TCP_FASTOPEN)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
/* Don't do it if any protocol does not specify it */
|
||||
for (i = 0; i < cfg.protocols_len; i++) {
|
||||
if (! cfg.protocols[i].tfo_ok)
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return setsockopt(s, SOL_SOCKET, TCP_FASTOPEN, (char*)&qlen, sizeof(qlen));
|
||||
|
@ -106,7 +106,7 @@ void start_echo(int fd)
|
||||
strcpy(buffer, prefix);
|
||||
|
||||
while (1) {
|
||||
ret = read(fd, buffer + prefix_len, sizeof(buffer));
|
||||
ret = read(fd, buffer + prefix_len, sizeof(buffer) - prefix_len);
|
||||
if (ret == -1) {
|
||||
fprintf(stderr, "%s", strerror(errno));
|
||||
return;
|
||||
|
10
sslh-main.c
10
sslh-main.c
@ -115,7 +115,7 @@ static void printsettings(void)
|
||||
}
|
||||
|
||||
|
||||
/* To removed in v1.21 */
|
||||
/* To be removed in v1.21 */
|
||||
const char* ssl_err_msg = "Usage of 'ssl' setting is deprecated and will be removed in v1.21. Please use 'tls' instead\n";
|
||||
void ssl_to_tls(char* setting)
|
||||
{
|
||||
@ -126,7 +126,7 @@ void ssl_to_tls(char* setting)
|
||||
}
|
||||
|
||||
|
||||
/* Turn 'ssl' command line option to 'tls'. To removed in v1.21 */
|
||||
/* Turn 'ssl' command line option to 'tls'. To be removed in v1.21 */
|
||||
void cmd_ssl_to_tls(int argc, char* argv[])
|
||||
{
|
||||
int i;
|
||||
@ -135,7 +135,7 @@ void cmd_ssl_to_tls(int argc, char* argv[])
|
||||
strcpy(argv[i], "--tls");
|
||||
/* foreground option not parsed yet, syslog not open, just print on
|
||||
* stderr and hope for the best */
|
||||
fprintf(stderr, ssl_err_msg);
|
||||
fprintf(stderr, "%s", ssl_err_msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -224,11 +224,11 @@ static void config_protocols()
|
||||
cfg.protocols[i].data = (void*)new_tls_data();
|
||||
if (cfg.protocols[i].sni_hostnames_len)
|
||||
tls_data_set_list(cfg.protocols[i].data, 0,
|
||||
cfg.protocols[i].sni_hostnames,
|
||||
(const char**) cfg.protocols[i].sni_hostnames,
|
||||
cfg.protocols[i].sni_hostnames_len);
|
||||
if (cfg.protocols[i].alpn_protocols_len)
|
||||
tls_data_set_list(cfg.protocols[i].data, 1,
|
||||
cfg.protocols[i].alpn_protocols,
|
||||
(const char**) cfg.protocols[i].alpn_protocols,
|
||||
cfg.protocols[i].alpn_protocols_len);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user