Index: code/unix/unix_net.c
===================================================================
--- code/unix/unix_net.c	(revision 30)
+++ code/unix/unix_net.c	(working copy)
@@ -542,113 +542,116 @@
 	Com_Error (ERR_FATAL, "Couldn't allocate IP port");
 }
 
-//wopMaster{
-//#define WOP_MASTERSERVER "62.67.235.28" //"62.67.235.28" ("www.base0x23.de") //"127.0.0.1"
-// ip wird jetzt über Sys_StringToAdr ermittelt
-//#define WOP_MASTERHOST "base0x23.de"
-
-#define MAX_WOPMASTER_BUFFER 256
-
-void NET_wopMasterRefresh(int master, const netadr_t* masterAddr, int port)
-{
-	struct sockaddr_in	address;
-	int		r;
-	char	sHttpAnfrage[MAX_WOPMASTER_BUFFER];
-	int		WMsocket;
-//	netadr_t qaddr;
-
-//	if(!Sys_StringToAdr(WOP_MASTERHOST,&qaddr))
-//		return;
-
-	//noch zu ändern    vvvvvvvvvvvvvvvvvvvvv
-//	sprintf(sHttpAnfrage,"GET /cgi-bin/wopMaster.pl?%i HTTP/1.0\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",port,WOP_MASTERHOST);
-	Com_sprintf(sHttpAnfrage,MAX_WOPMASTER_BUFFER,"GET %s?%i HTTP/1.0\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",wop_masterHB[master]->string,port,wop_master[master]->string);
-	
-	// connect a socket to the server
-	WMsocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
-//	if (WMsocket == -1)
-//		Error ("WMsocket failed");
-
-	address.sin_family = AF_INET;
-	address.sin_addr.s_addr = *((int*)masterAddr->ip);
-	address.sin_port = htons(80);
-	r = connect( WMsocket, (struct sockaddr *)&address, sizeof(address));
-	if (r == -1)
-	{
-//		Error("couldn't connect -.-");
-		close(WMsocket);
-		WMsocket = 0;
-	}
-  
-	send( WMsocket, sHttpAnfrage, strlen(sHttpAnfrage), 0);
-
-	close(WMsocket);
-	WMsocket = 0;
-}
-
-int		WSLsocket;
-
-int NET_wopConnectToServerlist(int Serverlist,const char* filter)// I don't know if I will ever use the filter
-{
-	struct sockaddr_in	address;
-	int		r;
-	char	sHttpAnfrage[MAX_WOPMASTER_BUFFER];
-	netadr_t qaddr;
-	if(Serverlist<0 || Serverlist>=MAX_WOPMASTER_SERVERS)
-		return -1;
-
-	WSLsocket = 0;
-
-	if(!Sys_StringToAdr(wop_master[Serverlist]->string,&qaddr))
-		return -1;
-
-	//noch zu ändern    vvvvvvvvvvvvvvvvvvvvv
-//	sprintf(sHttpAnfrage,"GET /cgi-bin/wopServerlist.pl?%s HTTP/1.0\r\nUser-Agent: WoPClient\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",filter,WOP_MASTERHOST);
-	Com_sprintf(sHttpAnfrage,MAX_WOPMASTER_BUFFER,"GET %s?%s HTTP/1.0\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",wop_masterSL[Serverlist]->string,filter,wop_master[Serverlist]->string);
-	
-	// connect a socket to the server
-	WSLsocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
-//	if (WMsocket == -1)
-//		Error ("WMsocket failed");
-
-	address.sin_family = AF_INET;
-	address.sin_addr.s_addr = *((int*)qaddr.ip);//inet_addr(WOP_MASTERSERVER);//htonl(INADDR_LOOPBACK);
-	address.sin_port = htons(80);
-	r = connect( WSLsocket, (struct sockaddr *)&address, sizeof(address));
-	if (r == -1)
-	{
-//		Error("couldn't connect -.-");
-		close(WSLsocket);
-		WSLsocket = 0;
-		return -1;
-	}
-	else
-		send( WSLsocket, sHttpAnfrage, strlen(sHttpAnfrage), 0);
-
-	return 0;
-}
-
-void NET_wopGetBlockFromServerlist(char* buffer,int max)
-{
-	memset(buffer,0,max);
-
-	if(WSLsocket)
-	{
-		if(recv(WSLsocket,buffer,max-1,0)<=0)
-			NET_wopDisconnectFromServerlist();
-	}
-}
-
-void NET_wopDisconnectFromServerlist(void)
-{
-	if(WSLsocket)
-	{
-		close(WSLsocket);
-		WSLsocket = 0;
-	}
-}
-//wopMaster}
+//wopMaster{
+//#define WOP_MASTERSERVER "62.67.235.28" //"62.67.235.28" ("www.base0x23.de") //"127.0.0.1"
+// ip wird jetzt ueber Sys_StringToAdr ermittelt
+//#define WOP_MASTERHOST "base0x23.de"
 
