]> git.ipfire.org Git - thirdparty/git.git/blobdiff - daemon.c
l10n: tr: v2.34.0 round 3
[thirdparty/git.git] / daemon.c
index 5c4cbad62d0caa723a874392097512a0df5933cd..b1fcbe0d6fa847dd936467c0d8d1aeffbf90d1cc 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -63,6 +63,12 @@ struct hostinfo {
        unsigned int hostname_lookup_done:1;
        unsigned int saw_extended_args:1;
 };
+#define HOSTINFO_INIT { \
+       .hostname = STRBUF_INIT, \
+       .canon_hostname = STRBUF_INIT, \
+       .ip_address = STRBUF_INIT, \
+       .tcp_port = STRBUF_INIT, \
+}
 
 static void lookup_hostname(struct hostinfo *hi);
 
@@ -727,15 +733,6 @@ static void lookup_hostname(struct hostinfo *hi)
        }
 }
 
-static void hostinfo_init(struct hostinfo *hi)
-{
-       memset(hi, 0, sizeof(*hi));
-       strbuf_init(&hi->hostname, 0);
-       strbuf_init(&hi->canon_hostname, 0);
-       strbuf_init(&hi->ip_address, 0);
-       strbuf_init(&hi->tcp_port, 0);
-}
-
 static void hostinfo_clear(struct hostinfo *hi)
 {
        strbuf_release(&hi->hostname);
@@ -760,17 +757,15 @@ static int execute(void)
        char *line = packet_buffer;
        int pktlen, len, i;
        char *addr = getenv("REMOTE_ADDR"), *port = getenv("REMOTE_PORT");
-       struct hostinfo hi;
+       struct hostinfo hi = HOSTINFO_INIT;
        struct strvec env = STRVEC_INIT;
 
-       hostinfo_init(&hi);
-
        if (addr)
                loginfo("Connection from %s:%s", addr, port);
 
        set_keep_alive(0);
        alarm(init_timeout ? init_timeout : timeout);
-       pktlen = packet_read(0, NULL, NULL, packet_buffer, sizeof(packet_buffer), 0);
+       pktlen = packet_read(0, packet_buffer, sizeof(packet_buffer), 0);
        alarm(0);
 
        len = strlen(line);