From aa5360a2359fc294c53a6f969b58f58ce9d216e5 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 2 Mar 2008 22:57:54 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@631 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/mmulti.c | 13 ++++++++----- polymer/eduke32/source/game.c | 8 ++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/polymer/build/src/mmulti.c b/polymer/build/src/mmulti.c index 7b35d96a7..5648c2d3d 100644 --- a/polymer/build/src/mmulti.c +++ b/polymer/build/src/mmulti.c @@ -821,14 +821,15 @@ int getpacket(int *retother, char *bufptr) return(0); } -int getexternaladdress(char *buffer) +int getexternaladdress(char *buffer, const char *host, int port) { int bytes_sent, i=0, j=0; struct sockaddr_in dest_addr; struct hostent *h; - char *host = "checkip.dyndns.org"; char *req = "GET / HTTP/1.0\r\n\r\n"; - char tempbuf[512], ipaddr[32]; + char tempbuf[1024], ipaddr[32]; + + memset(buffer, 0, sizeof(buffer)); #ifdef _WIN32 if (wsainitialized == 0) @@ -852,7 +853,7 @@ int getexternaladdress(char *buffer) dest_addr.sin_addr.s_addr = ((struct in_addr *)(h->h_addr))->s_addr; dest_addr.sin_family = AF_INET; - dest_addr.sin_port = htons(8245); + dest_addr.sin_port = htons(port); memset(&(dest_addr.sin_zero), '\0', 8); @@ -884,6 +885,8 @@ int getexternaladdress(char *buffer) for (i=0;(unsigned)i