Index: src/core/ctrl/tsp_stream_sender.c
===================================================================
RCS file: /sources/tsp/tsp/src/core/ctrl/tsp_stream_sender.c,v
retrieving revision 1.23
diff -u -r1.23 tsp_stream_sender.c
--- src/core/ctrl/tsp_stream_sender.c	21 Oct 2006 08:48:00 -0000	1.23
+++ src/core/ctrl/tsp_stream_sender.c	31 Mar 2007 14:27:44 -0000
@@ -231,13 +231,11 @@
   
 }
 
-static void TSP_stream_sender_save_address_string(TSP_socket_t* sock, 
-					     char* host, unsigned short port)
+static void TSP_stream_sender_save_address_string(TSP_socket_t* sock, unsigned short port)
 {   
   char strPort[10];
     
   sprintf(strPort,"%u",(int)port);
-  strcpy(sock->data_address, host);
   strcat(sock->data_address, ":");    
   strcat(sock->data_address, strPort);
     
@@ -293,14 +291,8 @@
 
   int status = 0;
   int OptInt = 0;
-  char host[TSP_MAXHOSTNAMELEN+1];
   TSP_socket_t* sock;
   pthread_t thread_connect_id;
-  struct hostent*  myhost;
-  union {
-    uint32_t    addr;
-    uint8_t     parts[4];
-  } myu;
 
 #if defined (WIN32)
   /* no SIGPIPE signal under Windows (waitforsingleobject insteed) */
@@ -311,26 +303,6 @@
     return 0;
   }
 #endif
-  if( -1 == gethostname(host, TSP_MAXHOSTNAMELEN))
-    {
-      STRACE_ERROR(("gethostname error"));
-
-      return 0;
-    }
-  myhost = gethostbyname(host);
-  if (myhost == NULL) {
-    STRACE_ERROR(("Cannot gethostbyname '(hostname --> @IP)' for host <%s> check your /etc/hosts file.\n",host));
-    /* be tolerant we keep going with hostname but... consumer may not handle this properly */    
-  } else {
-     /* 
-      * Now translate hostname to @IP in order
-      * to avoid name -> IP resolution on consumer side 
-      */
-    memset(host,0,sizeof(host));
-    myu.addr = (uint32_t)ntohl(*((uint32_t*)myhost->h_addr_list[0]));
-    sprintf(host,"%d.%d.%d.%d",myu.parts[3], myu.parts[2], myu.parts[1], myu.parts[0]);
-  }
-     
   sock = (TSP_socket_t*)calloc(1, sizeof(TSP_socket_t));
   TSP_CHECK_ALLOC(sock, 0);
 
