diff options
-rw-r--r-- | file_io/win32/readwrite.c | 42 | ||||
-rw-r--r-- | include/arch/win32/apr_arch_file_io.h | 3 |
2 files changed, 6 insertions, 39 deletions
diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 0ce9f82cc..c9d4864ed 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -20,7 +20,6 @@ #include "apr_strings.h" #include "apr_lib.h" #include "apr_errno.h" -#include "apr_arch_networkio.h" #include "apr_arch_atime.h" #include "apr_arch_misc.h" @@ -74,23 +73,8 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le file->pOverlapped->OffsetHigh = (DWORD)(file->filePtr >> 32); } - if (file->ftype == APR_FILETYPE_SOCKET) { - WSABUF wsaData; - DWORD flags = 0; - - wsaData.buf = (char*) buf; - wsaData.len = (u_long)len; - if (WSARecv((SOCKET)file->filehand, &wsaData, 1, &bytesread, - &flags, NULL, NULL) == SOCKET_ERROR) { - rv = apr_get_netos_error(); - bytesread = 0; - } - else { - rv = APR_SUCCESS; - } - } - else if (ReadFile(file->filehand, buf, len, - &bytesread, file->pOverlapped)) { + if (ReadFile(file->filehand, buf, len, + &bytesread, file->pOverlapped)) { rv = APR_SUCCESS; } else { @@ -426,25 +410,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_unlock(thefile->mutex); } - } - else if (thefile->ftype == APR_FILETYPE_SOCKET) { - WSABUF wsaData; - DWORD flags = 0; - - wsaData.buf = (char*) buf; - wsaData.len = (u_long)*nbytes; - if (WSASend((SOCKET)thefile->filehand, &wsaData, 1, &bwrote, - flags, NULL, NULL) == SOCKET_ERROR) { - rv = apr_get_netos_error(); - bwrote = 0; - } - else { - rv = APR_SUCCESS; - } - *nbytes = bwrote; - } - else { - if (thefile->ftype != APR_FILETYPE_FILE) { + return rv; + } else { + if (thefile->ftype == APR_FILETYPE_PIPE) { rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); } diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 2bee5abc1..007459622 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -161,8 +161,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, typedef enum { APR_FILETYPE_FILE = 0, - APR_FILETYPE_PIPE, - APR_FILETYPE_SOCKET + APR_FILETYPE_PIPE } apr_filetype_e; struct apr_file_t { |