summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2000-10-06 22:02:04 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2000-10-06 22:02:04 +0000
commita00ae0dbc51facd86079b606e4d4b4e51cd15699 (patch)
tree36f86ad0ec0d086bbc7944831d3670b2357a255a
parent0c62120b2aecee16db7db2cb1f9a026fbee8c39b (diff)
downloadlibapr-a00ae0dbc51facd86079b606e4d4b4e51cd15699.tar.gz
Knock off some XXX's prior to a7.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60556 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--dso/win32/dso.c17
-rw-r--r--file_io/win32/filestat.c7
-rw-r--r--network_io/win32/poll.c1
3 files changed, 21 insertions, 4 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c
index 98277815f..e4dbad23e 100644
--- a/dso/win32/dso.c
+++ b/dso/win32/dso.c
@@ -53,15 +53,28 @@
*/
#include "dso.h"
+#include "apr_strings.h"
#if APR_HAS_DSO
apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path,
apr_pool_t *ctx)
{
- /* XXX: Must convert path from / to \ notation
+ HINSTANCE os_handle;
+ char fspec[MAX_PATH], *p;
+
+ /* Must convert path from / to \ notation.
+ * Per PR2555, the LoadLibraryEx function is very picky about slashes.
+ * Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL.
+ * LoadLibrary in the MS PSDK also reveals that it -explicitly- states
+ * that backslashes must be used for the LoadLibrary family of calls.
*/
- HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ apr_cpystrn(fspec, path, MAX_PATH);
+ for (p = fspec; *p; ++p)
+ if (*p == '/')
+ *p = '\\';
+
+ os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
*res_handle = apr_pcalloc(ctx, sizeof(*res_handle));
if(os_handle == NULL) {
diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
index 0b241aa47..67cb0161c 100644
--- a/file_io/win32/filestat.c
+++ b/file_io/win32/filestat.c
@@ -218,9 +218,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
}
}
else {
- /* XXX: The question remains, can we assume fname is not a wildcard?
- * Must we test it? Absolutely YES.
+ /* What a waste of cpu cycles... but what else can we do?
*/
+ if (strchr(fname, '*') || strchr(fname, '?'))
+ return APR_ENOENT;
hFind = FindFirstFile(fname, &FileInformation);
if (hFind == INVALID_HANDLE_VALUE) {
return apr_get_os_error();
@@ -280,6 +281,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
* XXX: Do we want to tag if nFileSizeHigh as -1 (or 0x7fffffff?)
*/
finfo->size = FileInformation.nFileSizeLow;
+ if (finfo->size < 0 || FileInformation.nFileSizeLow)
+ finfo->size = 0x7fffffff;
return APR_SUCCESS;
}
diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c
index 87b7d786e..925fd7da7 100644
--- a/network_io/win32/poll.c
+++ b/network_io/win32/poll.c
@@ -157,6 +157,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_
revents |= APR_POLLIN;
if (WSARecv(sock->sock, &data, 1, &dummy, &flags, NULL,
NULL) == SOCKET_ERROR) {
+ /* This is only legit since we don't return the error */
dummy = WSAGetLastError();
switch (dummy) {
case WSAECONNRESET: