_cleanup_strv_free_ char **words = NULL;
assert(getter);
- r = strv_split_quoted(&words, getter, false);
+ r = strv_split_quoted(&words, getter, 0);
if (r < 0)
return log_error_errno(r, "Failed to split getter option: %m");
static int add_source(RemoteServer *s, int fd, char* name, bool own_name) {
- RemoteSource *source;
+ RemoteSource *source = NULL;
int r;
/* This takes ownership of name, even on failure, if own_name is true. */
while (true) {
r = process_source(source, arg_compress, arg_seal);
- if (r == -EAGAIN || r == -EWOULDBLOCK)
+ if (r == -EAGAIN)
break;
else if (r < 0) {
log_warning("Failed to process data for connection %p", connection);
info = MHD_get_daemon_info(d->daemon, MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY);
if (!info) {
log_error("µhttp returned NULL daemon info");
- r = -ENOTSUP;
+ r = -EOPNOTSUPP;
goto error;
}
} else if (r == -E2BIG) {
log_notice_errno(E2BIG, "Entry too big, skipped");
return 1;
- } else if (r == -EAGAIN || r == -EWOULDBLOCK) {
+ } else if (r == -EAGAIN) {
return 0;
} else if (r < 0) {
log_debug_errno(r, "Closing connection: %m");
.size = sizeof(union sockaddr_union),
.type = SOCK_STREAM,
};
- char *hostname;
+ char *hostname = NULL;
fd2 = accept_connection("raw", fd, &addr, &hostname);
if (fd2 < 0)
return 0;
}
-static int setup_gnutls_logger(char **categories) {
- if (!arg_listen_http && !arg_listen_https)
- return 0;
-
-#ifdef HAVE_GNUTLS
- {
- char **cat;
- int r;
-
- gnutls_global_set_log_function(log_func_gnutls);
-
- if (categories) {
- STRV_FOREACH(cat, categories) {
- r = log_enable_gnutls_category(*cat);
- if (r < 0)
- return r;
- }
- } else
- log_reset_gnutls_level();
- }
-#endif
-
- return 0;
-}
-
int main(int argc, char **argv) {
RemoteServer s = {};
int r;
if (r <= 0)
return r == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
- r = setup_gnutls_logger(arg_gnutls_log);
- if (r < 0)
- return EXIT_FAILURE;
+
+ if (arg_listen_http || arg_listen_https) {
+ r = setup_gnutls_logger(arg_gnutls_log);
+ if (r < 0)
+ return EXIT_FAILURE;
+ }
if (arg_listen_https || https_socket >= 0)
if (load_certificates(&key, &cert, &trust) < 0)