+#define MAX_WOPMASTER_BUFFER 256
+
+int NET_wopMasterRefresh(int master, const netadr_t* masterAddr, int port)
+{
+	struct sockaddr_in	address;
+	int		r;
+	char	sHttpAnfrage[MAX_WOPMASTER_BUFFER];
+	int		WMsocket;
+//	netadr_t qaddr;
+
+//	if(!Sys_StringToAdr(WOP_MASTERHOST,&qaddr))
+//		return;
+
+	//noch zu aendern    vvvvvvvvvvvvvvvvvvvvv
+//	sprintf(sHttpAnfrage,"GET /cgi-bin/wopMaster.pl?%i HTTP/1.0\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",port,WOP_MASTERHOST);
+	Com_sprintf(sHttpAnfrage,MAX_WOPMASTER_BUFFER,"GET %s?%i HTTP/1.0\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",wop_masterHB[master]->string,port,wop_master[master]->string);
+	
+	// connect a socket to the server
+	WMsocket = socket(PF_INET, SOCK_STREAM, 0);
+	if (WMsocket < 0)
+	{
+		Com_Printf("Warning: Opening a socket in order to update the WoP master server failed!");
+		return qfalse;
+	}
+
+	address.sin_family = AF_INET;
+	address.sin_addr.s_addr = *((int*)masterAddr->ip);
+	address.sin_port = htons(80);
+	r = connect( WMsocket, (struct sockaddr *)&address, sizeof(address));
+	if (r < 0)
+	{
+		Com_Printf("Warning: Couldn't connect to WoP master server");
+		close(WMsocket);
+		return qfalse;
+	}
+  
+	send( WMsocket, sHttpAnfrage, strlen(sHttpAnfrage), 0);
+
+	close(WMsocket);
+	return qtrue;
+}
+
+int		WSLsocket;
+
+int NET_wopConnectToServerlist(int Serverlist,const char* filter)// I don't know if I will ever use the filter
+{
+	struct sockaddr_in	address;
+	int		r;
+	char	sHttpAnfrage[MAX_WOPMASTER_BUFFER];
+	netadr_t qaddr;
+	if(Serverlist<0 || Serverlist>=MAX_WOPMASTER_SERVERS)
+		return -1;
+
+	WSLsocket = 0;
+
+	if(!Sys_StringToAdr(wop_master[Serverlist]->string,&qaddr))
+		return -1;
+
+	//noch zu ändern    vvvvvvvvvvvvvvvvvvvvv
+//	sprintf(sHttpAnfrage,"GET /cgi-bin/wopServerlist.pl?%s HTTP/1.0\r\nUser-Agent: WoPClient\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",filter,WOP_MASTERHOST);
+	Com_sprintf(sHttpAnfrage,MAX_WOPMASTER_BUFFER,"GET %s?%s HTTP/1.0\r\nUser-Agent: WoPServer\r\nHost: %s\r\n\r\n",wop_masterSL[Serverlist]->string,filter,wop_master[Serverlist]->string);
+	
+	// connect a socket to the server
+	WSLsocket = socket(PF_INET, SOCK_STREAM, 0);
+	if (WSLsocket < 0)
+		return -1;
+
+	address.sin_family = AF_INET;
+	address.sin_addr.s_addr = *((int*)qaddr.ip);//inet_addr(WOP_MASTERSERVER);//htonl(INADDR_LOOPBACK);
+	address.sin_port = htons(80);
+	r = connect( WSLsocket, (struct sockaddr *)&address, sizeof(address));
+	if (r == -1)
+	{
+//		Error("couldn't connect -.-");
+		close(WSLsocket);
+		WSLsocket = 0;
+		return -1;
+	}
+	else
+		send( WSLsocket, sHttpAnfrage, strlen(sHttpAnfrage), 0);
+
+	return 0;
+}
+
+void NET_wopGetBlockFromServerlist(char* buffer,int max)
+{
+	memset(buffer,0,max);
+
+	if(WSLsocket)
+	{
+		if(recv(WSLsocket,buffer,max-1,0)<=0)
+			NET_wopDisconnectFromServerlist();
+	}
+}
+
+void NET_wopDisconnectFromServerlist(void)
+{
+	if(WSLsocket)
+	{
+		close(WSLsocket);
+		WSLsocket = 0;
+	}
+}
+//wopMaster}
+
 /*
 ====================
 NET_Init
Index: code/server/sv_main.c
===================================================================
--- code/server/sv_main.c	(revision 30)
+++ code/server/sv_main.c	(working copy)
@@ -283,9 +283,9 @@
 =================
 */
 void SV_MasterShutdown( void ) {
-//wopMaster{
-	return; // for wopMaster, there is no sense in heartbeats on shutdown
-//wopMaster}
+//wopMaster{
+	return; // for wopMaster, there is no sense in heartbeats on shutdown
+//wopMaster}
 	// send a hearbeat right now
 	svs.nextHeartbeatTime = -9999;
 	SV_MasterHeartbeat();
@@ -297,68 +297,68 @@
 	// when the master tries to poll the server, it won't respond, so
 	// it will be removed from the list
 }
