Commit 026c48e7 authored by Daniel Cohen Gindi's avatar Daniel Cohen Gindi

Fixed a violation of the C89 standard ("declarations must come before instructions")

parent 7f8520d0
...@@ -392,11 +392,13 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen) ...@@ -392,11 +392,13 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
getpeername(rfbScreen->httpSock, (struct sockaddr *)&addr, &addrlen); getpeername(rfbScreen->httpSock, (struct sockaddr *)&addr, &addrlen);
#ifdef LIBVNCSERVER_IPv6 #ifdef LIBVNCSERVER_IPv6
char host[1024]; {
if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) { char host[1024];
rfbLogPerror("httpProcessInput: error in getnameinfo"); if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
rfbLogPerror("httpProcessInput: error in getnameinfo");
}
rfbLog("httpd: get '%s' for %s\n", fname+1, host);
} }
rfbLog("httpd: get '%s' for %s\n", fname+1, host);
#else #else
rfbLog("httpd: get '%s' for %s\n", fname+1, rfbLog("httpd: get '%s' for %s\n", fname+1,
inet_ntoa(addr.sin_addr)); inet_ntoa(addr.sin_addr));
......
...@@ -320,12 +320,14 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, ...@@ -320,12 +320,14 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
if(isUDP) { if(isUDP) {
rfbLog(" accepted UDP client\n"); rfbLog(" accepted UDP client\n");
} else { } else {
#ifdef LIBVNCSERVER_IPv6
char host[1024];
#endif
int one=1; int one=1;
getpeername(sock, (struct sockaddr *)&addr, &addrlen); getpeername(sock, (struct sockaddr *)&addr, &addrlen);
#ifdef LIBVNCSERVER_IPv6 #ifdef LIBVNCSERVER_IPv6
char host[1024];
if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) { if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
rfbLogPerror("rfbNewClient: error in getnameinfo"); rfbLogPerror("rfbNewClient: error in getnameinfo");
cl->host = strdup(""); cl->host = strdup("");
......
...@@ -455,11 +455,13 @@ rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen) ...@@ -455,11 +455,13 @@ rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
#endif #endif
#ifdef LIBVNCSERVER_IPv6 #ifdef LIBVNCSERVER_IPv6
char host[1024]; {
if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) { char host[1024];
rfbLogPerror("rfbProcessNewConnection: error in getnameinfo"); if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
rfbLogPerror("rfbProcessNewConnection: error in getnameinfo");
}
rfbLog("Got connection from client %s\n", host);
} }
rfbLog("Got connection from client %s\n", host);
#else #else
rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr)); rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr));
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment