+2004-06-07 Ezra Peisach <epeisach@mit.edu.edu>
+
+ * network.c (paddr): Use unsigned int for length.
+ (kdc_conn_type): Declare CONN_ enumerated types in connection as
+ distinct type.
+ (add_fd): Declare as taking enum type instead of simply
+ integer. Prevents assignment of interger to an enum.
+ (process_tcp_connection): Remove variable assigned to but never used.
+
2004-05-05 Ken Raeburn <raeburn@mit.edu>
* network.c: Include foreachaddr.h, not foreachaddr.c.
NI_NUMERICHOST|NI_NUMERICSERV))
strcpy(buf, "<unprintable>");
else {
- int len = sizeof(buf) - strlen(buf);
+ unsigned int len = sizeof(buf) - strlen(buf);
char *p = buf + strlen(buf);
if (len > 2+strlen(portbuf)) {
*p++ = '.';
/* KDC data. */
+enum kdc_conn_type { CONN_UDP, CONN_TCP_LISTENER, CONN_TCP };
+
/* Per-connection info. */
struct connection {
int fd;
- enum { CONN_UDP, CONN_TCP_LISTENER, CONN_TCP } type;
+ enum kdc_conn_type type;
void (*service)(struct connection *, const char *, int);
union {
/* Type-specific information. */
};
static struct connection *
-add_fd (struct socksetup *data, int sock, int conntype,
+add_fd (struct socksetup *data, int sock, enum kdc_conn_type conntype,
void (*service)(struct connection *, const char *, int))
{
struct connection *newconn;
if (selflags & SSF_WRITE) {
ssize_t nwrote;
SOCKET_WRITEV_TEMP tmp;
- krb5_error_code e;
nwrote = SOCKET_WRITEV(conn->fd, conn->u.tcp.sgp, conn->u.tcp.sgnum,
tmp);
if (nwrote < 0) {
- e = SOCKET_ERRNO;
goto kill_tcp_connection;
}
if (nwrote == 0)