-
-//wopMaster{
-/*
-#######################
-SV_WoPMasterUpadte
-
-  sending a http-request to the wop-masterserver
-#######################
-*/
-#define	WM_UPDATEINTERVAL	15*60*1000
-void SV_WoPMasterUpadte(void)
-{
-	static netadr_t	adr[MAX_MASTER_SERVERS];
-	int			i;
-	int port = Cvar_Get( "net_port", va( "%i", PORT_SERVER ), CVAR_LATCH )->integer;
-
-	// "dedicated 1" is for lan play, "dedicated 2" is for inet public play
-	if ( !com_dedicated || com_dedicated->integer != 2 ) {
-		return;		// only dedicated servers send heartbeats
-	}
-
-	// if not time yet, don't send anything
-	if ( svs.time < svs.nextWoPMasterUpdate ) {
-		return;
-	}
-	svs.nextWoPMasterUpdate = svs.time + WM_UPDATEINTERVAL;
-
-	// send to group masters
-	for ( i = 0 ; i < MAX_WOPMASTER_SERVERS ; i++ ) {
-		if ( !wop_master[i]->string[0] ) {
-			continue;
-		}
-
-		// see if we haven't already resolved the name
-		// resolving usually causes hitches on win95, so only
-		// do it when needed
-		if ( wop_master[i]->modified ) {
-			wop_master[i]->modified = qfalse;
-	
-			Com_Printf( "Resolving %s\n", wop_master[i]->string );
-			if ( !NET_StringToAdr( wop_master[i]->string, &adr[i] ) ) {
-				// if the address failed to resolve, clear it
-				// so we don't take repeated dns hits
-				Com_Printf( "Couldn't resolve address: %s\n", wop_master[i]->string );
-				Cvar_Set( wop_master[i]->name, "" );
-				wop_master[i]->modified = qfalse;
-				continue;
-			}
-			if ( !strchr( sv_master[i]->string, ':' ) ) {
-				adr[i].port = BigShort( 80 );
-			}
-			Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", wop_master[i]->string,
-				adr[i].ip[0], adr[i].ip[1], adr[i].ip[2], adr[i].ip[3],
-				BigShort( adr[i].port ) );
-		}
-
-
-		NET_wopMasterRefresh(i, &adr[i], port);
-		Com_Printf(">> WOP MASTER updated (%s)\n",wop_master[i]->string);
-	}
+
+//wopMaster{
+/*
+#######################
+SV_WoPMasterUpadte
+
+  sending a http-request to the wop-masterserver
+#######################
+*/
+#define	WM_UPDATEINTERVAL	15*60*1000
+void SV_WoPMasterUpadte(void)
+{
+	static netadr_t	adr[MAX_MASTER_SERVERS];
+	int			i;
+	int port = Cvar_Get( "net_port", va( "%i", PORT_SERVER ), CVAR_LATCH )->integer;
+
+	// "dedicated 1" is for lan play, "dedicated 2" is for inet public play
+	if ( !com_dedicated || com_dedicated->integer != 2 ) {
+		return;		// only dedicated servers send heartbeats
+	}
+
+	// if not time yet, don't send anything
+	if ( svs.time < svs.nextWoPMasterUpdate ) {
+		return;
+	}
+	svs.nextWoPMasterUpdate = svs.time + WM_UPDATEINTERVAL;
+
+	// send to group masters
+	for ( i = 0 ; i < MAX_WOPMASTER_SERVERS ; i++ ) {
+		if ( !wop_master[i]->string[0] ) {
+			continue;
+		}
+
+		// see if we haven't already resolved the name
+		// resolving usually causes hitches on win95, so only
+		// do it when needed
+		if ( wop_master[i]->modified ) {
+			wop_master[i]->modified = qfalse;
+	
+			Com_Printf( "Resolving %s\n", wop_master[i]->string );
+			if ( !NET_StringToAdr( wop_master[i]->string, &adr[i] ) ) {
+				// if the address failed to resolve, clear it
+				// so we don't take repeated dns hits
+				Com_Printf( "Couldn't resolve address: %s\n", wop_master[i]->string );
+				Cvar_Set( wop_master[i]->name, "" );
+				wop_master[i]->modified = qfalse;
+				continue;
+			}
+			if ( !strchr( sv_master[i]->string, ':' ) ) {
+				adr[i].port = BigShort( 80 );
+			}
+			Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", wop_master[i]->string,
+				adr[i].ip[0], adr[i].ip[1], adr[i].ip[2], adr[i].ip[3],
+				BigShort( adr[i].port ) );
+		}
+
+
+		if(NET_wopMasterRefresh(i, &adr[i], port))
+			Com_Printf(">> WOP MASTER updated (%s)\n",wop_master[i]->string);
+	}
 }
