- trace context allocation/freeing (disabled at compile time by default) glite-lb-common_R_3_0_2
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 20 Jan 2006 14:25:30 +0000 (14:25 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 20 Jan 2006 14:25:30 +0000 (14:25 +0000)
- push version

org.glite.lb.common/project/version.properties
org.glite.lb.common/src/context.c

index 3cf83a2..df681cf 100644 (file)
@@ -1,4 +1,4 @@
 #Fri Sep 02 14:17:07 CEST 2005
-module.version=3.0.1
+module.version=3.0.2
 module.build=2
 module.age=1
index 7978a9e..c4a46d4 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;
@@ -37,6 +41,18 @@ int edg_wll_InitContext(edg_wll_Context *ctx)
        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;