<URL: http://bugs.freeciv.org/Ticket/Display.html?id=21635 >

Holy crap.

The "Beerware" DNS code seems to be really special cased.
Goes to the point of reading "/etc/resolv.conf" in UNIX and doing some
registry funkyness in Windows.

I suspect there is an easier and more portable way of doing this.
I wonder if the Mozilla or Apache people haven't already solved this
problem.

Anyway, I can accept that evilness in the DNS IP checking code if you
provide some option for the user to override the DNS IP check (e.g. via an
environment variable).

On 10/5/06, book <[EMAIL PROTECTED]> wrote:
>
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=21635 >
>
> This patch requires my improved hash tables (21625).
>
> freeciv_S2_1_r12321-004-shared_improvements.diff:
> - get_file_size (for future use).
> - strchrcount (convenience).
> - data_free_func_t needed by async functions.
>
> freeciv_S2_1_r12321-005-support_improvements.diff:
> - Portable version of tmpfile: my_tmpfile. Also removes duplicate
>   code from net_lookup_service functions.
>
> freeciv_S2_1_r12321-006-adns_core_and_netintf_improvements.diff:
> - Adds data_free_func_t typedef to utility/shared.h (this is required
>   for most functions that take a callback data parameter).
> - Adds files in utility tadns.[ch], low level dns network functions
>   (tested and known to work on win32 and linux). Based on Sergey
>   Lyubka's TADNS mini-library, though now heavily modified (to support
>   reverse name lookups, among other things). utility/Makefile.am
>   modified appropriately.
> - higher level adns API added to utility/netintf.[ch]:
>   + adns_get_socket_fd - returns the UDP socket fd used for dns queries.
>   + adns_free - shutdown the adns subsystem.
>   + adns_is_available - returns TRUE if the adns subsystem was
>     successfully initialized and is usable.
>   + adns_check_expired - checks the dns cache for stale entries and
>     removes them.
>   + adns_init - initializes the adns subsystem.
>   + adns_poll - checks for responses on the dns UDP socket.
>   + adns_lookup/adns_lookup_full/adns_reverse_lookup - asynchronous
>     functions (i.e. they call a callback when they obtain their
>     results) for dns operations.
>   + adns_cancel - cancels an asynchronous DNS request in progress.
> - other functions added to utility/netintf.c:
>   + net_lookup_service_async - asynchornous equivalent to
>     net_lookup_service.
>   + cancel_net_lookup_service - cancel a request made with the previous
>     function.
>   + is_net_service_resolved - common code to net_lookup_service and
>     net_lookup_service_async.
>   + my_socket_would_block - portable (at least win32 and linux) check
>     whether the previous socket operation would block.
>   + my_socket_operation_in_progess - idem for EINPROGRESS.
> - my_nonblock made to work on win32 (by using ioctlsocket if
>   HAVE_WINSOCK is defined).
>
> Sorry if these patches mix too many new things into only a few patch
> files. If this is inconvenient I'll chop then up even more in the
> future.
>
>
> _______________________________________________
> Freeciv-dev mailing list
> Freeciv-dev@gna.org
> https://mail.gna.org/listinfo/freeciv-dev
>
>
>
>


-- 
Vasco Alexandre da Silva Costa

Holy crap.

The "Beerware" DNS code seems to be really special cased.
Goes to the point of reading "/etc/resolv.conf" in UNIX and doing some registry funkyness in Windows.

I suspect there is an easier and more portable way of doing this.
I wonder if the Mozilla or Apache people haven't already solved this problem.

Anyway, I can accept that evilness in the DNS IP checking code if you
provide some option for the user to override the DNS IP check ( e.g. via an environment variable).

On 10/5/06, book <[EMAIL PROTECTED]> wrote:

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=21635 >

This patch requires my improved hash tables (21625).

freeciv_S2_1_r12321-004-shared_improvements.diff:
- get_file_size (for future use).
- strchrcount (convenience).
- data_free_func_t needed by async functions.

freeciv_S2_1_r12321-005-support_improvements.diff:
- Portable version of tmpfile: my_tmpfile. Also removes duplicate
  code from net_lookup_service functions.

freeciv_S2_1_r12321-006-adns_core_and_netintf_improvements.diff:
- Adds data_free_func_t typedef to utility/shared.h (this is required
  for most functions that take a callback data parameter).
- Adds files in utility tadns.[ch], low level dns network functions
  (tested and known to work on win32 and linux). Based on Sergey
  Lyubka's TADNS mini-library, though now heavily modified (to support
  reverse name lookups, among other things). utility/Makefile.am
  modified appropriately.
- higher level adns API added to utility/netintf.[ch]:
  + adns_get_socket_fd - returns the UDP socket fd used for dns queries.
  + adns_free - shutdown the adns subsystem.
  + adns_is_available - returns TRUE if the adns subsystem was
    successfully initialized and is usable.
  + adns_check_expired - checks the dns cache for stale entries and
    removes them.
  + adns_init - initializes the adns subsystem.
  + adns_poll - checks for responses on the dns UDP socket.
  + adns_lookup/adns_lookup_full/adns_reverse_lookup - asynchronous
    functions (i.e. they call a callback when they obtain their
    results) for dns operations.
  + adns_cancel - cancels an asynchronous DNS request in progress.
- other functions added to utility/netintf.c:
  + net_lookup_service_async - asynchornous equivalent to
    net_lookup_service.
  + cancel_net_lookup_service - cancel a request made with the previous
    function.
  + is_net_service_resolved - common code to net_lookup_service and
    net_lookup_service_async.
  + my_socket_would_block - portable (at least win32 and linux) check
    whether the previous socket operation would block.
  + my_socket_operation_in_progess - idem for EINPROGRESS.
- my_nonblock made to work on win32 (by using ioctlsocket if
  HAVE_WINSOCK is defined).

Sorry if these patches mix too many new things into only a few patch
files. If this is inconvenient I'll chop then up even more in the
future.


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev






--
Vasco Alexandre da Silva Costa
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to