pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/py-uwsgi



Module Name:    pkgsrc
Committed By:   joerg
Date:           Tue Jun  4 11:50:46 UTC 2024

Modified Files:
        pkgsrc/www/py-uwsgi: Makefile distinfo
Added Files:
        pkgsrc/www/py-uwsgi/patches: patch-core_socket.c
            patch-plugins_corerouter_corerouter.c patch-proto_base.c

Log Message:
Fix SOCK_NONBLOCK handling for NetBSD. Bump revision.

XXX This likely affects other non-Linux platforms just as well.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 pkgsrc/www/py-uwsgi/Makefile
cvs rdiff -u -r1.48 -r1.49 pkgsrc/www/py-uwsgi/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/www/py-uwsgi/patches/patch-core_socket.c \
    pkgsrc/www/py-uwsgi/patches/patch-plugins_corerouter_corerouter.c \
    pkgsrc/www/py-uwsgi/patches/patch-proto_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/py-uwsgi/Makefile
diff -u pkgsrc/www/py-uwsgi/Makefile:1.66 pkgsrc/www/py-uwsgi/Makefile:1.67
--- pkgsrc/www/py-uwsgi/Makefile:1.66   Wed May 29 16:34:55 2024
+++ pkgsrc/www/py-uwsgi/Makefile        Tue Jun  4 11:50:46 2024
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.66 2024/05/29 16:34:55 adam Exp $
+# $NetBSD: Makefile,v 1.67 2024/06/04 11:50:46 joerg Exp $
 
 DISTNAME=      uwsgi-2.0.25.1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    www python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=u/uwsgi/}
 

Index: pkgsrc/www/py-uwsgi/distinfo
diff -u pkgsrc/www/py-uwsgi/distinfo:1.48 pkgsrc/www/py-uwsgi/distinfo:1.49
--- pkgsrc/www/py-uwsgi/distinfo:1.48   Thu Apr 18 09:05:25 2024
+++ pkgsrc/www/py-uwsgi/distinfo        Tue Jun  4 11:50:46 2024
@@ -1,9 +1,12 @@
-$NetBSD: distinfo,v 1.48 2024/04/18 09:05:25 wiz Exp $
+$NetBSD: distinfo,v 1.49 2024/06/04 11:50:46 joerg Exp $
 
 BLAKE2s (uwsgi-2.0.25.1.tar.gz) = e1700c08e7491467db6b6e4ca09f27d58f41544a8a0b6c70c374b097429297ff
 SHA512 (uwsgi-2.0.25.1.tar.gz) = a20b36d56fa968d45aa9294e8a5f5d141a04ca9775893f7ea65f79608bdb015d2a4debd087f1b8effaf5b66f3cea4a9be124fe8ee10b4aa4277edd52ec9a9618
 Size (uwsgi-2.0.25.1.tar.gz) = 812004 bytes
 SHA1 (patch-base.ini) = 1c5d7693e6c8011e6cc34f5f5d203584c985eb30
 SHA1 (patch-core_logging.c) = e1e5f39446baecdcfc1738aa97852ad3d5ca40c7
+SHA1 (patch-core_socket.c) = 84df92882d53c8a364082e97f699e3ddbc2859ae
+SHA1 (patch-plugins_corerouter_corerouter.c) = 6355a7882b24d17456914720283d0bb079a5dc1a
+SHA1 (patch-proto_base.c) = 7533a60645c744d3bd4cee029c37028afd52a868
 SHA1 (patch-uwsgi.h) = 112a325615e517f29b2420ba08f76d6a7a1bd3ef
 SHA1 (patch-uwsgiconfig.py) = 4945de7da82f3b05508e7d30ee0c3fe3144a2829

Added files:

