ggz-server stable port information

Package: ggz-server
Version: 0.0.11
Revision: 1012
Description: GGZ Gaming Zone server
License: LGPL
Maintainer: Dave Vasilevsky

BuildDepends: <<
libggz-crypto (>= %v-12) | libggz (>= %v-12), libgettext3-dev, gettext-bin,
libiconv-dev, popt, expat1, libhowl-dev, db43-ssl (>= 4.3.29-1001) | db43 (>= 4.3.29-1001)
<<

Depends: <<
%N-shlibs (= %v-%r), db43-ssl-shlibs (>= 4.3.29-1001) | db43-shlibs (>= 4.3.29-1001),
libgettext3-shlibs, libiconv, popt-shlibs, expat1-shlibs, libhowl-shlibs
<<

CustomMirror: <<
primary: http://ftp.ggzgamingzone.org/pub/
eur-be: http://ftp.belnet.be/packages/ggzgamingzone/
eur-dk: http://mirrors.sunsite.dk/ggzgamingzone/
eur-de: http://ftp.de.ggzgamingzone.org/pub/
eur-uk: http://uk.ggzgamingzone.org/pub/
eur-fr: http://ftp.fr.ggzgamingzone.org/pub/
<<
Source: mirror:custom:ggz/%v/%n-%v.tar.gz
Source-MD5: f4ccb7d76adba5091e0aa0cc4f981abc

Patch: %n.patch

# For howl
SetLDFLAGS: -framework CoreFoundation
SetCPPFLAGS: -I%p/include/howl -fsigned-char -I%p/include/db4

ConfigureParams: --mandir=%p/share/man --enable-debug-gdb --with-database=db4
InstallScript: make install DESTDIR=%d
GCC: 4.0

DocFiles: <<
AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README README.GGZ
TODO
<<

Homepage: http://www.ggzgamingzone.org/
DescDetail: <<
This is the software for setting up and managing a GGZ server
installation, including the server game modules. Note that if you
only want to play games on an existing server, you do not need to
install this.
<<

SplitOff: <<
Package: %N-shlibs
Depends: libggz-crypto-shlibs (>= %v-12) | libggz-shlibs (>= %v-12)
Files: lib/*.*.dylib
Shlibs: <<
%p/lib/libggzdmod.4.dylib 5.0.0 %n (>= 0.0.11-11)
<<
DocFiles: <<
AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README README.GGZ
TODO
<<
<<
SplitOff2: <<
Package: %N-dev
BuildDependsOnly: true
Depends: %N-shlibs (= %v-%r)
Files: lib/*[!.][!.][!.].[adl]* include share/man/man3
DocFiles: <<
AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README README.GGZ
TODO
<<
<<

ggz-server stable port .patch

diff -Naur server-old/game_servers/ggzcards/ai.c server-new/game_servers/ggzcards/ai.c
--- server-old/game_servers/ggzcards/ai.c 2002-09-03 00:55:18.000000000 -0400
+++ server-new/game_servers/ggzcards/ai.c 2005-06-19 12:29:06.000000000 -0400
@@ -40,7 +40,7 @@
#include
#include
#include
-#include
+#include

#include "ai.h"
#include "common.h"
diff -Naur server-old/ggzd/client.c server-new/ggzd/client.c
--- server-old/ggzd/client.c 2004-11-17 17:02:24.000000000 -0500
+++ server-new/ggzd/client.c 2005-06-19 12:29:06.000000000 -0400
@@ -99,9 +99,8 @@
struct sockaddr_in addr;
GGZClient *client;
int addrlen = sizeof(addr);
- struct hostent hostbuf, *hp;
- char tmphstbuf[1024];
- int rc, herr;
+ struct hostent *hp;
+ int rc;

/* Get our arguments out of the arg buffer */
sock = *((int *)arg_ptr);
@@ -122,14 +121,24 @@

