merge 1.5
authorAleš Křenek <ljocha@ics.muni.cz>
Wed, 15 Mar 2006 17:47:56 +0000 (17:47 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Wed, 15 Mar 2006 17:47:56 +0000 (17:47 +0000)
org.glite.lb.common/Makefile
org.glite.lb.common/interface/context-int.h
org.glite.lb.common/project/build.number
org.glite.lb.common/project/version.properties
org.glite.lb.common/src/context.c
org.glite.lb.common/src/il_msg.c
org.glite.lb.common/src/lb_plain_io.c
org.glite.lb.common/src/log_msg.c
org.glite.lb.common/src/ulm_parse.c
org.glite.lb.ws-interface/project/build.number
org.glite.lb.ws-interface/project/version.properties

index 5a19c87..5d2edc2 100644 (file)
@@ -53,6 +53,10 @@ GLOBUS_LIBS:=-L${globus_prefix}/lib \
         -lglobus_common_${nothrflavour} \
         -lglobus_gssapi_gsi_${nothrflavour} \
 
+GLOBUS_THRLIBS:=-L${globus_prefix}/lib \
+        -lglobus_common_${thrflavour} \
+        -lglobus_gssapi_gsi_${thrflavour} \
+
 GLITE_LIBS:=-L${glite_location}/lib
 
 ifneq (${expat_prefix},/usr)
@@ -65,6 +69,7 @@ LDFLAGS:=-L${stagedir}/lib \
     ${COVERAGE_FLAGS}
 
 EXT_LIBS:= ${EXPAT_LIBS} ${ARES_LIBS} ${GLOBUS_LIBS}
+EXT_THRLIBS:= ${EXPAT_LIBS} ${ARES_LIBS} ${GLOBUS_THRLIBS}
 
 # breaks linking when not installed in /opt, /home/dimeglio etc.
 #    ${GLITE_LIBS} \
@@ -89,8 +94,8 @@ LOBJS:=${OBJS:.o=.lo}
 TRIO_OBJS:=escape.o trio.o strio.o
 TRIO_LIB:=libglite_lb_trio.a
 
-MAILDIR_OBJS:=lb_maildir.o
-MAILDIR_LIB:=libglite_lb_maildir.a
+MAILDIR_OBJS:=lb_maildir.lo
+MAILDIR_LIB:=libglite_lb_maildir.la
 
 THROBJS:=${OBJS:.o=.thr.o}
 THRLOBJS:=${OBJS:.o=.thr.lo}
@@ -137,8 +142,7 @@ ${TRIO_LIB}: ${TRIO_OBJS}
        ranlib $@
 
 ${MAILDIR_LIB}: ${MAILDIR_OBJS}
-       ar crv $@ ${MAILDIR_OBJS}
-       ranlib $@
+       ${LINK} ${version_info} -o $@ ${MAILDIR_OBJS}
 
 ${THRSTATICLIB}: ${THROBJS}
        ar crv $@ ${THROBJS}
@@ -155,7 +159,7 @@ ${THRLTLIB}: ${THROBJS}
        ${LINK} ${version_info} -o $@ ${THRLOBJS} \
                -lglite_security_gss_${thrflavour} \
                -lglite_wmsutils_cjobid \
-               ${EXT_LIBS} \
+               ${EXT_THRLIBS} \
                -lm
 
 stage: compile
@@ -200,12 +204,12 @@ distbin:
 install:
        mkdir -p ${PREFIX}/lib
        mkdir -p ${PREFIX}/share/doc/${package}-${version}
-       ${INSTALL} -m 644 ${LTLIB} ${THRLTLIB} ${PREFIX}/lib
+       ${INSTALL} -m 644 ${LTLIB} ${THRLTLIB} ${MAILDIR_LIB} ${PREFIX}/lib
        ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
        if [ x${DOSTAGE} = xyes ]; then \
                mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
                (cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix}) ; \
