fixed WIN32 compilation
authorpk910 <philipp@zoelle1.de>
Sun, 9 Sep 2012 08:43:57 +0000 (10:43 +0200)
committerpk910 <philipp@zoelle1.de>
Sun, 9 Sep 2012 08:46:10 +0000 (10:46 +0200)
src/modules/stats.mod/module.c

index c08e0fba58e8225341c6d8e5a2d1cc7563474c0f..e322754ab017e96f755c0268a152dbd361878282 100644 (file)
@@ -143,20 +143,21 @@ static TIMEQ_CALLBACK(stats_timer_callback) {
         if (!host) return;
         si_other.sin_addr = *(struct in_addr*)host->h_addr;
     }
+    sendto(sock, pkgbuf, pkgpos, 0, &si_other, sizeof(si_other));
     #else
     struct sockaddr_in si_other;
     int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
     if (sock == -1) return;
     si_other.sin_family = AF_INET;
     si_other.sin_port = htons(STATS_UPDATE_PORT);
-    si_other.sin_addr.s_addr = inet_addr(client->host);
+    si_other.sin_addr.s_addr = inet_addr(STATS_UPDATE_HOST);
     if (si_other.sin_addr.s_addr == INADDR_NONE) {
-        struct hostent *host = gethostbyname(client->host);
+        struct hostent *host = gethostbyname(STATS_UPDATE_HOST);
         if(!host) return;
         memcpy(&(si_other.sin_addr), host->h_addr_list[0], 4);
     }
+    sendto(sock, pkgbuf, pkgpos, 0, (struct sockaddr *) &si_other, sizeof(si_other));
     #endif
-    sendto(sock, pkgbuf, pkgpos, 0, &si_other, sizeof(si_other));
     close(sock);
 }