Working with c-ares >= 1.5.0 too. Other portability issues.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 4 Nov 2009 17:27:57 +0000 (17:27 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 4 Nov 2009 17:27:57 +0000 (17:27 +0000)
org.glite.security.gss/Makefile
org.glite.security.gss/interface/glite_gss.h
org.glite.security.gss/src/glite_gss.c
org.glite.security.gss/test/test_gss.cpp

index 579674f..2d0edec 100644 (file)
@@ -39,7 +39,6 @@ CFLAGS:= ${DEBUG} \
        -DVERSION=\"${version}\" \
        -I. -I${top_srcdir}/interface \
        -I${stagedir}/include \
-       -I${cares_prefix}/include \
        ${COVERAGE_FLAGS} -D_GNU_SOURCE -DDATAGRID_EXTENSION
 
 LDFLAGS:=${COVERAGE_FLAGS}
@@ -60,6 +59,7 @@ GLOBUS_THR_LIBS:= -L${globus_prefix}/lib \
        -lglobus_common_${thrflavour} \
        -lglobus_gssapi_gsi_${thrflavour}
 
+ARES_INC:=-I${cares_prefix}/include
 ARES_LIBS:=-L${cares_prefix}/lib -lcares
 
 EX_LIBS:= ${GLOBUS_LIBS} ${ARES_LIBS}
@@ -132,10 +132,10 @@ clean:
        rm -rf *.o *.lo *.a *.la .libs test_gss
 
 %.o: %.c
-       ${COMPILE} ${GLOBUS_INC} -o $@ -c $<
+       ${COMPILE} ${GLOBUS_INC} ${ARES_INC} -o $@ -c $<
 
 %.thr.o: %.c
-       ${COMPILE} ${GLOBUS_THR_INC} -o $@ -c $<
+       ${COMPILE} ${GLOBUS_THR_INC} ${ARES_INC} -o $@ -c $<
 
 test_gss.o: %.o: %.cpp
        ${CXX} -c ${CFLAGS} ${GLOBUS_INC} ${TEST_INC} -Wno-error $<
index 4a41cfa..e3cf418 100644 (file)
@@ -7,6 +7,7 @@
 extern "C" {
 #endif
 
+#include <sys/time.h>
 #include <stdlib.h>
 
 enum {
index 5474767..0cb7d9c 100644 (file)
@@ -14,6 +14,7 @@
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <ares.h>
+#include <ares_version.h>
 #include <errno.h>
 
 #include <globus_common.h>
@@ -54,7 +55,12 @@ static int decrement_timeout(struct timeval *timeout, struct timeval before, str
 }
 
 /* ares callback handler for ares_gethostbyname()       */
-static void callback_handler(void *arg, int status, struct hostent *h) {
+#if ARES_VERSION >= 0x010500
+static void callback_handler(void *arg, int status, int timeouts, struct hostent *h)
+#else
+static void callback_handler(void *arg, int status, struct hostent *h)
+#endif
+{
        struct asyn_result *arp = (struct asyn_result *) arg;
 
        switch (status) {
index 4fa2845..6e8c87e 100644 (file)
@@ -77,6 +77,7 @@ void GSSTest::setUp(void) {
 
        timeout.tv_sec = to ? atoi(to) : 10 ;
        timeout.tv_usec = 0;
+       my_cred = NULL;
        
        key_file = cred_file = getenv("X509_USER_PROXY");
        CPPUNIT_ASSERT_MESSAGE("credential file", cred_file);
@@ -87,6 +88,7 @@ void GSSTest::setUp(void) {
         sock = socket(PF_INET,SOCK_STREAM,0);
        CPPUNIT_ASSERT_MESSAGE("socket()", sock >= 0);
 
+       memset(&a, 0, sizeof a);
         a.sin_family = AF_INET;
         a.sin_port = 0;
         a.sin_addr.s_addr = INADDR_ANY;