@@ -4054,10 +4054,15 @@ static int wsgi_execute_script(request_rec *r)
40544054 apr_thread_mutex_unlock (wsgi_module_lock );
40554055#endif
40564056
4057- /* Clear startup timeout and prevent from running again. */
4057+ /*
4058+ * Clear startup timeout and prevent from running again if the
4059+ * module was successfully loaded.
4060+ */
40584061
40594062#if defined(MOD_WSGI_WITH_DAEMONS )
4060- wsgi_startup_shutdown_time = -1 ;
4063+ if (module && wsgi_startup_shutdown_time > 0 ) {
4064+ wsgi_startup_shutdown_time = -1 ;
4065+ }
40614066#endif
40624067
40634068 /* Assume an internal server error unless everything okay. */
@@ -4616,8 +4621,28 @@ static const char *wsgi_add_script_alias(cmd_parms *cmd, void *mconfig,
46164621 if (!group )
46174622 return "WSGI process group not yet configured." ;
46184623
4619- if (group -> server != cmd -> server && group -> server -> is_virtual )
4624+ if (cmd -> server -> server_hostname &&
4625+ group -> server -> server_hostname &&
4626+ strcmp (cmd -> server -> server_hostname ,
4627+ group -> server -> server_hostname ) &&
4628+ group -> server -> is_virtual ) {
4629+
46204630 return "WSGI process group not accessible." ;
4631+ }
4632+
4633+ if (!cmd -> server -> server_hostname &&
4634+ group -> server -> server_hostname &&
4635+ group -> server -> is_virtual ) {
4636+
4637+ return "WSGI process group not matchable." ;
4638+ }
4639+
4640+ if (cmd -> server -> server_hostname &&
4641+ !group -> server -> server_hostname &&
4642+ group -> server -> is_virtual ) {
4643+
4644+ return "WSGI process group not matchable." ;
4645+ }
46214646 }
46224647#endif
46234648 }
@@ -4713,7 +4738,10 @@ static const char *wsgi_set_py3k_warning_flag(cmd_parms *cmd, void *mconfig,
47134738
47144739 return NULL ;
47154740}
4741+ #endif
47164742
4743+ #if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3 ) || \
4744+ (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6 )
47174745static const char * wsgi_set_dont_write_bytecode (cmd_parms * cmd , void * mconfig ,
47184746 const char * f )
47194747{
@@ -5120,8 +5148,28 @@ static const char *wsgi_add_import_script(cmd_parms *cmd, void *mconfig,
51205148 if (!group )
51215149 return "WSGI process group not yet configured." ;
51225150
5123- if (group -> server != cmd -> server && group -> server -> is_virtual )
5151+ if (cmd -> server -> server_hostname &&
5152+ group -> server -> server_hostname &&
5153+ strcmp (cmd -> server -> server_hostname ,
5154+ group -> server -> server_hostname ) &&
5155+ group -> server -> is_virtual ) {
5156+
51245157 return "WSGI process group not accessible." ;
5158+ }
5159+
5160+ if (!cmd -> server -> server_hostname &&
5161+ group -> server -> server_hostname &&
5162+ group -> server -> is_virtual ) {
5163+
5164+ return "WSGI process group not matchable." ;
5165+ }
5166+
5167+ if (cmd -> server -> server_hostname &&
5168+ !group -> server -> server_hostname &&
5169+ group -> server -> is_virtual ) {
5170+
5171+ return "WSGI process group not matchable." ;
5172+ }
51255173 }
51265174#else
51275175 object -> process_group = "" ;
@@ -15752,6 +15800,10 @@ static const command_rec wsgi_commands[] =
1575215800#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6
1575315801 AP_INIT_TAKE1 ("WSGIPy3kWarningFlag" , wsgi_set_py3k_warning_flag ,
1575415802 NULL , RSRC_CONF , "Enable/Disable Python 3.0 warnings." ),
15803+ #endif
15804+
15805+ #if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3 ) || \
15806+ (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6 )
1575515807 AP_INIT_TAKE1 ("WSGIDontWriteBytecode" , wsgi_set_dont_write_bytecode ,
1575615808 NULL , RSRC_CONF , "Enable/Disable writing of byte code." ),
1575715809#endif
0 commit comments