From: John Kohl Date: Fri, 20 Apr 1990 13:37:20 +0000 (+0000) Subject: make manifest constants into external variables X-Git-Tag: krb5-1.0-alpha2~856 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=697ebb7852f36fd76fb02e975c416e4300a79409;p=krb5.git make manifest constants into external variables git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@539 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index f38ec3183..7c7dc294d 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -26,9 +26,6 @@ static char rcsid_sendto_kdc_c[] = #include #include #include -#define MAX_DGRAM_SIZE 4096 /* XXX! */ -#define MAX_TIMEOUT 30 /* XXX */ -#define TIMEOUT_SHIFT 2 /* XXX */ #include #include @@ -45,6 +42,13 @@ static char rcsid_sendto_kdc_c[] = * when finished. * */ + + +extern int krb5_max_dgram_size; +extern int krb5_max_skdc_timeout; +extern int krb5_skdc_timeout_shift; +extern int krb5_skdc_timeout_1; + krb5_error_code krb5_sendto_kdc (DECLARG(const krb5_data *, message), DECLARG(const krb5_data *, realm), @@ -76,17 +80,18 @@ OLDDECLARG(krb5_data *, reply) for (i = 0; i < AF_MAX; i++) socklist[i] = -1; - if (!(reply->data = malloc(MAX_DGRAM_SIZE))) { /* XXX size? */ + if (!(reply->data = malloc(krb5_max_dgram_size))) { free((char *)addr); return ENOMEM; } - reply->length = MAX_DGRAM_SIZE; + reply->length = krb5_max_dgram_size; /* * do exponential backoff. */ - for (timeout = 1; timeout < MAX_TIMEOUT; timeout <<=TIMEOUT_SHIFT) { + for (timeout = krb5_skdc_timeout_1; timeout < krb5_max_skdc_timeout; + timeout <<= krb5_skdc_timeout_shift) { sent = 0; for (host = 0; host < naddr; host++) { /* send to the host, wait timeout seconds for a response, @@ -121,8 +126,12 @@ OLDDECLARG(krb5_data *, reply) 0, 0, &waitlen)) { - if (nready == -1) - continue; /* XXX */ + if (nready == -1) { + if (errno == EINTR) + continue; + retval = errno; + goto out; + } if ((cc = recvfrom(socklist[addr[host].sa_family], reply->data, reply->length,