Index: /trunk/FACT++/dim/README_v19.txt
===================================================================
--- /trunk/FACT++/dim/README_v19.txt	(revision 12584)
+++ /trunk/FACT++/dim/README_v19.txt	(revision 12585)
@@ -1,4 +1,4 @@
 
-                    DIM version 19.24 Release Notes
+                    DIM version 19.26 Release Notes
 
 Notes 1 and 2 for Unix Users only
@@ -17,5 +17,22 @@
 		Dns </dev/null >& dns.log &
 
-NOTE 3: The Version Number service provided by servers is now set to 1924.
+NOTE 3: The Version Number service provided by servers is now set to 1926.
+
+14/09/2011
+Changes for version 19.26:
+    - In the notes for version 19.08 there is the following:
+    	- Since version v18r4 where dim_wait() was modified, dim_wait could hang in windows if
+      	  the wake_up event was triggered before dim_wait was called. Could affect smi++. Fixed.
+    - Amasingly enough this seems also to be the case for Linux, dim_wait could hang until there
+      was some new DIM activity, normally some timer firing... Fixed.
+    - The Linux DID now accepts an extra parameter: -dns=<dns_node_name>
+
+01/09/2011
+Changes for version 19.25:
+    - When a Client was releasing a service "at the same time" as the server was deleting the service,
+      The Connection could be released by mistake - fixed.
+    - The SERVICE_LIST service could be updated with an empty string if there were two consecutive 
+      dis_start_serving() - fixed.
+
 
 08/08/2011
Index: /trunk/FACT++/dim/dim/dim.h
===================================================================
--- /trunk/FACT++/dim/dim/dim.h	(revision 12584)
+++ /trunk/FACT++/dim/dim/dim.h	(revision 12585)
@@ -14,5 +14,5 @@
 #include "dim_common.h"
 
-#define DIM_VERSION_NUMBER 1924
+#define DIM_VERSION_NUMBER 1926
 
 #define MY_LITTLE_ENDIAN	0x1
Index: /trunk/FACT++/dim/src/did/did.c
===================================================================
--- /trunk/FACT++/dim/src/did/did.c	(revision 12584)
+++ /trunk/FACT++/dim/src/did/did.c	(revision 12585)
@@ -813,4 +813,11 @@
 				(!strncmp(opt_str,"ALL",3)))
 				Curr_view_opt = 1;
+			else if((!strncmp(opt_str,"dns",3)) || 
+				(!strncmp(opt_str,"DNS",3))) {
+                                char text[132];
+			        sprintf(text,"DIM_DNS_NODE=%s",opt_str+4);
+   		  	        putenv(text);
+ 			        dim_set_dns_node(opt_str+4);
+			}
 			else if((!strncmp(opt_str,"service",7)) || 
 					(!strncmp(opt_str,"SERVICE",7)))
@@ -824,4 +831,5 @@
     printf("Did - DIM Information Display\n");
     printf("\t-all             Show ALL Servers\n");
+    printf("\t-dns=<str>       Show Servers with DIM_DNS_NODE provided by <str>\n");
     printf("\t-service=<str>   Show Servers providing Service <str>\n");
     printf("\t-node=<nodename> Show Servers on Node <nodename>\n");
Index: /trunk/FACT++/dim/src/dim_thr.c
===================================================================
--- /trunk/FACT++/dim/src/dim_thr.c	(revision 12584)
+++ /trunk/FACT++/dim/src/dim_thr.c	(revision 12585)
@@ -444,4 +444,6 @@
 pthread_cond_t Global_cond = PTHREAD_COND_INITIALIZER;
 #endif
+int Global_cond_counter = 0;
+int Global_cond_waiters = 0;
 
 void dim_lock()
@@ -479,5 +481,12 @@
 {
   pthread_mutex_lock(&Global_cond_mutex);
-  pthread_cond_wait(&Global_cond, &Global_cond_mutex);
+  Global_cond_waiters++;
+  if(!Global_cond_counter)
+  {
+	pthread_cond_wait(&Global_cond, &Global_cond_mutex);
+  }
+  Global_cond_waiters--;
+  if(!Global_cond_waiters)
+	  Global_cond_counter--;
   pthread_mutex_unlock(&Global_cond_mutex);
 }
@@ -486,5 +495,13 @@
 {
   pthread_mutex_lock(&Global_cond_mutex);
-  pthread_cond_broadcast(&Global_cond);
+  if(!Global_cond_waiters)
+  {
+	Global_cond_counter = 1;
+  }
+  else
+  {
+	Global_cond_counter++;
+	pthread_cond_broadcast(&Global_cond);
+  }
   pthread_mutex_unlock(&Global_cond_mutex);
 }
Index: /trunk/FACT++/dim/src/dis.c
===================================================================
--- /trunk/FACT++/dim/src/dis.c	(revision 12584)
+++ /trunk/FACT++/dim/src/dis.c	(revision 12585)
@@ -1284,9 +1284,4 @@
 	   Net_conns[conn_id].task, Net_conns[conn_id].node);
 }
