198d23
198d23
https://github.com/GrahamDumpleton/mod_wsgi/pull/364
198d23
198d23
https://bugzilla.redhat.com/show_bug.cgi?id=1602620
198d23
198d23
--- mod_wsgi-4.6.4/src/server/__init__.py.warnings
198d23
+++ mod_wsgi-4.6.4/src/server/__init__.py
198d23
@@ -103,7 +103,6 @@
198d23
     for name in mimetypes.knownfiles:
198d23
         if os.path.exists(name):
198d23
             return name
198d23
-            break
198d23
     else:
198d23
         return name
198d23
 
198d23
--- mod_wsgi-4.6.4/src/server/mod_wsgi.c.warnings
198d23
+++ mod_wsgi-4.6.4/src/server/mod_wsgi.c
198d23
@@ -2108,9 +2108,11 @@
198d23
     /* Publish event for the start of the response. */
198d23
 
198d23
     if (wsgi_event_subscribers()) {
198d23
+#if 0
198d23
         WSGIThreadInfo *thread_info;
198d23
 
198d23
         thread_info = wsgi_thread_info(0, 0);
198d23
+#endif
198d23
 
198d23
         event = PyDict_New();
198d23
 
198d23
@@ -6349,10 +6351,7 @@
198d23
 
198d23
         /* Need to cast const away. */
198d23
 
198d23
-        if (r)
198d23
-            id = &((request_rec *)r)->log_id;
198d23
-        else
198d23
-            id = &((conn_rec *)c)->log_id;
198d23
+        id = &((request_rec *)r)->log_id;
198d23
 
198d23
         ap_run_generate_log_id(c, r, id);
198d23
     }
198d23
@@ -8510,6 +8509,7 @@
198d23
         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, wsgi_server,
198d23
                      "mod_wsgi (pid=%d): Couldn't bind unix domain "
198d23
                      "socket '%s'.", getpid(), process->socket_path);
198d23
+        close(sockfd);
198d23
         return -1;
198d23
     }
198d23
 
198d23
@@ -8521,6 +8521,7 @@
198d23
         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, wsgi_server,
198d23
                      "mod_wsgi (pid=%d): Couldn't listen on unix domain "
198d23
                      "socket.", getpid());
198d23
+        close(sockfd);
198d23
         return -1;
198d23
     }
198d23
 
198d23
@@ -8555,6 +8556,7 @@
198d23
                          "mod_wsgi (pid=%d): Couldn't change owner of unix "
198d23
                          "domain socket '%s' to uid=%ld.", getpid(),
198d23
                          process->socket_path, (long)socket_uid);
198d23
+            close(sockfd);
198d23
             return -1;
198d23
         }
198d23
     }
198d23
@@ -13338,8 +13340,10 @@
198d23
         for (i = 0; i < wsgi_daemon_list->nelts; ++i) {
198d23
             entry = &entries[i];
198d23
 
198d23
-            close(entry->listener_fd);
198d23
-            entry->listener_fd = -1;
198d23
+            if (entry->listener_fd != -1) {
198d23
+                close(entry->listener_fd);
198d23
+                entry->listener_fd = -1;
198d23
+            }
198d23
         }
198d23
     }
198d23
 #endif
198d23
@@ -13751,8 +13755,8 @@
198d23
 
198d23
     if (trusted_proxy) {
198d23
         for (i=0; i<trusted_proxy_headers->nelts; i++) {
198d23
-            const char *name = NULL;
198d23
-            const char *value = NULL;
198d23
+            const char *name;
198d23
+            const char *value;
198d23
 
198d23
             name = ((const char**)trusted_proxy_headers->elts)[i];
198d23
             value = apr_table_get(r->subprocess_env, name);
198d23
@@ -13879,11 +13883,9 @@
198d23
          */
198d23
 
198d23
         for (i=0; i<trusted_proxy_headers->nelts; i++) {
198d23
-            const char *name = NULL;
198d23
-            const char *value = NULL;
198d23
+            const char *name;
198d23
 
198d23
             name = ((const char**)trusted_proxy_headers->elts)[i];
198d23
-            value = apr_table_get(r->subprocess_env, name);
198d23
 
198d23
             if (!strcmp(name, "HTTP_X_FORWARDED_FOR") ||
198d23
                      !strcmp(name, "HTTP_X_REAL_IP")) {
198d23
--- mod_wsgi-4.6.4/src/server/wsgi_logger.c.warnings
198d23
+++ mod_wsgi-4.6.4/src/server/wsgi_logger.c
198d23
@@ -694,9 +694,11 @@
198d23
             PyObject *object = NULL;
198d23
 
198d23
             if (wsgi_event_subscribers()) {
198d23
+#if 0
198d23
                 WSGIThreadInfo *thread_info;
198d23
 
198d23
                 thread_info = wsgi_thread_info(0, 0);
198d23
+#endif
198d23
 
198d23
                 event = PyDict_New();
198d23
 
198d23
--- mod_wsgi-4.6.4/src/server/wsgi_python.h.warnings
198d23
+++ mod_wsgi-4.6.4/src/server/wsgi_python.h
198d23
@@ -21,6 +21,12 @@
198d23
 
198d23
 /* ------------------------------------------------------------------------- */
198d23
 
198d23
+#ifdef _POSIX_C_SOURCE
198d23
+#undef _POSIX_C_SOURCE
198d23
+#endif
198d23
+#ifdef _XOPEN_SOURCE
198d23
+#undef _XOPEN_SOURCE
198d23
+#endif
198d23
 #include <Python.h>
198d23
 
198d23
 #if !defined(PY_VERSION_HEX)