Index: pkgsrc/www/py-uwsgi/patches/patch-core_socket.c
diff -u /dev/null pkgsrc/www/py-uwsgi/patches/patch-core_socket.c:1.1
--- /dev/null   Tue Jun  4 11:50:46 2024
+++ pkgsrc/www/py-uwsgi/patches/patch-core_socket.c     Tue Jun  4 11:50:46 2024
@@ -0,0 +1,61 @@
+$NetBSD: patch-core_socket.c,v 1.1 2024/06/04 11:50:46 joerg Exp $
+
+Use same non-blocking handling on NetBSD as on Linux.
+Use FreeBSD-style acceptfilter on NetBSD as well.
+
+--- core/socket.c.orig 2024-02-08 16:35:28.000000000 +0000
++++ core/socket.c
+@@ -413,7 +413,7 @@ static int connect_to_unix(char *socket_
+               memcpy(uws_addr.sun_path, socket_name, UMIN(strlen(socket_name), 102));
+       }
+ 
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__) || defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+       uwsgi_poll.fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0);
+ #else
+       uwsgi_poll.fd = socket(AF_UNIX, SOCK_STREAM, 0);
+@@ -453,7 +453,7 @@ static int connect_to_tcp(char *socket_n
+               uws_addr.sin_addr.s_addr = inet_addr(socket_name);
+       }
+ 
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__) || defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+       uwsgi_poll.fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
+ #else
+       uwsgi_poll.fd = socket(AF_INET, SOCK_STREAM, 0);
+@@ -744,7 +744,7 @@ int bind_to_tcp(char *socket_name, int l
+                       uwsgi_error("TCP_DEFER_ACCEPT setsockopt()");
+               }
+               // OSX has no SO_ACCEPTFILTER !!!
+-#elif defined(__freebsd__)
++#elif defined(__freebsd__) || defined(__NetBSD__)
+               struct accept_filter_arg afa;
+               strcpy(afa.af_name, "dataready");
+               afa.af_arg[0] = 0;
+@@ -827,7 +827,7 @@ int timed_connect(struct pollfd *fdpoll,
+       int cnt;
+       /* set non-blocking socket */
+ 
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__) || defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+       // hmm, nothing to do, as we are already non-blocking
+ #else
+       int arg = fcntl(fdpoll->fd, F_GETFL, NULL);
+@@ -861,7 +861,7 @@ int timed_connect(struct pollfd *fdpoll,
+       }
+ 
+ 
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__) || defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+       uwsgi_socket_b(fdpoll->fd);
+ #else
+       /* re-set blocking socket */
+@@ -1907,7 +1907,7 @@ int uwsgi_accept(int server_fd) {
+       struct sockaddr_un client_src;
+         memset(&client_src, 0, sizeof(struct sockaddr_un));
+         socklen_t client_src_len = 0;
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__) || defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+         return accept4(server_fd, (struct sockaddr *) &client_src, &client_src_len, SOCK_NONBLOCK);
+ #elif defined(__linux__)
+         int client_fd = accept(server_fd, (struct sockaddr *) &client_src, &client_src_len);
Index: pkgsrc/www/py-uwsgi/patches/patch-plugins_corerouter_corerouter.c
diff -u /dev/null pkgsrc/www/py-uwsgi/patches/patch-plugins_corerouter_corerouter.c:1.1
--- /dev/null   Tue Jun  4 11:50:46 2024
+++ pkgsrc/www/py-uwsgi/patches/patch-plugins_corerouter_corerouter.c   Tue Jun  4 11:50:46 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-plugins_corerouter_corerouter.c,v 1.1 2024/06/04 11:50:46 joerg Exp $
+
+Use same non-blocking handling on NetBSD as on Linux.
+
+--- plugins/corerouter/corerouter.c.orig       2024-02-08 16:35:28.000000000 +0000
++++ plugins/corerouter/corerouter.c
+@@ -822,7 +822,7 @@ void uwsgi_corerouter_loop(int id, void
+                       while (ugs) {
+                               if (ugs->gateway == &ushared->gateways[id] && ucr->interesting_fd == ugs->fd) {
+                                       if (!ugs->subscription) {
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__) || defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+                                               new_connection = accept4(ucr->interesting_fd, (struct sockaddr *) &cr_addr, &cr_addr_len, SOCK_NONBLOCK);
+                                               if (new_connection < 0) {
+                                                       taken = 1;
Index: pkgsrc/www/py-uwsgi/patches/patch-proto_base.c
diff -u /dev/null pkgsrc/www/py-uwsgi/patches/patch-proto_base.c:1.1
--- /dev/null   Tue Jun  4 11:50:46 2024
+++ pkgsrc/www/py-uwsgi/patches/patch-proto_base.c      Tue Jun  4 11:50:46 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-proto_base.c,v 1.1 2024/06/04 11:50:46 joerg Exp $
+
+Use same non-blocking handling on NetBSD as on Linux.
+
+--- proto/base.c.orig  2024-06-03 12:06:13.035432857 +0000
++++ proto/base.c
+@@ -97,7 +97,7 @@ uint16_t proto_base_add_uwsgi_var(struct
+ int uwsgi_proto_base_accept(struct wsgi_request *wsgi_req, int fd) {
+ 
+       wsgi_req->c_len = sizeof(struct sockaddr_un);
+-#if defined(__linux__) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
++#if (defined(__linux__)||defined(__NetBSD__)) && defined(SOCK_NONBLOCK) && !defined(OBSOLETE_LINUX_KERNEL)
+       return accept4(fd, (struct sockaddr *) &wsgi_req->client_addr, (socklen_t *) & wsgi_req->c_len, SOCK_NONBLOCK);
+ #elif defined(__linux__)
+       int client_fd = accept(fd, (struct sockaddr *) &wsgi_req->client_addr, (socklen_t *) & wsgi_req->c_len);



Home | Main Index | Thread Index | Old Index