added inherit option for buildconf

This commit is contained in:
roberto@storm
2010-12-20 10:09:01 +01:00
parent d7c2856041
commit 2e18db2352
5 changed files with 54 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
[uwsgi]
inherit = unbit
bin_name = ../bin/uwsgi
+13 -1
View File
@@ -239,7 +239,7 @@ struct uwsgi_fmon *event_queue_ack_file_monitor(int id, void hook(char *, uint32
}
else {
items = isize/(sizeof(struct inotify_event));
uwsgi_log("inotify returned %d items\n", items);
//uwsgi_log("inotify returned %d items\n", items);
for(j=0;j<items;j++) {
iie = &bie[j];
for(i=0;i<uwsgi.files_monitored_cnt;i++) {
@@ -271,7 +271,19 @@ struct uwsgi_fmon *event_queue_ack_file_monitor(int id, void hook(char *, uint32
#ifdef UWSGI_EVENT_TIMER_USE_TIMERFD
#ifndef UNBIT
#include <sys/timerfd.h>
#else
static int timerfd_create (clockid_t __clock_id, int __flags) {
return syscall(322, __clock_id, __flags);
}
static int timerfd_settime (int __ufd, int __flags,
__const struct itimerspec *__utmr,
struct itimerspec *__otmr) {
return syscall(325, __ufd, __flags, __utmr, __otmr);
}
#endif
int event_queue_add_timer(int eq, int *id, int sec) {
+4 -1
View File
@@ -320,6 +320,7 @@ void master_loop(char **argv, char **environ) {
if (rlen > 0) {
#ifdef UWSGI_UDP
if (uwsgi.udp_socket && interesting_fd == udp_fd) {
udp_len = sizeof(udp_client);
rlen = recvfrom(udp_fd, uwsgi.wsgi_req->buffer, uwsgi.buffer_size, 0, (struct sockaddr *) &udp_client, &udp_len);
@@ -402,6 +403,8 @@ void master_loop(char **argv, char **environ) {
continue;
}
#endif
//event_queue_ack_timer(fake_timer);
@@ -425,7 +428,7 @@ void master_loop(char **argv, char **environ) {
for(i=0;i<uwsgi.timers_cnt;i++) {
if (uwsgi.timers[i].registered) {
uwsgi_log("%d = %d\n", interesting_fd, uwsgi.timers[i].fd);
//uwsgi_log("%d = %d\n", interesting_fd, uwsgi.timers[i].fd);
if (interesting_fd == uwsgi.timers[i].fd) {
struct uwsgi_timer *ut = event_queue_ack_timer(interesting_fd, NULL);
// now call the file_monitor handler
+20
View File
@@ -48,3 +48,23 @@ struct uidsec_struct {
int memory_errors;
};
// timerfd support
enum
{
TFD_CLOEXEC = 02000000,
#define TFD_CLOEXEC TFD_CLOEXEC
TFD_NONBLOCK = 04000
#define TFD_NONBLOCK TFD_NONBLOCK
};
/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
enum
{
TFD_TIMER_ABSTIME = 1 << 0
#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
};
+14 -1
View File
@@ -151,6 +151,16 @@ class uConf(object):
self.ldflags = os.environ.get("LDFLAGS", "").split()
self.libs = ['-lpthread', '-rdynamic']
# check for inherit option
inherit = self.get('inherit')
if inherit:
iconfig = ConfigParser.ConfigParser()
iconfig.read('buildconf/%s.ini' % inherit)
for opt in iconfig.options('uwsgi'):
if not self.get(opt):
self.set(opt, iconfig.get('uwsgi', opt))
def set(self, key, value):
self.config.set('uwsgi',key, value)
@@ -228,7 +238,10 @@ class uConf(object):
if timer_mode == 'auto':
if uwsgi_os == 'Linux':
(k_base, k_major, k_minor) = uwsgi_os_k.split('.')
k_all = uwsgi_os_k.split('.')
k_base = k_all[0]
k_major = k_all[1]
k_minor = k_all[2]
if int(k_minor) >= 25:
timer_mode = 'timerfd'
else: