Commit 64ac07df authored by Per Cederqvist's avatar Per Cederqvist

Use a callback-based API for DNS lookup, in preparation for ADNS

integration.  Block clients, and make them invisible for all other
clients, until the DNS lookup has completed.

The session_start field of a Connection was used both to record the
connect time and the login/logout time.  As a result, the
connection-time of a Static-Session-Info was not actually static.
Fixed by keeping track of the connect time and the login/logout
separately.
parent 2bbe5040
2003-08-05 Per Cederqvist <ceder@ceder.dyndns.org>
Use a callback-based API for DNS lookup, in preparation for ADNS
integration. Block clients, and make them invisible for all other
clients, until the DNS lookup has completed.
* doc/lyskomd.texi (Files): Document the handshake_ok field of
connections.txt.
(Function Templates for send-async.c): Include a call to
handshake_ok() in prototype code.
(Traversing Connections): Ditto.
* src/server/session.c: All users of the hostname updated to get
it from the isc_scb.
(who_is_on): Removed dead code.
(who_is_on_ident): Ditto.
(who_is_on_dynamic): Removed dead code. Don't include sessions
until the handshake is completed.
(get_session_info): Don't include sessions until the handshake is
completed.
(get_static_session_info): Don't include sessions until the
handshake is completed.
(get_session_info_ident): Ditto.
(disconnect): Don't include sessions until the handshake is
completed.
(get_client_name): Ditto.
(get_client_version): Ditto.
* src/server/send-async.c (async_new_text_old): Use handshake_ok()
to check if it is OK to send the message to the client. As a
result, the message will not be sent until the DNS lookup has
completed.
(async_new_text): Ditto.
(async_i_am_on): Ditto.
(async_logout): Ditto.
(async_new_name): Ditto.
(async_forced_leave_conf): Ditto.
(async_login): Ditto.
(async_deleted_text): Ditto.
(async_new_recipient): Ditto.
(async_sub_recipient): Ditto.
(async_new_membership): Ditto.
(async_new_user_area): Ditto.
(async_garb_ended): Ditto.
(async_sync_db): Ditto, but ignore the DNS lookup.
(async_rejected_connection): Ditto.
* src/server/prot-a.c (prot_a_parse_packet): Disable the session
after the initial handshake if the dns resolution hasn't completed
yet.
* src/server/membership.c (send_async_new_membership): Indentation
fixed.
* src/server/internal-connections.h (enum ignored_conditions): New
enum.
(handshake_ok): New function.
* src/server/internal-connections.c (init_connection): Updated to
initialize all fields. Several were forgotten.
(kill_client): Clear the remote_ip.
(handshake_ok): New function.
* src/server/connections.h (Connection): Removed the hostname
field, since that is now stored as isc_session->remote. Added
dns_done, blocked_by_dns, and remote_ip.
* src/server/connections.c (dump_connections): Include a flag that
tells if the session has completed the handshake or not.
(dns_resolution): New function.
(get_host_name): Removed.
(login_request): Reorganized the code to use the new
callback-driven API of ISC host lookups.
* src/server/admin.c (shutdown_kom): Get the host name from the
isc_scb, now that the information is no longer stored in the
connection.
* src/libraries/libmisc/timeval-util.h,
src/libraries/libmisc/timeval-util.c (timeval_diff_d): New
function.
The session_start field of a Connection was used both to record
the connect time and the login/logout time. As a result, the
connection-time of a Static-Session-Info was not actually static.
Fixed by keeping track of the connect time and the login/logout
separately.
* src/server/connections.h (Connection): Replaced the
session_start field with connect_time and login_time. All users
updated.
* src/server/session.c: (login_old): Set login_time, not connect_time.
(login): Ditto.
(logout): Use login_time, not connect_time.
(get_session_info): Use connect_time, not login_time, as the
connection_time.
(get_static_session_info): Use connect_time, not login_time, as the
connection_time.
(get_session_info_ident): Ditto.
* src/server/internal-connections.c (new_client): Set both
connect_time and login_time.
* src/server/connections.c (handle_accept_event): Call set_time(),
so that the connect_time is set correctly.
2003-08-04 Per Cederqvist <ceder@ceder.dyndns.org>
Don't leave whitespace in the input buffers.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment