mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 19:00:11 +01:00
Refactored hbuf and sbuf in piler-smtp.c
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
1e6a4b22c1
commit
1288c9fed3
@ -135,7 +135,6 @@ int main(int argc, char **argv){
|
||||
int client_len = sizeof(struct sockaddr_storage);
|
||||
ssize_t readlen;
|
||||
struct sockaddr_storage client_address;
|
||||
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
|
||||
char readbuf[BIGBUFSIZE];
|
||||
int efd;
|
||||
|
||||
@ -257,6 +256,10 @@ int main(int argc, char **argv){
|
||||
}
|
||||
}
|
||||
|
||||
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
|
||||
memset(hbuf, 0, sizeof(hbuf));
|
||||
memset(sbuf, 0, sizeof(sbuf));
|
||||
|
||||
if(getnameinfo((struct sockaddr *)&client_address, client_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0){
|
||||
// Strictly speaking it's not correct to log num_connections+1 connections
|
||||
// but it still gives a good clue how many connections we have at the moment
|
||||
|
Loading…
Reference in New Issue
Block a user