[My apologies if anybody gets a duplicate copy of this.  My original
 message was too long, has been "pending moderator approval" since
 Sunday.  I've tried to follow the link to cancel it, but
 monkeymail.org doesn't seem to be answering HTTP requests.  So, I'm
 sending the original email _sans_ attachments, and putting the actual
 patches up on the web for download.]

Hi, Niels!  This is a reformatted, corrected, updated, and expanded
version of my patch from December 15 to add server and IPv6 support to
evdns.  This time I've broken it down into multiple parts; this may
help some.  Alas, the passage of time has added more code: hopefully
this time it will be easier to follow. :)

These patches need to be applied in order; they have dependencies.

01_ipv6.diff
   Adds support for forward and reverse IPv6 queries with two new
   functions: evdns_resolve_ipv6() and evdns_resolve_reverse_ipv6()

02_misc.diff
   Fixes numerous small issues:
    - Fixes spelling: choaked -> choked
    - Make error strings static
    - The MS_WINDOWS macro is a Tor-ism; use WIN32 consistently.
    - Have the GET32/16/8 macros "goto err" instead of "return -1";
      this gets used in patch 05 below.
    - Detect misaligned A and AAAA replies.
    - Avoid compiler warnings about unused variables.
    - Always use snprintf instead of sprintf: this keeps the OpenBSD
      linker from complaining.
    - Fix compiler warning about running off the end of a non-void
      function.
    - Fix compiler warning about mismatch between the type of st_size
      and size_t.
    - Add missing argument list to evdns_init().
    - Add missing argument to logfn.

03_name_compression.diff
   This patch adds code to implement name compression via a
   table-based lookup system.  The implementation isn't so efficient,
   but it can be replaced easily if it turns out not to be critical
   path.  This code is used in patch 05 below; it isn't activated for
   sending requests, since we never send more than one name per
   request.

04_options.diff
04b_options_oops.diff
   (I messed up the original version of this patch; apply both 04 and
   04b in succession in order to get the right code.)

   This patch adds a function to set some options (timeout, attempts)
   via the API and override the settings in the resolv.conf file.  It
   also provides a way to set some other global configuration values
   (max-timeouts, max-inflight).  It keeps the nameservers from being
   modified when DNS_OPTION_NAMESERVER isn't set.   Finally, it makes
   resolv_conf_parse() give an error code if we're parsing nameservers
   and we don't find any.

05_server.diff

   This patch adds DNS server support to evdns.c.  It provides an
   external API for clients to register a dns server socket, and a
   callback that will learn about DNS requests.  After examining the
   request, the caller should eventually drop it by calling
   evdns_server_request_drop() or add answers with
   evdns_Server_request_add_*_reply() and send the final result with
   evdns_server_request_respond().

To avoid limits on attachment sizes, I'm putting these patches on the
web at:
  http://freehaven.net/~nickm/libevent_server_patch/

If you've got a chance to check them out, please let me know what you
think.

many thanks,
-- 
Nick Mathewson

Attachment: pgp9yDm7Ywi8z.pgp
Description: PGP signature

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to