Skip to content

Commit

Permalink
Clean up dispatch lookaside code slightly
Browse files Browse the repository at this point in the history
Always log when we get a lookaside cache hit, eliminating a confusing
conditional.  This is a slight behavior change because we never used
to log a lookaside cache hit when we can't deliver the response via
UDP, but that was never really deliberate or important--we log all
sorts of stuff about responses which might turn out to be too big.

Also eliminate a signed/unsigned comparison warning in
finish_dispatch.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25661 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
ghudson committed Jan 26, 2012
1 parent 4b9eb1f commit 1d88207
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/kdc/dispatch.c
Expand Up @@ -51,7 +51,7 @@ finish_dispatch(struct dispatch_state *state, krb5_error_code code,
void *oldarg = state->arg; void *oldarg = state->arg;


if (state->is_tcp == 0 && response && if (state->is_tcp == 0 && response &&
response->length > max_dgram_reply_size) { response->length > (unsigned int)max_dgram_reply_size) {
krb5_free_data(kdc_context, response); krb5_free_data(kdc_context, response);
response = NULL; response = NULL;
code = make_too_big_error(&response); code = make_too_big_error(&response);
Expand Down Expand Up @@ -114,22 +114,19 @@ dispatch(void *cb, struct sockaddr *local_saddr,
const char *name = 0; const char *name = 0;
char buf[46]; char buf[46];


if (!response || is_tcp != 0 || name = inet_ntop (ADDRTYPE2FAMILY (from->address->addrtype),
response->length <= max_dgram_reply_size) { from->address->contents, buf, sizeof (buf));
name = inet_ntop (ADDRTYPE2FAMILY (from->address->addrtype), if (name == 0)
from->address->contents, buf, sizeof (buf)); name = "[unknown address type]";
if (name == 0) if (response)
name = "[unknown address type]"; krb5_klog_syslog(LOG_INFO,
if (response) "DISPATCH: repeated (retransmitted?) request "
krb5_klog_syslog(LOG_INFO, "from %s, resending previous response", name);
"DISPATCH: repeated (retransmitted?) request " else
"from %s, resending previous response", name); krb5_klog_syslog(LOG_INFO,
else "DISPATCH: repeated (retransmitted?) request "
krb5_klog_syslog(LOG_INFO, "from %s during request processing, dropping "
"DISPATCH: repeated (retransmitted?) request " "repeated request", name);
"from %s during request processing, dropping "
"repeated request", name);
}


finish_dispatch(state, response ? 0 : KRB5KDC_ERR_DISCARD, response); finish_dispatch(state, response ? 0 : KRB5KDC_ERR_DISCARD, response);
return; return;
Expand Down

0 comments on commit 1d88207

Please sign in to comment.