rc = -1;
if (opt.perform_lookups) {
- rc = gethostbyaddr_r(&addr.sin_addr, sizeof(struct in_addr),
- AF_INET, &hostbuf, tmphstbuf, 1024, &hp, &herr);
+ static pthread_mutex_t gethostbyaddr_mutex;
+ static int gethostbyaddr_mutex_inited = 0;
+ if (!gethostbyaddr_mutex_inited) {
+ gethostbyaddr_mutex_inited = 1;
+ pthread_mutex_init(&gethostbyaddr_mutex, NULL);
+ }
+ pthread_mutex_lock(&gethostbyaddr_mutex);
+
+ hp = gethostbyaddr((char*)&addr.sin_addr, sizeof(struct in_addr),
+ AF_INET);
/* Note if we get an error we don't bother expanding the */
/* buffer or so forth. Is the hostname vs. IP that important? */
- if(rc == 0) {
- strncpy(client->addr, hostbuf.h_name, sizeof(client->addr));
+ if(hp != NULL) {
+ strncpy(client->addr, hp->h_name, sizeof(client->addr));
client->addr[sizeof(client->addr)-1] = '\0';
}
+
+ pthread_mutex_unlock(&gethostbyaddr_mutex);
}
if (rc < 0)
inet_ntop(AF_INET, &addr.sin_addr, client->addr, sizeof(client->addr));
diff -Naur server-old/ggzd/control.c server-new/ggzd/control.c
--- server-old/ggzd/control.c 2005-05-16 17:11:37.000000000 -0400
+++ server-new/ggzd/control.c 2005-06-19 19:00:20.000000000 -0400
@@ -215,8 +215,6 @@
int main(int argc, char *argv[])
{
int main_sock, new_sock, status, flags;
- socklen_t addrlen;
- struct sockaddr_in addr;
fd_set active_fd_set, read_fd_set;
struct timeval tv;

@@ -336,17 +334,12 @@
continue;
}

- addrlen = sizeof(addr);
- if ( (new_sock = accept(main_sock, (struct sockaddr*)&addr, &addrlen)) < 0) {
- switch (errno) {
- case EWOULDBLOCK:
- case ECONNABORTED:
- case EINTR:
+ new_sock = ggz_accept(main_sock);
+ if (new_sock < 0) {
+ if (new_sock == -1)
continue;
- break;
- default:
+ else
err_sys_exit("Error accepting connection");
- }
} else {
/* This is where to test for ignored IP addresses */
client_handler_launch(new_sock);

ggz-server _unstable_ port information

Package: ggz-server
Version: 0.0.11
Revision: 1012
Description: GGZ Gaming Zone server
License: LGPL
Maintainer: Dave Vasilevsky

BuildDepends: <<
libggz-crypto (>= %v-12) | libggz (>= %v-12), libgettext3-dev, gettext-bin,
libiconv-dev, popt, expat1, libhowl-dev, db43-ssl (>= 4.3.29-1001) | db43 (>= 4.3.29-1001)
<<

Depends: <<
%N-shlibs (= %v-%r), db43-ssl-shlibs (>= 4.3.29-1001) | db43-shlibs (>= 4.3.29-1001),
libgettext3-shlibs, libiconv, popt-shlibs, expat1-shlibs, libhowl-shlibs
<<

CustomMirror: <<
primary: http://ftp.ggzgamingzone.org/pub/
eur-be: http://ftp.belnet.be/packages/ggzgamingzone/
eur-dk: http://mirrors.sunsite.dk/ggzgamingzone/
eur-de: http://ftp.de.ggzgamingzone.org/pub/
eur-uk: http://uk.ggzgamingzone.org/pub/
eur-fr: http://ftp.fr.ggzgamingzone.org/pub/
<<
Source: mirror:custom:ggz/%v/%n-%v.tar.gz
Source-MD5: f4ccb7d76adba5091e0aa0cc4f981abc

Patch: %n.patch

# For howl
SetLDFLAGS: -framework CoreFoundation
SetCPPFLAGS: -I%p/include/howl -fsigned-char -I%p/include/db4

ConfigureParams: --mandir=%p/share/man --enable-debug-gdb --with-database=db4
InstallScript: make install DESTDIR=%d
GCC: 4.0

DocFiles: <<
AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README README.GGZ
TODO
<<

Homepage: http://www.ggzgamingzone.org/
DescDetail: <<
This is the software for setting up and managing a GGZ server
installation, including the server game modules. Note that if you
only want to play games on an existing server, you do not need to
install this.
<<

SplitOff: <<
Package: %N-shlibs
Depends: libggz-crypto-shlibs (>= %v-12) | libggz-shlibs (>= %v-12)
Files: lib/*.*.dylib
Shlibs: <<
%p/lib/libggzdmod.4.dylib 5.0.0 %n (>= 0.0.11-11)
<<
DocFiles: <<
AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README README.GGZ
TODO
<<
<<
SplitOff2: <<
Package: %N-dev
BuildDependsOnly: true
Depends: %N-shlibs (= %v-%r)
Files: lib/*[!.][!.][!.].[adl]* include share/man/man3
DocFiles: <<
AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README README.GGZ
TODO
<<
<<

ggz-server _unstable_ port .patch

diff -Naur server-old/game_servers/ggzcards/ai.c server-new/game_servers/ggzcards/ai.c
--- server-old/game_servers/ggzcards/ai.c 2002-09-03 00:55:18.000000000 -0400
+++ server-new/game_servers/ggzcards/ai.c 2005-06-19 12:29:06.000000000 -0400
@@ -40,7 +40,7 @@
#include
#include
#include
-#include
+#include

#include "ai.h"
#include "common.h"
diff -Naur server-old/ggzd/client.c server-new/ggzd/client.c
--- server-old/ggzd/client.c 2004-11-17 17:02:24.000000000 -0500
+++ server-new/ggzd/client.c 2005-06-19 12:29:06.000000000 -0400
@@ -99,9 +99,8 @@
struct sockaddr_in addr;
GGZClient *client;
int addrlen = sizeof(addr);
- struct hostent hostbuf, *hp;
- char tmphstbuf[1024];
- int rc, herr;
+ struct hostent *hp;
+ int rc;

/* Get our arguments out of the arg buffer */
sock = *((int *)arg_ptr);
@@ -122,14 +121,24 @@

rc = -1;
if (opt.perform_lookups) {
- rc = gethostbyaddr_r(&addr.sin_addr, sizeof(struct in_addr),
- AF_INET, &hostbuf, tmphstbuf, 1024, &hp, &herr);
+ static pthread_mutex_t gethostbyaddr_mutex;
+ static int gethostbyaddr_mutex_inited = 0;
+ if (!gethostbyaddr_mutex_inited) {
+ gethostbyaddr_mutex_inited = 1;
+ pthread_mutex_init(&gethostbyaddr_mutex, NULL);
+ }
+ pthread_mutex_lock(&gethostbyaddr_mutex);
+
+ hp = gethostbyaddr((char*)&addr.sin_addr, sizeof(struct in_addr),
+ AF_INET);
/* Note if we get an error we don't bother expanding the */
/* buffer or so forth. Is the hostname vs. IP that important? */
- if(rc == 0) {
- strncpy(client->addr, hostbuf.h_name, sizeof(client->addr));
+ if(hp != NULL) {
+ strncpy(client->addr, hp->h_name, sizeof(client->addr));
client->addr[sizeof(client->addr)-1] = '\0';
}
+
+ pthread_mutex_unlock(&gethostbyaddr_mutex);
}
if (rc < 0)
inet_ntop(AF_INET, &addr.sin_addr, client->addr, sizeof(client->addr));
diff -Naur server-old/ggzd/control.c server-new/ggzd/control.c
--- server-old/ggzd/control.c 2005-05-16 17:11:37.000000000 -0400
+++ server-new/ggzd/control.c 2005-06-19 19:00:20.000000000 -0400
@@ -215,8 +215,6 @@
int main(int argc, char *argv[])
{
int main_sock, new_sock, status, flags;
- socklen_t addrlen;
- struct sockaddr_in addr;
fd_set active_fd_set, read_fd_set;
struct timeval tv;

@@ -336,17 +334,12 @@
continue;
}

- addrlen = sizeof(addr);
- if ( (new_sock = accept(main_sock, (struct sockaddr*)&addr, &addrlen)) < 0) {
- switch (errno) {
- case EWOULDBLOCK:
- case ECONNABORTED:
- case EINTR:
+ new_sock = ggz_accept(main_sock);
+ if (new_sock < 0) {
+ if (new_sock == -1)
continue;
- break;
- default:
+ else
err_sys_exit("Error accepting connection");
- }
} else {
/* This is where to test for ignored IP addresses */
client_handler_launch(new_sock);