]> git.ipfire.org Git - thirdparty/krb5.git/commit
Refactor cm functions in sendto_kdc.c
authorGreg Hudson <ghudson@mit.edu>
Wed, 26 Mar 2014 17:21:45 +0000 (13:21 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 3 Apr 2014 01:30:45 +0000 (21:30 -0400)
commit346883c48f1b9e09b1af2cf73e3b96ee8f934072
tree0a78e93eda2cd22fc29d5862f87bd01b0deb4109
parent613c62d689c31a325d51be88657dedd17af3cf81
Refactor cm functions in sendto_kdc.c

Move get_curtime_ms and the cm functions near the top of the file
right after structure definitions.  Except for cm_select_or_poll,
define each cm function separately for poll and for select, since the
implementations don't share much in common.  Instead of
cm_unset_write, define cm_read and cm_write functions to put an fd in
read-only or write-only state.  Remove the ssflags argument from
cm_add_fd and just expect the caller to make a subsequent call to
cm_read or cm_write.  Always select for exceptions when using select.
(Polling for exceptions is implicit with poll).

With these changes, we no longer select/poll for reading on a TCP
connection until we are done writing to it.  So in service_tcp_fd,
remove the check for unexpected read events.
src/lib/krb5/os/sendto_kdc.c