Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
c2de013467 | |
|
11ec917bb0 | |
|
7452a0f8da | |
|
83c09233ec |
|
@ -1,47 +1,6 @@
|
||||||
*.src.rpm
|
|
||||||
*.swp
|
|
||||||
*~
|
|
||||||
/results_uwsgi
|
|
||||||
/uwsgi-1.0.4.tar.gz
|
/uwsgi-1.0.4.tar.gz
|
||||||
/uwsgi-1.2.3.tar.gz
|
/uwsgi-1.2.3.tar.gz
|
||||||
/uwsgi-wiki-doc-v41.txt
|
/uwsgi-wiki-doc-v41.txt
|
||||||
/uwsgi-1.2.4.tar.gz
|
/uwsgi-1.2.4.tar.gz
|
||||||
/uwsgi-wiki-doc-v43.txt
|
/uwsgi-wiki-doc-v43.txt
|
||||||
/uwsgi-1.2.6.tar.gz
|
/uwsgi-1.2.6.tar.gz
|
||||||
/uwsgi-1.4.5.tar.gz
|
|
||||||
/uwsgi-1.9.8.tar.gz
|
|
||||||
/1.9.17.tar.gz
|
|
||||||
/uwsgi-doc-1.9.17.tar.gz
|
|
||||||
/uwsgi-1.9.17.tar.gz
|
|
||||||
/uwsgi-docs-b86b3f7.tar.gz
|
|
||||||
/uwsgi-1.9.18.2.tar.gz
|
|
||||||
/uwsgi-docs-71f2d78.tar.gz
|
|
||||||
/uwsgi-1.9.19.tar.gz
|
|
||||||
/uwsgi-docs-119b215.tar.gz
|
|
||||||
/uwsgi-2.0.6.tar.gz
|
|
||||||
/uwsgi-docs-d2c4969.tar.gz
|
|
||||||
/uwsgi-2.0.7.tar.gz
|
|
||||||
/uwsgi-docs-f551708.tar.gz
|
|
||||||
/uwsgi-2.0.9.tar.gz
|
|
||||||
/uwsgi-docs-bc49905.tar.gz
|
|
||||||
/uwsgi-docs-4ac8256.tar.gz
|
|
||||||
/uwsgi-2.0.11.tar.gz
|
|
||||||
/uwsgi-docs-c96716d.tar.gz
|
|
||||||
/uwsgi-docs-85d6b16.tar.gz
|
|
||||||
/uwsgi-2.0.11.1.tar.gz
|
|
||||||
/uwsgi-2.0.11.2.tar.gz
|
|
||||||
/uwsgi-docs-2d5b92a.tar.gz
|
|
||||||
/uwsgi-docs-5f5f899.tar.gz
|
|
||||||
/uwsgi-2.0.12.tar.gz
|
|
||||||
/uwsgi-2.0.13.1.tar.gz
|
|
||||||
/uwsgi-docs-0326082.tar.gz
|
|
||||||
/uwsgi-2.0.14.tar.gz
|
|
||||||
/uwsgi-docs-f6eacc5.tar.gz
|
|
||||||
/uwsgi-2.0.15.tar.gz
|
|
||||||
/uwsgi-docs-1610d37.tar.gz
|
|
||||||
/uwsgi-2.0.16.tar.gz
|
|
||||||
/uwsgi-docs-eb4ad98.tar.gz
|
|
||||||
/uwsgi-2.0.17.1.tar.gz
|
|
||||||
/uwsgi-docs-32a8f73.tar.gz
|
|
||||||
/uwsgi-2.0.18.tar.gz
|
|
||||||
/uwsgi-docs-8d868ea.tar.gz
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
The build profile used to build this package is shipped along with the
|
|
||||||
-devel subpackage and is located in the ``buildconf`` subdirectory in the
|
|
||||||
src directory.
|
|
||||||
A copy of the documentation can be obtained by installing the ``uwsgi-docs``
|
|
||||||
package. The documentation is a copy as of the git SHA:
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
[uwsgi]
|
|
||||||
uid = uwsgi
|
|
||||||
gid = uwsgi
|
|
||||||
pidfile = /run/uwsgi/uwsgi.pid
|
|
||||||
emperor = /etc/uwsgi.d
|
|
||||||
stats = /run/uwsgi/stats.sock
|
|
||||||
chmod-socket = 660
|
|
||||||
emperor-tyrant = true
|
|
||||||
cap = setgid,setuid
|
|
84
fedora.ini
84
fedora.ini
|
@ -1,81 +1,5 @@
|
||||||
[uwsgi]
|
[uwsgi]
|
||||||
inherit = core
|
inherit = base
|
||||||
bin_name = uwsgi
|
embedded_plugins = echo, ping, http
|
||||||
xml = libxml2
|
plugins = rack, psgi, python, nagios, fastrouter, admin, ruby19, cache, cgi, rpc, ugreen, greenlet, lua, php, carbon, rrdtool, rsyslog, syslog
|
||||||
yaml = libyaml
|
|
||||||
json = jansson
|
|
||||||
pcre = auto
|
|
||||||
routing = auto
|
|
||||||
ssl = auto
|
|
||||||
malloc_implementation = libc
|
|
||||||
embedded_plugins = corerouter, echo, ping
|
|
||||||
plugins = airbrake,
|
|
||||||
alarm_curl,
|
|
||||||
alarm_xmpp,
|
|
||||||
cache,
|
|
||||||
carbon,
|
|
||||||
cgi,
|
|
||||||
cheaper_busyness,
|
|
||||||
cplusplus,
|
|
||||||
curl_cron,
|
|
||||||
dumbloop,
|
|
||||||
dummy,
|
|
||||||
fastrouter,
|
|
||||||
forkptyrouter,
|
|
||||||
geoip,
|
|
||||||
graylog2,
|
|
||||||
http,
|
|
||||||
ldap,
|
|
||||||
logcrypto,
|
|
||||||
logfile,
|
|
||||||
logpipe,
|
|
||||||
logsocket,
|
|
||||||
lua,
|
|
||||||
msgpack,
|
|
||||||
nagios,
|
|
||||||
notfound,
|
|
||||||
pam,
|
|
||||||
php,
|
|
||||||
pty,
|
|
||||||
rack,
|
|
||||||
rawrouter,
|
|
||||||
redislog,
|
|
||||||
router_basicauth,
|
|
||||||
router_cache,
|
|
||||||
router_expires,
|
|
||||||
router_hash,
|
|
||||||
router_http,
|
|
||||||
router_memcached,
|
|
||||||
router_metrics,
|
|
||||||
router_radius,
|
|
||||||
router_redirect,
|
|
||||||
router_redis,
|
|
||||||
router_rewrite,
|
|
||||||
router_spnego,
|
|
||||||
router_static,
|
|
||||||
router_uwsgi,
|
|
||||||
router_xmldir,
|
|
||||||
rpc,
|
|
||||||
rrdtool,
|
|
||||||
rsyslog,
|
|
||||||
ruby19,
|
|
||||||
spooler,
|
|
||||||
sqlite3,
|
|
||||||
ssi,
|
|
||||||
sslrouter,
|
|
||||||
stats_pusher_file,
|
|
||||||
stats_pusher_socket,
|
|
||||||
stats_pusher_statsd,
|
|
||||||
syslog,
|
|
||||||
transformation_chunked,
|
|
||||||
transformation_gzip,
|
|
||||||
transformation_offload,
|
|
||||||
transformation_template,
|
|
||||||
transformation_tofile,
|
|
||||||
transformation_toupper,
|
|
||||||
ugreen,
|
|
||||||
webdav,
|
|
||||||
xattr,
|
|
||||||
xslt,
|
|
||||||
zabbix,
|
|
||||||
zergpool
|
|
||||||
|
|
7
sources
7
sources
|
@ -1,4 +1,3 @@
|
||||||
SHA512 (uwsgi-2.0.17.1.tar.gz) = 10d357961fde3a3f5f8e77986cc647313f95a33243e24c2afc482fce21df68a8ae48f90e7b5b76d7edc3cf8fd474d99823d6d60ef7477349abc65a319222f11b
|
5216f3742fee40999ca4519519b890ad uwsgi-1.2.4.tar.gz
|
||||||
SHA512 (uwsgi-docs-32a8f73.tar.gz) = 687240d9c33cb44061b3e43746354a14cfa49162ee25100c97866c0405878b9bc62164b6dbe2acae451edb674d9fd900933062ebd5755b728eeec3f7fe7eda36
|
c2fa5a293ccac33e1c9c0277963c841e uwsgi-wiki-doc-v43.txt
|
||||||
SHA512 (uwsgi-2.0.18.tar.gz) = 6561703279bcc4a81311d033810ac066d0f113bab13b0942f3eef86cac29c584a6641b52476840d6895151aee5ed064ae2d03b18932cf7f47e62f4eeed76da61
|
e704bf8e315129a16ea233342580e5d1 uwsgi-1.2.6.tar.gz
|
||||||
SHA512 (uwsgi-docs-8d868ea.tar.gz) = 1ebf9bbe42d7a67553ff1081a2322fc00c72b72fa52879bba3b7ce8d9f4934b5643d96444ce75559b9f7303be4cdc0453ae2b4d73f1fa13cfc32f69d522bc2f0
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
diff -up uwsgi-2.0.16/plugins/glusterfs/glusterfs.c.glfs uwsgi-2.0.16/plugins/glusterfs/glusterfs.c
|
|
||||||
--- uwsgi-2.0.16/plugins/glusterfs/glusterfs.c.glfs 2018-04-03 14:35:48.099323330 +0200
|
|
||||||
+++ uwsgi-2.0.16/plugins/glusterfs/glusterfs.c 2018-04-03 14:35:07.573068567 +0200
|
|
||||||
@@ -1,5 +1,5 @@
|
|
||||||
#include <uwsgi.h>
|
|
||||||
-#include <api/glfs.h>
|
|
||||||
+#include <glusterfs/api/glfs.h>
|
|
||||||
|
|
||||||
extern struct uwsgi_server uwsgi;
|
|
||||||
|
|
92
uwsgi.init
92
uwsgi.init
|
@ -1,92 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# uwsgi - this script starts and stops the uwsgi emperor
|
|
||||||
#
|
|
||||||
# chkconfig: - 85 15
|
|
||||||
# description: Fast, self-healing, application container server
|
|
||||||
# processname: uwsgi
|
|
||||||
# config: /etc/uwsgi.ini
|
|
||||||
# config: /etc/uwsgi.d
|
|
||||||
|
|
||||||
# Source function library.
|
|
||||||
. /etc/rc.d/init.d/functions
|
|
||||||
|
|
||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
||||||
PROG=/usr/sbin/uwsgi
|
|
||||||
OWNER=uwsgi
|
|
||||||
NAME=uwsgi
|
|
||||||
DESC="Fast, self-healing, application container server"
|
|
||||||
DAEMON_OPTS="--ini /etc/uwsgi.ini --daemonize /var/log/uwsgi.log"
|
|
||||||
|
|
||||||
[ -f /etc/sysconfig/uwsgi ] && . /etc/sysconfig/uwsgi
|
|
||||||
|
|
||||||
lockfile=/var/lock/subsys/uwsgi
|
|
||||||
|
|
||||||
start () {
|
|
||||||
echo -n "Starting $NAME $DESC: "
|
|
||||||
daemon $PROG $DAEMON_OPTS
|
|
||||||
retval=$?
|
|
||||||
echo
|
|
||||||
[ $retval -eq 0 ] && touch $lockfile
|
|
||||||
return $retval
|
|
||||||
}
|
|
||||||
|
|
||||||
stop () {
|
|
||||||
echo -n "Stopping $NAME $DESC: "
|
|
||||||
# uWSGI docs say INT is a gentler way to stop
|
|
||||||
killproc $PROG -INT
|
|
||||||
retval=$?
|
|
||||||
echo
|
|
||||||
[ $retval -eq 0 ] && rm -f $lockfile
|
|
||||||
return $retval
|
|
||||||
}
|
|
||||||
|
|
||||||
reload () {
|
|
||||||
echo "Reloading $NAME"
|
|
||||||
killproc $PROG -HUP
|
|
||||||
RETVAL=$?
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
restart () {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
rh_status () {
|
|
||||||
status $PROG
|
|
||||||
}
|
|
||||||
|
|
||||||
rh_status_q() {
|
|
||||||
rh_status >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
rh_status_q && exit 0
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
rh_status_q || exit 0
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
rh_status_q || exit 7
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
rh_status
|
|
||||||
;;
|
|
||||||
condrestart|try-restart)
|
|
||||||
rh_status_q || exit 0
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|restart|condrestart|try-restart|reload|status}" >&2
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
|
@ -1,16 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=uWSGI Emperor Service
|
|
||||||
After=syslog.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
EnvironmentFile=-/etc/sysconfig/uwsgi
|
|
||||||
ExecStart=/usr/sbin/uwsgi --ini /etc/uwsgi.ini
|
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
|
||||||
KillSignal=SIGINT
|
|
||||||
Restart=always
|
|
||||||
Type=notify
|
|
||||||
StandardError=syslog
|
|
||||||
NotifyAccess=all
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
2247
uwsgi.spec
2247
uwsgi.spec
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
||||||
d /run/uwsgi 0775 uwsgi uwsgi
|
|
|
@ -1,31 +0,0 @@
|
||||||
diff --git a/plugins/lua/uwsgiplugin.py b/plugins/lua/uwsgiplugin.py
|
|
||||||
index 8aaa95b..d0e3cd0 100644
|
|
||||||
--- a/plugins/lua/uwsgiplugin.py
|
|
||||||
+++ b/plugins/lua/uwsgiplugin.py
|
|
||||||
@@ -3,7 +3,7 @@ import os,sys
|
|
||||||
LUAINC = os.environ.get('UWSGICONFIG_LUAINC')
|
|
||||||
LUALIB = os.environ.get('UWSGICONFIG_LUALIB')
|
|
||||||
LUALIBPATH = os.environ.get('UWSGICONFIG_LUALIBPATH')
|
|
||||||
-LUAPC = os.environ.get('UWSGICONFIG_LUAPC', 'lua5.1')
|
|
||||||
+LUAPC = os.environ.get('UWSGICONFIG_LUAPC', 'lua')
|
|
||||||
|
|
||||||
# we LUAINC/LUALIB/LUALIBPATH override the LUAPC for backwards compat
|
|
||||||
if LUAINC:
|
|
||||||
@@ -12,7 +12,7 @@ else:
|
|
||||||
try:
|
|
||||||
CFLAGS = os.popen('pkg-config --cflags %s' % LUAPC).read().rstrip().split()
|
|
||||||
except:
|
|
||||||
- CFLAGS = ['-I/usr/include/lua5.1']
|
|
||||||
+ CFLAGS = ['-I/usr/include/lua']
|
|
||||||
|
|
||||||
if LUALIB:
|
|
||||||
LIBS = ['-l%s' % LUALIB]
|
|
||||||
@@ -20,7 +20,7 @@ else:
|
|
||||||
try:
|
|
||||||
LIBS = os.popen('pkg-config --libs %s' % LUAPC).read().rstrip().split()
|
|
||||||
except:
|
|
||||||
- LIBS = ['-llua5.1']
|
|
||||||
+ LIBS = ['-llua']
|
|
||||||
|
|
||||||
if LUALIBPATH:
|
|
||||||
LDFLAGS = ['-L%s' % LUALIBPATH]
|
|
|
@ -1,269 +0,0 @@
|
||||||
From 83752e472c35632174534763dffd312fc120a429 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?=
|
|
||||||
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?=
|
|
||||||
<weirdcarrotmonster@gmail.com>
|
|
||||||
Date: Fri, 10 Apr 2015 22:56:59 +0400
|
|
||||||
Subject: [PATCH 1/3] Updated GridFS plugin to work with legacy
|
|
||||||
mongo-cxx-driver version 1.0.0
|
|
||||||
|
|
||||||
---
|
|
||||||
plugins/gridfs/gridfs.cc | 53 +++++++++++++++++++++++++++++++++----------
|
|
||||||
plugins/gridfs/uwsgiplugin.py | 7 +++---
|
|
||||||
2 files changed, 45 insertions(+), 15 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/plugins/gridfs/gridfs.cc b/plugins/gridfs/gridfs.cc
|
|
||||||
index d11451a..81ff0d9 100644
|
|
||||||
--- a/plugins/gridfs/gridfs.cc
|
|
||||||
+++ b/plugins/gridfs/gridfs.cc
|
|
||||||
@@ -1,3 +1,7 @@
|
|
||||||
+#include <memory>
|
|
||||||
+#include <vector>
|
|
||||||
+#include <cstring>
|
|
||||||
+
|
|
||||||
#include <uwsgi.h>
|
|
||||||
|
|
||||||
#include <client/dbclient.h>
|
|
||||||
@@ -7,6 +11,7 @@ struct uwsgi_gridfs_mountpoint {
|
|
||||||
char *mountpoint;
|
|
||||||
uint16_t mountpoint_len;
|
|
||||||
char *server;
|
|
||||||
+ char *replica;
|
|
||||||
char *db;
|
|
||||||
char *timeout_str;
|
|
||||||
int timeout;
|
|
||||||
@@ -21,6 +26,7 @@ struct uwsgi_gridfs_mountpoint {
|
|
||||||
uint16_t prefix_len;
|
|
||||||
char *username;
|
|
||||||
char *password;
|
|
||||||
+ std::vector<mongo::HostAndPort> servers;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct uwsgi_gridfs {
|
|
||||||
@@ -38,33 +44,44 @@ extern struct uwsgi_server uwsgi;
|
|
||||||
extern struct uwsgi_plugin gridfs_plugin;
|
|
||||||
|
|
||||||
static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_mountpoint *ugm, char *itemname, int need_free) {
|
|
||||||
-
|
|
||||||
try {
|
|
||||||
- mongo::scoped_ptr<mongo::ScopedDbConnection> conn( mongo::ScopedDbConnection::getScopedDbConnection(ugm->server, ugm->timeout) );
|
|
||||||
+ std::unique_ptr<mongo::DBClientBase> conn;
|
|
||||||
+
|
|
||||||
+ if (ugm->replica) {
|
|
||||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientReplicaSet(ugm->replica, ugm->servers));
|
|
||||||
+ dynamic_cast<mongo::DBClientReplicaSet *>(conn.get())->connect();
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientConnection());
|
|
||||||
+ dynamic_cast<mongo::DBClientConnection *>(conn.get())->connect(ugm->server);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
try {
|
|
||||||
if (ugm->username && ugm->password) {
|
|
||||||
std::string errmsg;
|
|
||||||
- if ((*conn).conn().auth(ugm->db, ugm->username, ugm->password, errmsg)) {
|
|
||||||
+ if (!conn->auth(ugm->db, ugm->username, ugm->password, errmsg)) {
|
|
||||||
uwsgi_log("[uwsgi-gridfs]: %s\n", errmsg.c_str());
|
|
||||||
- (*conn).done();
|
|
||||||
uwsgi_403(wsgi_req);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- mongo::GridFS gridfs((*conn).conn(), ugm->db);
|
|
||||||
- mongo::GridFile gfile = gridfs.findFile(itemname);
|
|
||||||
+ mongo::GridFS gridfs((*conn.get()), ugm->db);
|
|
||||||
+ mongo::GridFile gfile = gridfs.findFileByName(itemname);
|
|
||||||
+
|
|
||||||
if (need_free) {
|
|
||||||
free(itemname);
|
|
||||||
itemname = NULL;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (!gfile.exists()) {
|
|
||||||
- (*conn).done();
|
|
||||||
uwsgi_404(wsgi_req);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
uwsgi_response_prepare_headers(wsgi_req, (char *)"200 OK", 6);
|
|
||||||
// first get the content_type (if possibile)
|
|
||||||
std::string filename = gfile.getFilename();
|
|
||||||
+
|
|
||||||
if (!ugm->no_mime) {
|
|
||||||
size_t mime_type_len = 0;
|
|
||||||
char *mime_type = uwsgi_get_mime_type((char *)filename.c_str(), filename.length(), &mime_type_len);
|
|
||||||
@@ -72,11 +89,13 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
|
||||||
uwsgi_response_add_content_type(wsgi_req, mime_type, mime_type_len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (ugm->orig_filename) {
|
|
||||||
char *filename_header = uwsgi_concat3((char *)"inline; filename=\"", (char *)filename.c_str(), (char *)"\"");
|
|
||||||
uwsgi_response_add_header(wsgi_req, (char *)"Content-Disposition", 19, filename_header, 19 + filename.length());
|
|
||||||
free(filename_header);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
uwsgi_response_add_content_length(wsgi_req, gfile.getContentLength());
|
|
||||||
|
|
||||||
char http_last_modified[49];
|
|
||||||
@@ -90,7 +109,7 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
|
||||||
char *etag = uwsgi_concat3((char *)"\"", (char *)g_md5.c_str(), (char *)"\"");
|
|
||||||
uwsgi_response_add_header(wsgi_req, (char *)"ETag", 4, etag, 2+g_md5.length());
|
|
||||||
free(etag);
|
|
||||||
- }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ugm->md5) {
|
|
||||||
@@ -106,22 +125,20 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
|
||||||
int i;
|
|
||||||
for(i=0;i<nc;i++) {
|
|
||||||
mongo::GridFSChunk gchunk = gfile.getChunk(i);
|
|
||||||
- int chunk_len = 0;
|
|
||||||
+ int chunk_len = 0;
|
|
||||||
const char *chunk = gchunk.data(chunk_len);
|
|
||||||
uwsgi_response_write_body_do(wsgi_req, (char *) chunk, chunk_len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- (*conn).done();
|
|
||||||
}
|
|
||||||
catch ( mongo::DBException &e ) {
|
|
||||||
uwsgi_log("[uwsgi-gridfs]: %s\n", e.what());
|
|
||||||
- (*conn).done();
|
|
||||||
if (need_free && itemname) {
|
|
||||||
free(itemname);
|
|
||||||
itemname = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- }
|
|
||||||
+ }
|
|
||||||
catch ( mongo::DBException &e ) {
|
|
||||||
uwsgi_log("[uwsgi-gridfs]: %s\n", e.what());
|
|
||||||
if (need_free && itemname) {
|
|
||||||
@@ -137,6 +154,7 @@ static struct uwsgi_gridfs_mountpoint *uwsgi_gridfs_add_mountpoint(char *arg, si
|
|
||||||
if (uwsgi_kvlist_parse(arg, arg_len, ',', '=',
|
|
||||||
"mountpoint", &ugm->mountpoint,
|
|
||||||
"server", &ugm->server,
|
|
||||||
+ "replica", &ugm->replica,
|
|
||||||
"db", &ugm->db,
|
|
||||||
"prefix", &ugm->prefix,
|
|
||||||
"no_mime", &ugm->no_mime,
|
|
||||||
@@ -185,6 +203,16 @@ static struct uwsgi_gridfs_mountpoint *uwsgi_gridfs_add_mountpoint(char *arg, si
|
|
||||||
ugm->itemname_len = strlen(ugm->itemname);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (ugm->replica) {
|
|
||||||
+ std::string buffer(ugm->server);
|
|
||||||
+
|
|
||||||
+ size_t pos;
|
|
||||||
+ while ((pos = buffer.find(",")) != std::string::npos) {
|
|
||||||
+ ugm->servers.push_back(mongo::HostAndPort(buffer.substr(0, pos)));
|
|
||||||
+ buffer.erase(0, pos + 1);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return ugm;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -236,6 +264,7 @@ extern "C" int uwsgi_gridfs_request(struct wsgi_request *wsgi_req) {
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" void uwsgi_gridfs_mount() {
|
|
||||||
+ mongo::client::initialize();
|
|
||||||
if (!uwsgi.skip_atexit) {
|
|
||||||
uwsgi_log("*** WARNING libmongoclient could have a bug with atexit() hooks, if you get segfault on end/reload, add --skip-atexit ***\n");
|
|
||||||
}
|
|
||||||
diff --git a/plugins/gridfs/uwsgiplugin.py b/plugins/gridfs/uwsgiplugin.py
|
|
||||||
index a2163d7..61567bc 100644
|
|
||||||
--- a/plugins/gridfs/uwsgiplugin.py
|
|
||||||
+++ b/plugins/gridfs/uwsgiplugin.py
|
|
||||||
@@ -1,16 +1,17 @@
|
|
||||||
import os
|
|
||||||
|
|
||||||
-NAME='gridfs'
|
|
||||||
+NAME = 'gridfs'
|
|
||||||
|
|
||||||
-CFLAGS = ['-I/usr/include/mongo','-I/usr/local/include/mongo']
|
|
||||||
+CFLAGS = ['-I/usr/include/mongo', '-I/usr/local/include/mongo', '-std=c++11', '-Wno-error']
|
|
||||||
LDFLAGS = []
|
|
||||||
|
|
||||||
LIBS = []
|
|
||||||
-if not 'UWSGI_MONGODB_NOLIB' in os.environ:
|
|
||||||
+if 'UWSGI_MONGODB_NOLIB' not in os.environ:
|
|
||||||
LIBS.append('-lmongoclient')
|
|
||||||
LIBS.append('-lstdc++')
|
|
||||||
LIBS.append('-lboost_thread')
|
|
||||||
LIBS.append('-lboost_system')
|
|
||||||
LIBS.append('-lboost_filesystem')
|
|
||||||
+ LIBS.append('-lboost_regex')
|
|
||||||
|
|
||||||
GCC_LIST = ['plugin', 'gridfs.cc']
|
|
||||||
--
|
|
||||||
2.1.0
|
|
||||||
|
|
||||||
|
|
||||||
From 932caed82a2338e0f1bd5d68833ca5c31360b882 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?=
|
|
||||||
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?=
|
|
||||||
<weirdcarrotmonster@gmail.com>
|
|
||||||
Date: Fri, 10 Apr 2015 23:07:41 +0400
|
|
||||||
Subject: [PATCH 2/3] Fixed server list parsing
|
|
||||||
|
|
||||||
---
|
|
||||||
plugins/gridfs/gridfs.cc | 4 ++++
|
|
||||||
1 file changed, 4 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/plugins/gridfs/gridfs.cc b/plugins/gridfs/gridfs.cc
|
|
||||||
index 81ff0d9..f58d976 100644
|
|
||||||
--- a/plugins/gridfs/gridfs.cc
|
|
||||||
+++ b/plugins/gridfs/gridfs.cc
|
|
||||||
@@ -211,6 +211,10 @@ static struct uwsgi_gridfs_mountpoint *uwsgi_gridfs_add_mountpoint(char *arg, si
|
|
||||||
ugm->servers.push_back(mongo::HostAndPort(buffer.substr(0, pos)));
|
|
||||||
buffer.erase(0, pos + 1);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ if (!ugm->servers.size()) {
|
|
||||||
+ ugm->servers.push_back(mongo::HostAndPort(ugm->server));
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
return ugm;
|
|
||||||
--
|
|
||||||
2.1.0
|
|
||||||
|
|
||||||
|
|
||||||
From a870dbfb0dc4268cbcecf573765338ec5a52f195 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?=
|
|
||||||
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?=
|
|
||||||
<weirdcarrotmonster@gmail.com>
|
|
||||||
Date: Fri, 10 Apr 2015 23:38:38 +0400
|
|
||||||
Subject: [PATCH 3/3] Passing timeout argument to MongoDB connection
|
|
||||||
|
|
||||||
---
|
|
||||||
plugins/gridfs/gridfs.cc | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/plugins/gridfs/gridfs.cc b/plugins/gridfs/gridfs.cc
|
|
||||||
index f58d976..5f7c4ba 100644
|
|
||||||
--- a/plugins/gridfs/gridfs.cc
|
|
||||||
+++ b/plugins/gridfs/gridfs.cc
|
|
||||||
@@ -48,14 +48,14 @@ static void uwsgi_gridfs_do(struct wsgi_request *wsgi_req, struct uwsgi_gridfs_m
|
|
||||||
std::unique_ptr<mongo::DBClientBase> conn;
|
|
||||||
|
|
||||||
if (ugm->replica) {
|
|
||||||
- conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientReplicaSet(ugm->replica, ugm->servers));
|
|
||||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientReplicaSet(ugm->replica, ugm->servers, ugm->timeout));
|
|
||||||
dynamic_cast<mongo::DBClientReplicaSet *>(conn.get())->connect();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
- conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientConnection());
|
|
||||||
+ conn = std::unique_ptr<mongo::DBClientBase> (new mongo::DBClientConnection(true, 0, ugm->timeout));
|
|
||||||
dynamic_cast<mongo::DBClientConnection *>(conn.get())->connect(ugm->server);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
try {
|
|
||||||
if (ugm->username && ugm->password) {
|
|
||||||
std::string errmsg;
|
|
||||||
--
|
|
||||||
2.1.0
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
diff -Naurp a/plugins/mono/uwsgiplugin.py b/plugins/mono/uwsgiplugin.py
|
|
||||||
--- a/plugins/mono/uwsgiplugin.py 2016-10-03 03:16:59.000000000 -0500
|
|
||||||
+++ b/plugins/mono/uwsgiplugin.py 2017-03-20 16:18:54.917935286 -0500
|
|
||||||
@@ -1,9 +1,9 @@
|
|
||||||
import os
|
|
||||||
NAME='mono'
|
|
||||||
|
|
||||||
-CFLAGS = os.popen('pkg-config --cflags mono-2').read().rstrip().split()
|
|
||||||
+CFLAGS = os.popen('pkg-config --cflags mono-2 glib-2.0').read().rstrip().split()
|
|
||||||
LDFLAGS = []
|
|
||||||
-LIBS = os.popen('pkg-config --libs mono-2').read().rstrip().split()
|
|
||||||
+LIBS = os.popen('pkg-config --libs mono-2 glib-2.0').read().rstrip().split()
|
|
||||||
GCC_LIST = ['mono_plugin']
|
|
||||||
|
|
||||||
if os.uname()[0] == 'Darwin':
|
|
|
@ -1,61 +1,42 @@
|
||||||
diff --git a/plugins/jvm/uwsgiplugin.py b/plugins/jvm/uwsgiplugin.py
|
diff -r 655aa0eeb778 plugins/php/uwsgiplugin.py
|
||||||
index f39ad63..d9e95bb 100644
|
--- a/plugins/php/uwsgiplugin.py Tue Jun 26 07:59:35 2012 +0200
|
||||||
--- a/plugins/jvm/uwsgiplugin.py
|
+++ b/plugins/php/uwsgiplugin.py Tue Jun 26 23:47:16 2012 -0700
|
||||||
+++ b/plugins/jvm/uwsgiplugin.py
|
@@ -22,7 +22,6 @@
|
||||||
@@ -65,11 +65,6 @@ if "-framework JavaVM" in JVM_LIBPATH:
|
LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split()
|
||||||
|
|
||||||
GCC_LIST = ['jvm_plugin']
|
|
||||||
|
|
||||||
-if 'LD_RUN_PATH' in os.environ:
|
|
||||||
- os.environ['LD_RUN_PATH'] += ':' + JVM_LIBPATH[0][2:]
|
|
||||||
-else:
|
|
||||||
- os.environ['LD_RUN_PATH'] = JVM_LIBPATH[0][2:]
|
|
||||||
-
|
|
||||||
def post_build(config):
|
|
||||||
if os.system("javac %s/plugins/jvm/uwsgi.java" % os.getcwd()) != 0:
|
|
||||||
os._exit(1)
|
|
||||||
diff --git a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
|
|
||||||
index d930c44..273cdde 100644
|
|
||||||
--- a/plugins/php/uwsgiplugin.py
|
|
||||||
+++ b/plugins/php/uwsgiplugin.py
|
|
||||||
@@ -19,7 +19,6 @@ LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split()
|
|
||||||
|
|
||||||
if ld_run_path:
|
if ld_run_path:
|
||||||
LDFLAGS.append('-L%s' % ld_run_path)
|
LDFLAGS.append('-L%s' % ld_run_path)
|
||||||
- os.environ['LD_RUN_PATH'] = ld_run_path
|
- os.environ['LD_RUN_PATH'] = ld_run_path
|
||||||
|
|
||||||
LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp' + php_version]
|
LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp5']
|
||||||
|
|
||||||
diff --git a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py
|
diff -r 655aa0eeb778 plugins/python/uwsgiplugin.py
|
||||||
index 843876f..69ae68f 100644
|
--- a/plugins/python/uwsgiplugin.py Tue Jun 26 07:59:35 2012 +0200
|
||||||
--- a/plugins/python/uwsgiplugin.py
|
+++ b/plugins/python/uwsgiplugin.py Tue Jun 26 23:47:16 2012 -0700
|
||||||
+++ b/plugins/python/uwsgiplugin.py
|
@@ -20,10 +20,8 @@
|
||||||
@@ -58,8 +58,6 @@ if not 'UWSGI_PYTHON_NOLIB' in os.environ:
|
|
||||||
LDFLAGS.append("-L%s" % libdir)
|
|
||||||
LDFLAGS.append("-Wl,-rpath,%s" % libdir)
|
|
||||||
|
|
||||||
- os.environ['LD_RUN_PATH'] = "%s" % libdir
|
|
||||||
-
|
|
||||||
LIBS.append('-lpython%s' % get_python_version())
|
|
||||||
else:
|
else:
|
||||||
LIBS = []
|
try:
|
||||||
diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
|
LDFLAGS.append("-L%s" % sysconfig.get_config_var('LIBDIR'))
|
||||||
index 210b28e..06f5edd 100644
|
- os.environ['LD_RUN_PATH'] = "%s" % (sysconfig.get_config_var('LIBDIR'))
|
||||||
--- a/plugins/rack/uwsgiplugin.py
|
except:
|
||||||
+++ b/plugins/rack/uwsgiplugin.py
|
LDFLAGS.append("-L%s/lib" % sysconfig.PREFIX)
|
||||||
@@ -46,7 +46,6 @@ LIBS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LIBS']\""
|
- os.environ['LD_RUN_PATH'] = "%s/lib" % sysconfig.PREFIX
|
||||||
|
|
||||||
if has_shared == 'yes':
|
|
||||||
LDFLAGS.append('-L' + libpath )
|
version = sysconfig.get_config_var('VERSION')
|
||||||
- os.environ['LD_RUN_PATH'] = libpath
|
diff -r 655aa0eeb778 plugins/rack/uwsgiplugin.py
|
||||||
LIBS.append(os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip())
|
--- a/plugins/rack/uwsgiplugin.py Tue Jun 26 07:59:35 2012 +0200
|
||||||
else:
|
+++ b/plugins/rack/uwsgiplugin.py Tue Jun 26 23:47:16 2012 -0700
|
||||||
rubylibdir = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['rubylibdir']\"").read().rstrip()
|
@@ -38,6 +38,5 @@
|
||||||
diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
|
|
||||||
index ecea48d..4f35984 100644
|
libpath = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['libdir']\"" % rbconfig).read().rstrip()
|
||||||
--- a/plugins/ruby19/uwsgiplugin.py
|
LDFLAGS.append('-L' + libpath )
|
||||||
+++ b/plugins/ruby19/uwsgiplugin.py
|
-os.environ['LD_RUN_PATH'] = libpath
|
||||||
@@ -40,6 +40,5 @@ LDFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LDFLAG
|
LIBS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip().split()
|
||||||
|
|
||||||
|
diff -r 655aa0eeb778 plugins/ruby19/uwsgiplugin.py
|
||||||
|
--- a/plugins/ruby19/uwsgiplugin.py Tue Jun 26 07:59:35 2012 +0200
|
||||||
|
+++ b/plugins/ruby19/uwsgiplugin.py Tue Jun 26 23:47:16 2012 -0700
|
||||||
|
@@ -40,6 +40,5 @@
|
||||||
|
|
||||||
libpath = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['libdir']\"" % rbconfig).read().rstrip()
|
libpath = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['libdir']\"" % rbconfig).read().rstrip()
|
||||||
LDFLAGS.append('-L' + libpath )
|
LDFLAGS.append('-L' + libpath )
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
|
|
||||||
index 2375bc9..b908417 100644
|
|
||||||
--- a/plugins/rack/uwsgiplugin.py
|
|
||||||
+++ b/plugins/rack/uwsgiplugin.py
|
|
||||||
@@ -10,13 +10,14 @@ except:
|
|
||||||
rbconfig = 'Config'
|
|
||||||
|
|
||||||
version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
|
|
||||||
-v = version.split('.')
|
|
||||||
|
|
||||||
GCC_LIST = ['rack_plugin', 'rack_api']
|
|
||||||
|
|
||||||
-if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
|
|
||||||
+if version >= '1.9':
|
|
||||||
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
|
|
||||||
CFLAGS.append('-DRUBY19')
|
|
||||||
+ if version >= '2.0':
|
|
||||||
+ CFLAGS.append('-DRUBY20')
|
|
||||||
CFLAGS.append('-Wno-unused-parameter')
|
|
||||||
rbconfig = 'RbConfig'
|
|
||||||
else:
|
|
||||||
diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
|
|
||||||
index 4f35984..156018f 100644
|
|
||||||
--- a/plugins/ruby19/uwsgiplugin.py
|
|
||||||
+++ b/plugins/ruby19/uwsgiplugin.py
|
|
||||||
@@ -10,13 +10,14 @@ except:
|
|
||||||
rbconfig = 'Config'
|
|
||||||
|
|
||||||
version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
|
|
||||||
-v = version.split('.')
|
|
||||||
|
|
||||||
GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api']
|
|
||||||
|
|
||||||
-if v[0] == '1' and v[1] == '9':
|
|
||||||
+if version >= '1.9':
|
|
||||||
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
|
|
||||||
CFLAGS.append('-DRUBY19')
|
|
||||||
+ if version >= '2.0':
|
|
||||||
+ CFLAGS.append('-DRUBY20')
|
|
||||||
CFLAGS.append('-Wno-unused-parameter')
|
|
||||||
rbconfig = 'RbConfig'
|
|
||||||
else:
|
|
|
@ -1,16 +1,11 @@
|
||||||
diff --git a/uwsgiconfig.py b/uwsgiconfig.py
|
diff -r 9768d97e85de uwsgiconfig.py
|
||||||
index 59393e1..e43f092 100644
|
--- a/uwsgiconfig.py Sun May 20 20:51:46 2012 +0200
|
||||||
--- a/uwsgiconfig.py
|
+++ b/uwsgiconfig.py Tue Jun 26 22:33:08 2012 -0700
|
||||||
+++ b/uwsgiconfig.py
|
@@ -899,7 +899,7 @@
|
||||||
@@ -1422,10 +1422,7 @@ def build_plugin(path, uc, cflags, ldflags, libs, name = None):
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
- if uc:
|
- plugin_dest = uc.get('plugin_dir') + '/' + name + '_plugin'
|
||||||
- plugin_dest = uc.get('plugin_build_dir', uc.get('plugin_dir')) + '/' + name + '_plugin'
|
|
||||||
- else:
|
|
||||||
- plugin_dest = name + '_plugin'
|
|
||||||
+ plugin_dest = name + '_plugin'
|
+ plugin_dest = name + '_plugin'
|
||||||
|
|
||||||
shared_flag = '-shared'
|
shared_flag = '-shared'
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
diff -Naurp a/plugins/v8/uwsgiplugin.py b/plugins/v8/uwsgiplugin.py
|
|
||||||
--- a/plugins/v8/uwsgiplugin.py 2016-05-12 12:37:49.000000000 -0500
|
|
||||||
+++ b/plugins/v8/uwsgiplugin.py 2016-08-01 22:56:50.969785338 -0500
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
import os
|
|
||||||
NAME='v8'
|
|
||||||
|
|
||||||
-CFLAGS = ['-Wno-deprecated-declarations']
|
|
||||||
+CFLAGS = ['-Wno-deprecated-declarations', '-I/usr/include/v8-3.14']
|
|
||||||
LDFLAGS = []
|
|
||||||
LIBS = ['-lstdc++', '-lv8']
|
|
||||||
engine = os.environ.get('UWSGICONFIG_V8_ENGINE', '')
|
|
Loading…
Reference in New Issue