-               install -m 644 ${STATICLIB} ${THRSTATICLIB} ${TRIO_LIB} ${MAILDIR_LIB} ${PREFIX}/lib; \
+               install -m 644 ${STATICLIB} ${THRSTATICLIB} ${TRIO_LIB} ${PREFIX}/lib; \
        fi
 
 clean:
index 9d68ded..84cbedf 100644 (file)
@@ -16,6 +16,7 @@ typedef struct _edg_wll_SeqCode {
        unsigned int    c[EDG_WLL_SOURCE__LAST];
 } edg_wll_SeqCode;
 
+#define EDG_WLL_SEQ_NULL "UI=000000:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000"
 
 
 /* non-gsi one-element analogy of connPool for L&B Proxy server */
index 500a562..fd037c5 100644 (file)
@@ -1,2 +1,2 @@
-#Sat Oct 15 06:38:31 CEST 2005
-module.build=153
+#Wed Mar 15 04:43:32 CET 2006
+module.build=0233
index 8fa35c6..330119d 100644 (file)
@@ -1,4 +1,3 @@
 #Fri Sep 02 14:17:07 CEST 2005
-module.version=4.0.0
-module.build=2
-module.age=1
+module.version=3.0.5
+module.age=0
index 7978a9e..561e068 100644 (file)
 
 static void free_voms_groups(edg_wll_VomsGroups *);
 
+/* uncomment to get the trace
+#define CTXTRACE "/tmp/lb-context-trace"
+*/
+
 int edg_wll_InitContext(edg_wll_Context *ctx)
 {
        int i;
@@ -32,11 +36,23 @@ int edg_wll_InitContext(edg_wll_Context *ctx)
 
        out->connPool = (edg_wll_ConnPool *) calloc(out->poolSize, sizeof(edg_wll_ConnPool));
        out->connPoolNotif = (edg_wll_ConnPool *) calloc(1, sizeof(edg_wll_ConnPool));
-       out->connProxy = (edg_wll_ConnPool *) calloc(1, sizeof(edg_wll_ConnProxy));
+       out->connProxy = (edg_wll_ConnProxy *) calloc(1, sizeof(edg_wll_ConnProxy));
        out->connProxy->conn.sock = -1;
        out->connToUse = -1;
 
        *ctx = out;
+
+#ifdef CTXTRACE
+{
+       int     trc = open(CTXTRACE,O_WRONLY|O_CREAT,0644);
+       char    buf[200];
+       sprintf(buf,"%p init\n",out);
+       lseek(trc,0,SEEK_END);
+       write(trc,buf,strlen(buf));
+       close(trc);
+}
+#endif
+
        return 0;
 }
 
@@ -46,7 +62,16 @@ void edg_wll_FreeContext(edg_wll_Context ctx)
        OM_uint32 min_stat;
 
        if (!ctx) return;
