osx fixes

This commit is contained in:
Roberta Giordano
2013-02-04 13:08:16 +01:00
parent f117f404fc
commit 67544158d9
2 changed files with 1 additions and 38 deletions
+1 -1
View File
@@ -324,7 +324,7 @@ void async_loop() {
/* re-set blocking socket */
int arg = uwsgi_sock->arg;
arg &= (~O_NONBLOCK);
if (fcntl(uwsgi.wsgi_req->poll.fd, F_SETFL, arg) < 0) {
if (fcntl(uwsgi.wsgi_req->fd, F_SETFL, arg) < 0) {
uwsgi_error("fcntl()");
uwsgi.async_queue_unused_ptr++;
uwsgi.async_queue_unused[uwsgi.async_queue_unused_ptr] = uwsgi.wsgi_req;
-37
View File
@@ -287,43 +287,6 @@ int uwsgi_read_response(int fd, struct uwsgi_header *uh, int timeout, char **buf
return ret;
}
int uwsgi_receive_request(int queue, struct wsgi_request *wsgi_req, int timeout) {
int rlen;
int status = UWSGI_AGAIN;
if (!timeout)
timeout = 1;
while (status == UWSGI_AGAIN) {
//rlen = poll(&wsgi_req->poll, 1, timeout * 1000);
if (rlen < 0) {
uwsgi_error("poll()");
exit(1);
}
else if (rlen == 0) {
uwsgi_log("timeout. skip request.\n");
//close(upoll->fd);
return 0;
}
if (wsgi_req->socket) {
status = wsgi_req->socket->proto(wsgi_req);
}
else {
status = uwsgi_proto_uwsgi_parser(wsgi_req);
}
if (status < 0) {
if (status == -1)
uwsgi_log_verbose("error parsing request\n");
else if (status == -2)
uwsgi_log_verbose("open-close packet (ping/check) received\n");
//close(upoll->fd);
return 0;
}
}
return 1;
}
int uwsgi_parse_array(char *buffer, uint16_t size, char **argv, uint16_t argvs[], uint8_t * argc) {
char *ptrbuf, *bufferend;