Fix send_to_kdc for Windows sockets

Patchset 58ff480763 calls write() and read()
on rk_socket_t objects which on Windows are SOCKETs not C RTL file
descriptors.  This patchset uses krb5_net_write() and krb5_net_read()
in place of the direct write() and read() operations.

Change-Id: I3f7d4756357d432e4e62910f9a36824eb188b6e4
This commit is contained in:
Jeffrey Altman
2013-09-12 12:03:05 -04:00
parent 649a1f8ff3
commit 6ae305e7a4

View File

@@ -371,7 +371,7 @@ send_stream(krb5_context context, struct host *host)
{
ssize_t len;
len = write(host->fd, host->data.data, host->data.length);
len = krb5_net_write(context, &host->fd, host->data.data, host->data.length);
if (len < 0)
return errno;
@@ -409,7 +409,7 @@ recv_stream(krb5_context context, struct host *host)
if (ret)
return ret;
sret = read(host->fd, ((uint8_t *)host->data.data) + oldlen, nbytes);
sret = krb5_net_read(context, &host->fd, ((uint8_t *)host->data.data) + oldlen, nbytes);
if (sret <= 0) {
ret = errno;
return ret;