-
+#ifdef CTXTRACE
+{
+       int     trc = open(CTXTRACE,O_WRONLY|O_CREAT,0644);
+       char    buf[200];
+       sprintf(buf,"%p free\n",ctx);
+       lseek(trc,0,SEEK_END);
+       write(trc,buf,strlen(buf));
+       close(trc);
+}
+#endif
        if (ctx->errDesc) free(ctx->errDesc);
        if (ctx->connPool) {
                int i;
@@ -103,7 +128,7 @@ static const char* const errTexts[] = {
        "DNS resolver error",
        "No JobId specified in context",
        "No indexed condition in query",
-       "Interlogger protocol error",
+       "Lbserver (proxy) store protocol error",
        "Interlogger internal error",
        "Interlogger has events pending",
        "Compared events differ",
index 10f7a82..4154ee9 100644 (file)
@@ -109,7 +109,7 @@ read_il_data(void *user_data,
             char **buffer, 
             int (*reader)(void *, char *, const int))
 {
-  char buf[17];
+       char buf[17], *p;
   int ret, len;
 
   /* read 17 byte header */
@@ -117,7 +117,23 @@ read_il_data(void *user_data,
   if(len < 0) {
     goto err;
   }
+
+  /* perform some sanity checks on the received header */
+  if(buf[16] != '\n') {
+         len = -1;
+         goto err;
+  }
   buf[16] = 0;
+  /* skip leading spaces */
+  for(p = buf; *p == ' '; p++);
+  /* skip digits */
+  for(; (*p >= '0') && (*p <= '9'); p++);
+  /* this must be the end of string */
+  if(*p != 0) {
+         len = -1;
+         goto err;
+  }
+
   if((len=atoi(buf)) <= 0) {
     len = -1;
     goto err;
index 92bbf2b..7915dfa 100644 (file)
@@ -2,6 +2,8 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <time.h>
+#include <signal.h>
+#include <assert.h>
 #include <stdlib.h>
 #include <sys/time.h>
 #include <sys/types.h>
@@ -173,7 +175,11 @@ int edg_wll_plain_write_full(
        int                             ct = -1;
        fd_set                  fds;
        struct timeval  timeout, before, after;
+       struct sigaction        sa,osa;
 
+       memset(&sa,0,sizeof(sa)); assert(sa.sa_handler == NULL);
+       sa.sa_handler = SIG_IGN;
+       sigaction(SIGPIPE,&sa,&osa);
 
        if ( to ) {
                memcpy(&timeout, to, sizeof(timeout));
@@ -204,5 +210,7 @@ end:
                if (to->tv_sec < 0) to->tv_sec = to->tv_usec = 0;
        }
 
+       sigaction(SIGPIPE,&osa,NULL);
+       if (errno == EPIPE) errno = ENOTCONN;
        return (errno)? -1: written;
 }
index befa8cd..595ed19 100644 (file)
@@ -1,3 +1,8 @@
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <pwd.h>
 #include <sys/un.h>
 #include <stdio.h>
 #include <math.h>
@@ -138,7 +143,7 @@ int edg_wll_log_event_write(
                        case EAGAIN:
                        case EACCES:
                        case EINTR:
-                               sleep(fcntl_timeout);
+                               if ((i+1) < fcntl_attempts) sleep(fcntl_timeout);
                                break;
                        default:
                                edg_wll_SetError(ctx, errno, "fcntl()");
@@ -146,6 +151,10 @@ int edg_wll_log_event_write(
                        }
                } else break;
        }
+       if (i == fcntl_attempts) {
+               edg_wll_SetError(ctx, ETIMEDOUT, "timed out trying to lock event file");
+               goto cleanup;
+       }
 
        if ( fseek(outfile, 0, SEEK_END) == -1 ) {      
                edg_wll_SetError(ctx, errno, "fseek()");
index 2525a3e..855c26b 100644 (file)
@@ -384,13 +384,14 @@ void edg_wll_ULMSplitDate( const char *s,
 int edg_wll_ULMTimevalToDate( long sec, long usec, char *dstr )
 {
   char *func = "edg_wll_ULMTimevalToDate";
+  struct tm tms;
   struct tm *tp;
   int        len;
 
   if ( sec < 0 || usec < 0 || usec > 999999 )
     return 1;
 
-  tp = gmtime( (const time_t *) &sec );
+  tp = gmtime_r( (const time_t *) &sec, &tms );
   if ( tp == NULL )
     return 1;
 
index ca5f569..c6a7d88 100644 (file)
@@ -1,2 +1,2 @@
-#Sat Oct 15 06:34:10 CEST 2005
-module.build=54
+#Wed Mar 15 04:55:06 CET 2006
+module.build=0134
index a15cf77..6ac91d4 100755 (executable)
@@ -1,6 +1,4 @@
 #Fri Sep 02 14:16:49 CEST 2005
-module.version=3.0.0
 # glite-lb-ws-interface_branch_3_0_0_RC15 tak is taken!
-
-module.build=2
-module.age=1
+module.version=2.1.1
+module.age=0