OSX fixes

This commit is contained in:
roberto@sirius
2011-06-14 11:26:03 +02:00
parent ca3f56de5c
commit a75833d322
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -497,7 +497,7 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) {
if (uwsgi.reuse_port) {
#ifdef SO_REUSEPORT
if (setsockopt(serverfd, SOL_SOCKET, SO_REUSEPORT, (const void *) &reuse_port, sizeof(int)) < 0) {
if (setsockopt(serverfd, SOL_SOCKET, SO_REUSEPORT, (const void *) &uwsgi.reuse_port, sizeof(int)) < 0) {
uwsgi_error("setsockopt()");
uwsgi_nuclear_blast();
}
+4 -3
View File
@@ -5,8 +5,9 @@ def application(env, start_response):
start_response('200 Ok', [('Content-type', 'text/plain')])
#for x in env['wsgi.input']:
# yield x
body = env['wsgi.input'].readline()
print body
body = env['wsgi.input'].read(int(env['CONTENT_LENGTH']))
body += env['wsgi.input'].readline()
#print body
body += env['wsgi.input'].read(100)
body += env['wsgi.input'].read(100)
body += env['wsgi.input'].read()
@@ -17,7 +18,7 @@ def application(env, start_response):
<form method="POST" enctype="multipart/form-data">
<textarea name="pluto">
</textarea>
<input type="test" name="pippo" />
<input type="file" name="pippo" />
<input type="submit" value="invia" />
</form>
"""
+1 -1
View File
@@ -2392,7 +2392,7 @@ int *uwsgi_attach_fd(int fd, int count, char *code, size_t code_len) {
ret[i] = -1;
}
if ((cmsg->cmsg_len - ((char *)CMSG_DATA(cmsg)- (char *)cmsg)) > (sizeof(int) * (count + 1))) {
if ((size_t) (cmsg->cmsg_len - ((char *)CMSG_DATA(cmsg)- (char *)cmsg)) > (size_t) (sizeof(int) * (count + 1))) {
uwsgi_log("not enough space for sockets data, consider increasing it\n");
return NULL;
}