Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_con


Modified Files:
        ecore_con_dns.c 


Log Message:
Don't need searchname and hostname stored.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con_dns.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ecore_con_dns.c     25 Aug 2005 08:16:01 -0000      1.12
+++ ecore_con_dns.c     25 Aug 2005 15:12:57 -0000      1.13
@@ -57,8 +57,6 @@
 
      /* The name the user searches for */
      char *searchname;
-     /* The name vi send to dns and return to the user */
-     char *hostname;
 
      struct {
          void (*cb)(struct hostent *hostent, void *data);
@@ -67,7 +65,7 @@
 
 };
 
-static void _ecore_con_dns_ghbn(Ecore_Con_Dns_Query *query);
+static void _ecore_con_dns_ghbn(Ecore_Con_Dns_Query *query, const char 
*hostname);
 static int  _ecore_con_dns_timeout(void *data);
 static int  _ecore_con_cb_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
 static void _ecore_con_dns_query_free(Ecore_Con_Dns_Query *query);
@@ -246,19 +244,19 @@
    query->done.cb = done_cb;
    query->done.data = data;
    query->timeout = ecore_timer_add(20.0, _ecore_con_dns_timeout, query);
-   query->hostname = strdup(name);
    query->searchname = strdup(name);
    query->search = -1;
 
-   _ecore_con_dns_ghbn(query);
+   _ecore_con_dns_ghbn(query, name);
    return 1;
 }
 
 static void
-_ecore_con_dns_ghbn(Ecore_Con_Dns_Query *query)
+_ecore_con_dns_ghbn(Ecore_Con_Dns_Query *query, const char *hostname)
 {
    char buf[256];
-   char *p, *q, *pl;
+   char *p, *pl;
+   const char *q;
    int i, len, total_len;
 
    /* Create buf */
@@ -283,7 +281,7 @@
    p++;
    total_len++;
    /* name */
-   q = query->hostname;
+   q = hostname;
    len = 0;
    while ((*q) && (total_len < 1024))
      {
@@ -446,8 +444,6 @@
 
    /* Skip the hostname */
    if ((len = _ecore_con_hostname_get(buf, hostname, p - buf, n)) == -1) goto 
error;
-   if (strcmp(hostname, query->hostname))
-     printf("WARNING: Not the same hostname: %s %s?\n", hostname, 
query->hostname);
    p += len;
    /* Skip the question */
    if (((p + QFIXEDSZ) - buf) >= n) goto error;
@@ -562,9 +558,7 @@
          {
             if (snprintf(buf, sizeof(buf), "%s.%s", query->searchname, 
_domain) < sizeof(buf))
               {
-                 free(query->hostname);
-                 query->hostname = strdup(buf);
-                 _ecore_con_dns_ghbn(query);
+                 _ecore_con_dns_ghbn(query, buf);
               }
             else
               {
@@ -577,9 +571,7 @@
          {
             if (snprintf(buf, sizeof(buf), "%s.%s", query->searchname, 
_search[query->search]) < sizeof(buf))
               {
-                 free(query->hostname);
-                 query->hostname = strdup(buf);
-                 _ecore_con_dns_ghbn(query);
+                 _ecore_con_dns_ghbn(query, buf);
               }
             else
               {
@@ -613,7 +605,6 @@
      }
    if (query->timeout) ecore_timer_del(query->timeout);
    query->timeout = NULL;
-   free(query->hostname);
    free(query->searchname);
    free(query);
 }




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to