[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10785: Man. I thought I removed that code. (in tor/trunk: . src/or)



Author: nickm
Date: 2007-07-10 13:41:26 -0400 (Tue, 10 Jul 2007)
New Revision: 10785

Modified:
   tor/trunk/
   tor/trunk/src/or/control.c
   tor/trunk/src/or/dnsserv.c
Log:
 r13676@catbus:  nickm | 2007-07-10 13:41:24 -0400
 Man. I thought I removed that code.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13676] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2007-07-10 17:27:33 UTC (rev 10784)
+++ tor/trunk/src/or/control.c	2007-07-10 17:41:26 UTC (rev 10785)
@@ -896,8 +896,6 @@
         event_code = EVENT_GUARD;
       } else if (!strcasecmp(ev, "STREAM_BW"))
         event_code = EVENT_STREAM_BANDWIDTH_USED;
-      else if (!strcasecmp(ev, "RESOLVED"))
-        event_code = EVENT_RESOLVED;
       else {
         connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n",
                                  ev);

Modified: tor/trunk/src/or/dnsserv.c
===================================================================
--- tor/trunk/src/or/dnsserv.c	2007-07-10 17:27:33 UTC (rev 10784)
+++ tor/trunk/src/or/dnsserv.c	2007-07-10 17:41:26 UTC (rev 10785)
@@ -221,50 +221,28 @@
    * or more of the questions in the request); then, call
    * evdns_server_request_respond. */
   if (answer_type == RESOLVED_TYPE_IPV6) {
-    if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command))
-      handle_control_resolve_response(req->questions[0]->name,
-                                      "IPv6 not implemented");
-    else {
-      log_info(LD_APP, "Got an IPv6 answer; that's not implemented.");
-      err = DNS_ERR_NOTIMPL;
-    }
+    log_info(LD_APP, "Got an IPv6 answer; that's not implemented.");
+    err = DNS_ERR_NOTIMPL;
   } else if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4 &&
              conn->socks_request->command == SOCKS_COMMAND_RESOLVE) {
-    if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command))
-      handle_control_resolve_response(req->questions[0]->name,
-                                      tor_dup_addr(ntohl(get_uint32(answer))));
-    else
-      evdns_server_request_add_a_reply(req,
-                                       conn->socks_request->address,
-                                       1, (char*)answer, ttl);
+    evdns_server_request_add_a_reply(req,
+                                     conn->socks_request->address,
+                                     1, (char*)answer, ttl);
   } else if (answer_type == RESOLVED_TYPE_HOSTNAME &&
              conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) {
-    if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command))
-      handle_control_resolve_response(req->questions[0]->name, answer);
-    else {
-      char *ans = tor_strndup(answer, answer_len);
-      evdns_server_request_add_ptr_reply(req, NULL,
+    char *ans = tor_strndup(answer, answer_len);
+    evdns_server_request_add_ptr_reply(req, NULL,
                                        conn->socks_request->address,
                                        (char*)answer, ttl);
-      tor_free(ans);
-    }
+    tor_free(ans);
   } else if (answer_type == RESOLVED_TYPE_ERROR) {
-    if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command))
-      handle_control_resolve_response(req->questions[0]->name, "Unknown Host");
-    else
-      err = DNS_ERR_NOTEXIST;
+    err = DNS_ERR_NOTEXIST;
   } else { /* answer_type == RESOLVED_TYPE_ERROR_TRANSIENT */
-    if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command))
-      handle_control_resolve_response(req->questions[0]->name,
-                                      "Temporary Error");
-    else
-      err = DNS_ERR_SERVERFAILED;
+    err = DNS_ERR_SERVERFAILED;
   }
 
-  if (!SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command))
-    evdns_server_request_respond(req, err);
+  evdns_server_request_respond(req, err);
 
-
   conn->dns_server_request = NULL;
 }