chiark / gitweb /
Better message for 503 from peer on idle conn. Conventional macro protection for...
[inn-innduct.git] / debian / patches / u_status_init_ip
1 Fix a bug in the IP address displayed for localhost in innd's status file.
2 It was not correctly initialized (it is a local connection which does not
3 use any IP address).
4
5 http://inn.eyrie.org/viewcvs/branches/2.4/innd/status.c?r1=7947&r2=7946&pathrev=7947&view=patch
6
7 --- 2.4/innd/status.c   2008/08/03 07:50:03     7946
8 +++ 2.4/innd/status.c   2008/08/03 07:55:20     7947
9 @@ -153,9 +153,14 @@
10        status = xmalloc(sizeof(STATUS));
11        peers++;                                              /* a new peer */
12        strlcpy(status->name, TempString, sizeof(status->name));
13 -      strlcpy(status->ip_addr,
14 -              sprint_sockaddr((struct sockaddr *)&cp->Address),
15 -              sizeof(status->ip_addr));
16 +      if (cp->Address.ss_family == 0) {
17 +        /* Connections from lc.c do not have an IP address. */
18 +        memset(&status->ip_addr, 0, sizeof(status->ip_addr));
19 +      } else {
20 +        strlcpy(status->ip_addr,
21 +          sprint_sockaddr((struct sockaddr *)&cp->Address),
22 +          sizeof(status->ip_addr));
23 +      }
24        status->can_stream = cp->Streaming;
25        status->seconds = status->Size = status->DuplicateSize = 0;
26        status->Ihave = status->Ihave_Duplicate =