mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-16 23:32:37 +03:00
re-indent
This commit is contained in:
parent
b0f4e24ce0
commit
cce42c6882
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
|
|
||||||
static char* resolve_listen(const char *hostname, const char *port) {
|
static char* resolve_listen(const char *hostname, const char *port) {
|
||||||
|
|
||||||
/* Need room in the strcat for \0 and :
|
/* Need room in the strcat for \0 and :
|
||||||
* the format in the socket unit file is hostname:port */
|
* the format in the socket unit file is hostname:port */
|
||||||
char *conn = (char*)malloc(strlen(hostname)+strlen(port)+2);
|
char *conn = (char*)malloc(strlen(hostname)+strlen(port)+2);
|
||||||
@ -19,7 +18,6 @@ static char* resolve_listen(const char *hostname, const char *port) {
|
|||||||
|
|
||||||
|
|
||||||
static int get_listen_from_conf(const char *filename, char **listen) {
|
static int get_listen_from_conf(const char *filename, char **listen) {
|
||||||
|
|
||||||
config_t config;
|
config_t config;
|
||||||
config_setting_t *setting, *addr;
|
config_setting_t *setting, *addr;
|
||||||
const char *hostname, *port;
|
const char *hostname, *port;
|
||||||
@ -27,7 +25,6 @@ static int get_listen_from_conf(const char *filename, char **listen) {
|
|||||||
|
|
||||||
/* look up the listen stanzas in the config file so these
|
/* look up the listen stanzas in the config file so these
|
||||||
* can be used in the socket file generated */
|
* can be used in the socket file generated */
|
||||||
|
|
||||||
config_init(&config);
|
config_init(&config);
|
||||||
if (config_read_file(&config, filename) == CONFIG_FALSE) {
|
if (config_read_file(&config, filename) == CONFIG_FALSE) {
|
||||||
/* we don't care if file is missing, skip it */
|
/* we don't care if file is missing, skip it */
|
||||||
@ -51,7 +48,6 @@ static int get_listen_from_conf(const char *filename, char **listen) {
|
|||||||
config_setting_source_line(addr));
|
config_setting_source_line(addr));
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
listen[i] = malloc(strlen(resolve_listen(hostname, port)));
|
listen[i] = malloc(strlen(resolve_listen(hostname, port)));
|
||||||
strcpy(listen[i], resolve_listen(hostname, port));
|
strcpy(listen[i], resolve_listen(hostname, port));
|
||||||
}
|
}
|
||||||
@ -83,7 +79,6 @@ return 0;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int gen_sslh_config(char *runtime_unit_dir) {
|
static int gen_sslh_config(char *runtime_unit_dir) {
|
||||||
|
|
||||||
char *sslh_conf;
|
char *sslh_conf;
|
||||||
int num_addr;
|
int num_addr;
|
||||||
FILE *config;
|
FILE *config;
|
||||||
@ -125,11 +120,10 @@ static int gen_sslh_config(char *runtime_unit_dir) {
|
|||||||
|
|
||||||
|
|
||||||
return write_socket_unit(runtime_conf_fd, listen, num_addr, sslh_conf);
|
return write_socket_unit(runtime_conf_fd, listen, num_addr, sslh_conf);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]){
|
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]){
|
||||||
int r = 0;
|
int r = 0;
|
||||||
int k;
|
int k;
|
||||||
char *runtime_unit_dest = "";
|
char *runtime_unit_dest = "";
|
||||||
@ -147,7 +141,6 @@ int main(int argc, char *argv[]){
|
|||||||
r = k;
|
r = k;
|
||||||
|
|
||||||
return r < 0 ? -1 : 0;
|
return r < 0 ? -1 : 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user