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:
@@ -371,7 +371,7 @@ send_stream(krb5_context context, struct host *host)
|
|||||||
{
|
{
|
||||||
ssize_t len;
|
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)
|
if (len < 0)
|
||||||
return errno;
|
return errno;
|
||||||
@@ -409,7 +409,7 @@ recv_stream(krb5_context context, struct host *host)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return 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) {
|
if (sret <= 0) {
|
||||||
ret = errno;
|
ret = errno;
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user