-//wopMaster}
+//wopMaster}
 
 /*
 ==============================================================================
@@ -946,8 +946,8 @@
 	SV_SendClientMessages();
 
 	// send a heartbeat to the master if needed
-//	SV_MasterHeartbeat();
-
+//	SV_MasterHeartbeat();
+
 	SV_WoPMasterUpadte();
 }
 
Index: code/qcommon/qcommon.h
===================================================================
--- code/qcommon/qcommon.h	(revision 30)
+++ code/qcommon/qcommon.h	(working copy)
@@ -154,14 +154,14 @@
 
 	unsigned short	port;
 } netadr_t;
-
-//wopMaster{
-void		NET_wopMasterRefresh(int master, const netadr_t* masterAddr, int port);
-int			NET_wopConnectToServerlist(int Serverlist,const char* filter);// I don't know if I will ever use the filter
-void		NET_wopGetBlockFromServerlist(char* buffer,int max);
-void		NET_wopDisconnectFromServerlist(void);
-//wopMaster}
 
+//wopMaster{
+int		NET_wopMasterRefresh(int master, const netadr_t* masterAddr, int port);
+int			NET_wopConnectToServerlist(int Serverlist,const char* filter);// I don't know if I will ever use the filter
+void		NET_wopGetBlockFromServerlist(char* buffer,int max);
+void		NET_wopDisconnectFromServerlist(void);
+//wopMaster}
+
 void		NET_Init( void );
 void		NET_Shutdown( void );
 void		NET_Restart( void );
@@ -247,17 +247,17 @@
 #endif
 #ifndef AUTHORIZE_SERVER_NAME
 #define	AUTHORIZE_SERVER_NAME	"" //"authorize.quake3arena.com"
-#endif
-
-//wopMaster{
-#define WOP_MASTER1_ADDR	"wop-engine.sourceforge.net"
-#define WOP_MASTER1_LIST	"/cgi-bin/wopServerlist.cgi"
-#define WOP_MASTER1_HB		"/cgi-bin/wopMaster.cgi"
-#define WOP_MASTER2_ADDR	"base0x23.de"
-#define WOP_MASTER2_LIST	"/cgi-bin/wopServerlist.pl"
-#define WOP_MASTER2_HB		"/cgi-bin/wopMaster.pl"
-//wopMaster}
+#endif
 
+//wopMaster{
+#define WOP_MASTER1_ADDR	"wop-engine.sourceforge.net"
+#define WOP_MASTER1_LIST	"/cgi-bin/wopServerlist.cgi"
+#define WOP_MASTER1_HB		"/cgi-bin/wopMaster.cgi"
+#define WOP_MASTER2_ADDR	"base0x23.de"
+#define WOP_MASTER2_LIST	"/cgi-bin/wopServerlist.pl"
+#define WOP_MASTER2_HB		"/cgi-bin/wopMaster.pl"
+//wopMaster}
+
 #define	PORT_MASTER			27950
 #define	PORT_UPDATE			27951
 #ifndef PORT_AUTHORIZE
@@ -780,18 +780,18 @@
 extern	cvar_t	*sv_paused;
 
 extern	cvar_t	*cl_packetdelay;
-extern	cvar_t	*sv_packetdelay;
-
-extern	cvar_t	*win_multiUser;
-
-//wopMaster{
-#define MAX_WOPMASTER_SERVERS 3
-extern	cvar_t	*wop_master[MAX_WOPMASTER_SERVERS];
-extern	cvar_t	*wop_masterHB[MAX_WOPMASTER_SERVERS];
-extern	cvar_t	*wop_masterSL[MAX_WOPMASTER_SERVERS];
-extern	cvar_t	*wop_Serverlist;
-//wopMaster}
+extern	cvar_t	*sv_packetdelay;
 
+extern	cvar_t	*win_multiUser;
+
+//wopMaster{
+#define MAX_WOPMASTER_SERVERS 3
+extern	cvar_t	*wop_master[MAX_WOPMASTER_SERVERS];
+extern	cvar_t	*wop_masterHB[MAX_WOPMASTER_SERVERS];
+extern	cvar_t	*wop_masterSL[MAX_WOPMASTER_SERVERS];
+extern	cvar_t	*wop_Serverlist;
+//wopMaster}
+
 // com_speeds times
 extern	int		time_game;
 extern	int		time_frontend;
Index: Makefile
===================================================================
--- Makefile	(revision 30)
+++ Makefile	(working copy)
@@ -247,7 +247,7 @@
     BASE_CFLAGS += -DNO_VM_COMPILED
   endif
 
-  DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
+  DEBUG_CFLAGS = $(BASE_CFLAGS) -g3 -ggdb
 
   RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
 