@@ -419,7 +391,7 @@
 	      {
 		/* Save the address in the tsp_socket struct */
 		unsigned short port =  ntohs(buf_addr.sin_port);
-		TSP_stream_sender_save_address_string(sock, host, port);
+		TSP_stream_sender_save_address_string(sock, port);
 	      }
 	    else
 	      {
Index: src/core/driver/tsp_consumer.c
===================================================================
RCS file: /sources/tsp/tsp/src/core/driver/tsp_consumer.c,v
retrieving revision 1.59
diff -u -r1.59 tsp_consumer.c
--- src/core/driver/tsp_consumer.c	10 Feb 2007 18:49:37 -0000	1.59
+++ src/core/driver/tsp_consumer.c	31 Mar 2007 14:27:58 -0000
@@ -252,6 +252,7 @@
  */ 
 static TSP_otsp_t* 
 TSP_new_object_tsp(TSP_server_t server,
+		   const char *hostname,
 		   TSP_server_info_string_t server_info) {
   TSP_otsp_t* obj;
 	
@@ -264,6 +265,7 @@
 	
   obj->server = server;
   strncpy(obj->server_info.info, server_info, STRING_SIZE_SERVER_INFO);
+  strncpy(obj->server_info.hostname, hostname, MAXHOSTNAMELEN - 1);
 	
   /* Init */
   obj->channel_id                                            = TSP_UNDEFINED_CHANNEL_ID;	
@@ -520,7 +522,7 @@
 	{
 	  /* yes, got it !!! */
 	  sprintf(url_lkup, TSP_URL_FORMAT, protocol, hostname, server_info, servernumber);
-	  return (TSP_provider_t*)TSP_new_object_tsp(server, url_lkup);
+	  return (TSP_provider_t*)TSP_new_object_tsp(server, hostname, url_lkup);
 	}
       
       STRACE_INFO(("No TSP provider on URL <%s>", url_lkup));
@@ -590,7 +592,7 @@
 				      server_info))
 	    {
 			  
-	      (*providers)[*nb_providers] = TSP_new_object_tsp(server, server_info);
+		(*providers)[*nb_providers] = TSP_new_object_tsp(server, host_name, server_info);
 	      if( 0 == (*providers)[*nb_providers])
 		{
 		  STRACE_ERROR(("TSP_new_object_tsp failed for No=%d", i));
@@ -1120,7 +1122,7 @@
     STRACE_DEBUG(("data_address = '%s'", ans_sample->data_address));
       
     /* Create the data receiver */
-    otsp->receiver = TSP_data_receiver_create(ans_sample->data_address, callback, user_data);
+    otsp->receiver = TSP_data_receiver_create(otsp->server_info.hostname, ans_sample->data_address, callback, user_data);
       
       if(otsp->receiver)
 	{
Index: src/core/driver/tsp_data_receiver.c
===================================================================
RCS file: /sources/tsp/tsp/src/core/driver/tsp_data_receiver.c,v
retrieving revision 1.28
diff -u -r1.28 tsp_data_receiver.c
--- src/core/driver/tsp_data_receiver.c	10 Feb 2007 18:49:37 -0000	1.28
+++ src/core/driver/tsp_data_receiver.c	31 Mar 2007 14:27:58 -0000
@@ -119,7 +119,7 @@
   return ret;
 }
 
-TSP_data_receiver_t TSP_data_receiver_create(const char* data_address, TSP_sample_callback_t callback, void* user_data)
+TSP_data_receiver_t TSP_data_receiver_create(const char *host, const char* data_address, TSP_sample_callback_t callback, void* user_data)
 {
     
   TSP_struct_data_receiver_t* receiver;
@@ -133,7 +133,7 @@
     
   receiver->read_callback = callback;
   receiver->user_data = user_data; 
-  receiver->stream_receiver = TSP_stream_receiver_create(data_address);
+  receiver->stream_receiver = TSP_stream_receiver_create(host, data_address);
   if( 0 == receiver->stream_receiver)
     {
       /* FIXME : bof...*/
Index: src/core/driver/tsp_data_receiver.h
===================================================================
RCS file: /sources/tsp/tsp/src/core/driver/tsp_data_receiver.h,v
retrieving revision 1.10
diff -u -r1.10 tsp_data_receiver.h
--- src/core/driver/tsp_data_receiver.h	31 Mar 2006 12:55:19 -0000	1.10
+++ src/core/driver/tsp_data_receiver.h	31 Mar 2007 14:27:58 -0000
@@ -65,7 +65,7 @@
  * @param callback The callback function that must be called with the incoming data (set to 0 if not used)
  * @param user_data pointer on any custom user data ( set to 0 if not used)
  */
-TSP_data_receiver_t TSP_data_receiver_create(const char* data_address, TSP_sample_callback_t callback, void* user_data);
+TSP_data_receiver_t TSP_data_receiver_create(const char *host, const char* data_address, TSP_sample_callback_t callback, void* user_data);
 
 /**
  * Prepare the receiver to stop.
Index: src/core/driver/tsp_stream_receiver.c
===================================================================
RCS file: /sources/tsp/tsp/src/core/driver/tsp_stream_receiver.c,v
retrieving revision 1.13
diff -u -r1.13 tsp_stream_receiver.c
--- src/core/driver/tsp_stream_receiver.c	21 Oct 2006 08:48:00 -0000	1.13
+++ src/core/driver/tsp_stream_receiver.c	31 Mar 2007 14:27:58 -0000
@@ -63,7 +63,7 @@
 
 typedef struct TSP_socket_t TSP_socket_t;
 
-TSP_stream_receiver_t TSP_stream_receiver_create(const  char* data_address)
+TSP_stream_receiver_t TSP_stream_receiver_create(const char *host, const char* data_address)
 {
 
   int status = 0;
@@ -71,19 +71,16 @@
   int OptInt = 0;
 /*   int ret = TRUE; */
 /*   int Len = 0; */
-  char* host;
-  char* str_port;
+  const char* str_port;
   unsigned short port;
-  char* last; /**<For strtok_r*/
   
   TSP_socket_t* sock = (TSP_socket_t*)calloc(1, sizeof(TSP_socket_t));
   sock->is_stopped = FALSE;
   TSP_CHECK_ALLOC(sock, 0);
 
   
-  /* Decode the data adresse (get the host name and the port) */
-  host = strtok_r((char* )data_address, ":", &last);
-  str_port = strtok_r(NULL, ":", &last);
+  /* Decode the data address (get the port) format is :<number> */
+  str_port = data_address + 1;
   port = (unsigned short)atoi(str_port);
   
   STRACE_DEBUG(("Connection Data : Host='%s' port=%u", host, (unsigned int)port));
Index: src/core/driver/tsp_stream_receiver.h
===================================================================
RCS file: /sources/tsp/tsp/src/core/driver/tsp_stream_receiver.h,v
retrieving revision 1.5
diff -u -r1.5 tsp_stream_receiver.h
--- src/core/driver/tsp_stream_receiver.h	26 Feb 2006 13:36:05 -0000	1.5
+++ src/core/driver/tsp_stream_receiver.h	31 Mar 2007 14:27:58 -0000
@@ -50,7 +50,7 @@
  * else whith an other protocol)
  * @return The receiver handle. O when an error occured.
  */
-TSP_stream_receiver_t TSP_stream_receiver_create(const char* data_address);
+TSP_stream_receiver_t TSP_stream_receiver_create(const char *host, const char* data_address);
 
 /**
  * Destroy a stream receiver object.
Index: src/core/include/tsp_const_def.h
===================================================================
RCS file: /sources/tsp/tsp/src/core/include/tsp_const_def.h,v
retrieving revision 1.44
diff -u -r1.44 tsp_const_def.h
--- src/core/include/tsp_const_def.h	26 Feb 2007 19:30:11 -0000	1.44
+++ src/core/include/tsp_const_def.h	31 Mar 2007 14:28:14 -0000
@@ -37,6 +37,8 @@
 #ifndef _TSP_CONST_DEF_H
 #define _TSP_CONST_DEF_H
 
+#include <sys/param.h>
+
 
 #define TSP_PROJECT_URL "https://savannah.nongnu.org/projects/tsp"
 
@@ -225,7 +227,9 @@
  */
 struct TSP_otsp_server_info_t
 {
-  TSP_server_info_string_t info; 
+    char hostname[MAXHOSTNAMELEN];
+
+    TSP_server_info_string_t info; 
 };
 
 typedef struct  TSP_otsp_server_info_t TSP_otsp_server_info_t;
