You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2013/10/12 20:04:29 UTC
svn commit: r1531565 - in /apr/apr/branches/1.5.x: ./ CHANGES
file_io/win32/filedup.c file_io/win32/open.c file_io/win32/pipe.c
include/arch/win32/apr_arch_file_io.h
Author: trawick
Date: Sat Oct 12 18:04:28 2013
New Revision: 1531565
URL: http://svn.apache.org/r1531565
Log:
Merge r748080:
On windows files != sockets, so do not
create unneeded pollset for every opened file.
Submitted by: mturk
Modified:
apr/apr/branches/1.5.x/ (props changed)
apr/apr/branches/1.5.x/CHANGES
apr/apr/branches/1.5.x/file_io/win32/filedup.c
apr/apr/branches/1.5.x/file_io/win32/open.c
apr/apr/branches/1.5.x/file_io/win32/pipe.c
apr/apr/branches/1.5.x/include/arch/win32/apr_arch_file_io.h
Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r748080
Modified: apr/apr/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?rev=1531565&r1=1531564&r2=1531565&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.5.x/CHANGES [utf-8] Sat Oct 12 18:04:28 2013
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 1.5.0
+ *) Files and pipes on Windows: Don't create an unused pollset when
+ files and pipes are opened. [Mladen Turk]
+
*) apr_socket_timeout_set() on Windows: If the socket was in a non-
blocking state before, disable that setting so that timeouts work.
[Jeff Trawick]
Modified: apr/apr/branches/1.5.x/file_io/win32/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/win32/filedup.c?rev=1531565&r1=1531564&r2=1531565&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/win32/filedup.c (original)
+++ apr/apr/branches/1.5.x/file_io/win32/filedup.c Sat Oct 12 18:04:28 2013
@@ -57,10 +57,11 @@ APR_DECLARE(apr_status_t) apr_file_dup(a
apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup,
apr_pool_cleanup_null);
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0);
-
+#endif
return APR_SUCCESS;
#endif /* !defined(_WIN32_WCE) */
}
@@ -216,9 +217,10 @@ APR_DECLARE(apr_status_t) apr_file_setas
apr_pool_cleanup_kill(old_file->pool, (void *)old_file,
file_cleanup);
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0);
-
+#endif
return APR_SUCCESS;
}
Modified: apr/apr/branches/1.5.x/file_io/win32/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/win32/open.c?rev=1531565&r1=1531564&r2=1531565&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/win32/open.c (original)
+++ apr/apr/branches/1.5.x/file_io/win32/open.c Sat Oct 12 18:04:28 2013
@@ -475,10 +475,11 @@ APR_DECLARE(apr_status_t) apr_file_open(
/* This feature is not supported on this platform. */
(*new)->flags &= ~APR_FOPEN_SPARSE;
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*new)->pollset, 1, pool, 0);
-
+#endif
if (!(flag & APR_FOPEN_NOCLEANUP)) {
apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup,
apr_pool_cleanup_null);
@@ -654,10 +655,11 @@ APR_DECLARE(apr_status_t) apr_os_file_pu
}
}
+#if APR_FILES_AS_SOCKETS
/* Create a pollset with room for one descriptor. */
/* ### check return codes */
(void) apr_pollset_create(&(*file)->pollset, 1, pool, 0);
-
+#endif
/* Should we be testing if thefile is a handle to
* a PIPE and set up the mechanics appropriately?
*
Modified: apr/apr/branches/1.5.x/file_io/win32/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/win32/pipe.c?rev=1531565&r1=1531564&r2=1531565&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/win32/pipe.c (original)
+++ apr/apr/branches/1.5.x/file_io/win32/pipe.c Sat Oct 12 18:04:28 2013
@@ -107,8 +107,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
(*in)->dataRead = 0;
(*in)->direction = 0;
(*in)->pOverlapped = NULL;
+#if APR_FILES_AS_SOCKETS
(void) apr_pollset_create(&(*in)->pollset, 1, p, 0);
-
+#endif
(*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
(*out)->pool = p;
(*out)->fname = NULL;
@@ -121,8 +122,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
(*out)->dataRead = 0;
(*out)->direction = 0;
(*out)->pOverlapped = NULL;
+#if APR_FILES_AS_SOCKETS
(void) apr_pollset_create(&(*out)->pollset, 1, p, 0);
-
+#endif
if (apr_os_level >= APR_WIN_NT) {
/* Create the read end of the pipe */
dwOpenMode = PIPE_ACCESS_INBOUND;
@@ -210,8 +212,9 @@ APR_DECLARE(apr_status_t) apr_os_pipe_pu
(*file)->timeout = -1;
(*file)->ungetchar = -1;
(*file)->filehand = *thefile;
+#if APR_FILES_AS_SOCKETS
(void) apr_pollset_create(&(*file)->pollset, 1, pool, 0);
-
+#endif
if (register_cleanup) {
apr_pool_cleanup_register(pool, *file, file_cleanup,
apr_pool_cleanup_null);
Modified: apr/apr/branches/1.5.x/include/arch/win32/apr_arch_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/arch/win32/apr_arch_file_io.h?rev=1531565&r1=1531564&r2=1531565&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/arch/win32/apr_arch_file_io.h (original)
+++ apr/apr/branches/1.5.x/include/arch/win32/apr_arch_file_io.h Sat Oct 12 18:04:28 2013
@@ -184,9 +184,10 @@ struct apr_file_t {
apr_off_t filePtr; // position in file of handle
apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields
+#if APR_FILES_AS_SOCKETS
/* if there is a timeout set, then this pollset is used */
apr_pollset_t *pollset;
-
+#endif
/* Pipe specific info */
};