Skip to content

Commit

Permalink
Dispatch-style protocol switching for transport
Browse files Browse the repository at this point in the history
Switch to using per-transport-type functions when a socket that we're
using to communicate with a server becomes readable or writable, and add
them as pointers to the connection state.  The functions are passed the
name of the realm of the server being contacted, as we expect to need
this in the near future.

[nalin@redhat.com: replace macros with typedefs]
[nalin@redhat.com: compare transports with TCP_OR_UDP rather than with 0]

ticket: 7929
  • Loading branch information
frozencemetery authored and greghudson committed Jun 2, 2014
1 parent bb89afd commit 606e2cc
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 133 deletions.
6 changes: 3 additions & 3 deletions src/lib/krb5/os/changepw.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ change_set_password(krb5_context context,
callback_info.pfn_cleanup = kpasswd_sendto_msg_cleanup;
krb5_free_data_contents(callback_ctx.context, &chpw_rep);

code = k5_sendto(callback_ctx.context, NULL, &sl, strategy,
&callback_info, &chpw_rep, ss2sa(&remote_addr),
&addrlen, NULL, NULL, NULL);
code = k5_sendto(callback_ctx.context, NULL, &creds->server->realm,
&sl, strategy, &callback_info, &chpw_rep,
ss2sa(&remote_addr), &addrlen, NULL, NULL, NULL);
if (code) {
/*
* Here we may want to switch to TCP on some errors.
Expand Down
1 change: 1 addition & 0 deletions src/lib/krb5/os/os-proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ int _krb5_use_dns_kdc (krb5_context);
int _krb5_conf_boolean (const char *);

krb5_error_code k5_sendto(krb5_context context, const krb5_data *message,
const krb5_data *realm,
const struct serverlist *addrs,
k5_transport_strategy strategy,
struct sendto_callback_info *callback_info,
Expand Down

0 comments on commit 606e2cc

Please sign in to comment.