-		if(!(servp = find_service(dic_packet->service_name)))
-		{
-			release_conn(conn_id, 0, 0);
-			return;
-		}
 		dic_packet->type = vtohl(dic_packet->type);
 		type = dic_packet->type & 0xFFF;
@@ -1303,4 +1298,9 @@
 		{
 			find_release_request(conn_id, vtohl(dic_packet->service_id));
+			return;
+		}
+		if(!(servp = find_service(dic_packet->service_name)))
+		{
+			release_conn(conn_id, 0, 0);
 			return;
 		}
@@ -2937,4 +2937,6 @@
 	*bufp = (int *)service_info_buffer;
 	*size = buff_ptr - service_info_buffer+1;
+	if(*size == 1)
+		*size = -1;
 	ENABLE_AST
 }
Index: /trunk/FACT++/dim/src/examples/test_client.c
===================================================================
--- /trunk/FACT++/dim/src/examples/test_client.c	(revision 12584)
+++ /trunk/FACT++/dim/src/examples/test_client.c	(revision 12585)
@@ -65,7 +65,8 @@
 {
 	char *format;
-
+/*
 	format = dic_get_format(0);
 	printf("Received format = %s %08x, %d\n",format, format, *size);
+*/
 	if(*tag == 1100)
 	{
@@ -94,5 +95,5 @@
 	}
 	else
-		printf("%s Received %s %08X for Service%03d\n",client_str,buf, buf,*tag);
+		printf("%s Received %s for Service%03d\n",client_str,buf,*tag);
 
 /*
@@ -124,8 +125,6 @@
 	{
 		sprintf(str,"%s/Service_%03d",argv[2],i);
-//		dic_info_service( str, TIMED, 10, 0, 0, rout, i,
-//			  "No Link", 8 );
 		dic_info_service( str, TIMED, 10, 0, 0, rout, i,
-			  NULL, 0 );
+			  "No Link", 8 );
 	}
 	
Index: /trunk/FACT++/dim/src/examples/test_server.c
===================================================================
--- /trunk/FACT++/dim/src/examples/test_server.c	(revision 12584)
+++ /trunk/FACT++/dim/src/examples/test_server.c	(revision 12585)
@@ -28,4 +28,5 @@
 
 	if(tag){}
+	dim_print_date_time();
 	printf("Command received, size = %d, TT size = %d:\n", *size,
 	       (int)sizeof(TT));
@@ -70,4 +71,5 @@
 	char extra_dns[128];
 	int new_dns = 0;
+	int index = 0;
 /*
 	int buf_sz, buf_sz1;
@@ -156,4 +158,5 @@
 	while(1)
 	{
+		index++;
 /*
 		for(i = 0; i < 20; i++)
Index: /trunk/FACT++/dim/src/examples/test_server.cxx
===================================================================
--- /trunk/FACT++/dim/src/examples/test_server.cxx	(revision 12584)
+++ /trunk/FACT++/dim/src/examples/test_server.cxx	(revision 12585)
@@ -1,62 +1,2 @@
-//============================================================================
-// Name        : emptyDimFormat.cpp
-// Author      : Etienne Lyard etienne.lyard@unige.ch
-// Version     : 00
-// Copyright   :
-// Description : Demonstrates the occurence of an empty Dim format from the client's perspective
-//============================================================================
-/*
-#include <dic.hxx>
-#include <dis.hxx>
-#include <iostream>
-using namespace std;
-
-class EmptyServiceSubscriber : public DimInfo
-{
-    DimStampedInfo* info;
-	int noLink;
-public:
-    EmptyServiceSubscriber()
-    {
-//        info = new DimStampedInfo("TIME/EMPTY", const_cast<char*>(""), this);
-		noLink = -1;
-        info = new DimStampedInfo("TIME/EMPTY", noLink, this);
-    }
-    void infoHandler()
-    {
-        DimInfo* I = getInfo();
-		int data;
-        if (I == info)
-		{
-			data = I->getInt();
-//		cout << "EMPTY SERVICE UPDATED. " << "Format: " << I->getFormat() << endl;
-			cout << "EMPTY SERVICE UPDATED. " << data << " Format: " << I->getFormat() << endl;
-		}
-    }
-};
-
-int main(int, const char**)
-{
-    DimServer::start("TIME");
-
-    int emptyFormatVariable = 0;
-    DimService* emptyFormatService = new DimService("TIME/EMPTY", "I:1", &emptyFormatVariable, sizeof(long));
-    EmptyServiceSubscriber mySubscriber;
-    //The three lines below create (most of the time) an empty format on the client side.
-    //We must be able to deal with such cases in our framework because services can be stopped and re-spawned at any time
-    delete emptyFormatService;
-    usleep(1000000);
-    emptyFormatService = new DimService("TIME/EMPTY", "I:1", &emptyFormatVariable, sizeof(long));
-
-    while (1)
-    {
-        emptyFormatService->updateService();
-        usleep(1000000);
-    }
-
-	return 0;
-}
-*/
-
 #include <iostream>
 #include <dis.hxx>
