-remove debug message
[oweals/gnunet.git] / src / gns / gnunet-gns-proxy.c
index 2a39efef285615e6a17e8d16c76f1936e2b01adc..eb6c6852ecaaa4cea1526c505f040a60f867d7aa 100644 (file)
@@ -43,8 +43,7 @@
 #include "gnunet_gns_service.h"
 #include "gnunet_identity_service.h"
 #include "gns.h"
-
-
+#include "gnunet_mhd_compat.h"
 
 /**
  * Default Socks5 listen port.
@@ -298,7 +297,6 @@ struct Socks5ServerResponseMessage
 };
 
 
-
 /* *********************** Datastructures for HTTP handling ****************** */
 
 /**
@@ -335,7 +333,6 @@ struct ProxyGNSCertificate
 };
 
 
-
 /**
  * A structure for all running Httpds
  */
@@ -652,7 +649,6 @@ struct Socks5Request
 };
 
 
-
 /* *********************** Globals **************************** */
 
 /**
@@ -1831,7 +1827,7 @@ con_val_iter (void *cls,
  *         #MHD_NO if the socket must be closed due to a serious
  *         error while handling the request
  */
-static int
+static MHD_RESULT
 create_response (void *cls,
                  struct MHD_Connection *con,
                  const char *url,
@@ -1953,8 +1949,7 @@ create_response (void *cls,
      * Pre-populate cache to resolve Hostname.
      * This is necessary as the DNS name in the CURLOPT_URL is used
      * for SNI http://de.wikipedia.org/wiki/Server_Name_Indication
-     */
-    if (NULL != s5r->leho)
+     */if (NULL != s5r->leho)
     {
       char *curl_hosts;
 
@@ -2393,6 +2388,7 @@ mhd_connection_cb (void *cls,
   }
 }
 
+
 /**
  * Function called when MHD first processes an incoming connection.
  * Gives us the respective URI information.
@@ -3016,6 +3012,9 @@ signal_socks_failure (struct Socks5Request *s5r,
 {
   struct Socks5ServerResponseMessage *s_resp;
 
+  GNUNET_break (0 == s5r->wbuf_len); /* Should happen first in any transmission, right? */
+  GNUNET_assert (SOCKS_BUFFERSIZE - s5r->wbuf_len >=
+                 sizeof(struct Socks5ServerResponseMessage));
   s_resp = (struct Socks5ServerResponseMessage *) &s5r->wbuf[s5r->wbuf_len];
   memset (s_resp, 0, sizeof(struct Socks5ServerResponseMessage));
   s_resp->version = SOCKS_VERSION_5;
@@ -3365,7 +3364,7 @@ do_s5r_read (void *cls)
             + alen + sizeof(uint16_t))
           return;     /* need more data */
         dom_name = (const char *) &dom_len[1];
-        port = (const uint16_t*) &dom_name[*dom_len];
+        port = (const uint16_t *) &dom_name[*dom_len];
         s5r->domain = GNUNET_strndup (dom_name,
                                       *dom_len);
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -3379,7 +3378,7 @@ do_s5r_read (void *cls)
         s5r->gns_lookup = GNUNET_GNS_lookup_with_tld (gns_handle,
                                                       s5r->domain,
                                                       GNUNET_DNSPARSER_TYPE_A,
-                                                      GNUNET_NO /* only cached */,
+                                                      GNUNET_GNS_LO_LOCAL_MASTER /* only cached */,
                                                       &handle_gns_result,
                                                       s5r);
         break;
@@ -3905,4 +3904,5 @@ main (int argc,
   return ret;
 }
 
+
 /* end of gnunet-gns-proxy.c */