python3 fixes

This commit is contained in:
roberto@arch32
2011-02-16 16:56:51 +01:00
parent 183a109119
commit 393235fbfe
5 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -321,7 +321,7 @@ void fastrouter_loop() {
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
*((int *) CMSG_DATA (cmsg)) = fr_session->fd;
memcpy(CMSG_DATA(cmsg), &fr_session->fd, sizeof(int));
if (sendmsg(fr_session->instance_fd, &msg, 0) < 0) {
uwsgi_error("sendmsg()");
+1 -1
View File
@@ -532,7 +532,7 @@ void http_loop() {
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
*((int *) CMSG_DATA (cmsg)) = uhttp_session->fd;
memcpy(CMSG_DATA(cmsg), &uhttp_session->fd, sizeof(int));
if (sendmsg(uhttp_session->instance_fd, &msg, 0) < 0) {
uwsgi_error("sendmsg()");
+2 -2
View File
@@ -170,7 +170,7 @@ ssize_t uwsgi_send_message(int fd, uint8_t modifier1, uint8_t modifier2, char *m
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
*((int *) CMSG_DATA (cmsg)) = pfd;
memcpy(CMSG_DATA(cmsg), &pfd, sizeof(int));
uwsgi_log("passing fd\n");
cnt = sendmsg(fd, &msg, 0);
@@ -355,7 +355,7 @@ int uwsgi_parse_response(struct pollfd *upoll, int timeout, struct uwsgi_header
// upgrade connection to the new socket
uwsgi_log("upgrading fd %d to ", upoll->fd);
close(upoll->fd);
upoll->fd = *((int *) CMSG_DATA (cmsg));
memcpy(CMSG_DATA(cmsg), &upoll->fd, sizeof(int));
uwsgi_log("%d\n", upoll->fd);
cmsg = CMSG_NXTHDR (&msg, cmsg);
}
+5 -5
View File
@@ -6,22 +6,22 @@ import sys
def monitor1():
while 1:
time.sleep(1)
print "i am the monitor 1"
print("i am the monitor 1")
def monitor2():
while 1:
time.sleep(2)
print "i am the monitor 2"
print sys.modules
print("i am the monitor 2")
print(sys.modules)
def monitor3():
while 1:
time.sleep(5)
print "5 seconds elapsed"
print("5 seconds elapsed")
#reload(fake)
def spawn_my_magic_threads():
print "^^^ spawning magic threads ^^^"
print("^^^ spawning magic threads ^^^")
t = threading.Thread(target=monitor1).start()
t2 = threading.Thread(target=monitor2).start()
t3 = threading.Thread(target=monitor3).start()
+5 -5
View File
@@ -333,8 +333,8 @@ class uConf(object):
self.cflags.append("-DUWSGI_UDP")
if self.get('pcre'):
if self.get('pcre') == 'auto':
pcreconf = spcall('pcre-config --libs')
if self.get('pcre') == 'auto':
pcreconf = spcall('pcre-config --libs')
if pcreconf:
self.libs.append(pcreconf)
pcreconf = spcall("pcre-config --cflags")
@@ -342,9 +342,9 @@ class uConf(object):
self.gcc_list.append('regexp')
self.cflags.append("-DUWSGI_PCRE")
else:
pcreconf = spcall('pcre-config --libs')
if pcreconf is None:
else:
pcreconf = spcall('pcre-config --libs')
if pcreconf is None:
print("*** libpcre headers unavailable. uWSGI build is interrupted. You have to install pcre development package or disable pcre")
sys.exit(1)
else: