Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@467 5dc97367-97…

…f1-0310-9951-d761b3857238
  • Loading branch information...
commit ba212a43fd1b67d18af9d23e5534596a61e40adc 1 parent 483759d
@alobbs alobbs authored
View
8 ChangeLog
@@ -1,3 +1,11 @@
+2006-11-20 Alvaro Lopez Ortega <alvaro@alobbs.com>
+
+ * cherokee/handler_scgi.c (connect_to_server),
+ cherokee/fcgi_manager.c (reconnect), cherokee/handler_fcgi.c
+ (connect_to_server): Socket connecting the server with the
+ application server must be turned non-blocking right after being
+ accepted. Fixed.
+
2006-11-16 Alvaro Lopez Ortega <alvaro@alobbs.com>
* cherokee/socket.h: Inclusion of arpa/inet.h has been moved after
View
2  cherokee/fcgi_manager.c
@@ -189,6 +189,8 @@ reconnect (cherokee_fcgi_manager_t *mgr, cherokee_thread_t *thd, cherokee_boolea
cherokee_fd_set_nonblocking (mgr->socket.socket);
TRACE (ENTRIES, "Connected sucessfully try=%d, fd=%d\n", try, mgr->socket.socket);
+
+ cherokee_fd_set_nonblocking (SOCKET_FD(&mgr->socket));
return ret_ok;
}
View
19 cherokee/handler_fcgi.c
@@ -165,7 +165,7 @@ read_from_fcgi (cherokee_handler_cgi_base_t *cgi, cherokee_buffer_t *buffer)
ret_t ret;
size_t read = 0;
cherokee_handler_fcgi_t *fcgi = HDL_FCGI(cgi);
-
+
ret = cherokee_socket_read (&fcgi->socket, &fcgi->write_buffer, DEFAULT_READ_SIZE, &read);
switch (ret) {
@@ -279,6 +279,8 @@ cherokee_handler_fcgi_new (cherokee_handler_t **hdl, void *cnt, cherokee_module_
n->post_len = 0;
cherokee_socket_init (&n->socket);
+ cherokee_socket_set_nodelay (&n->socket);
+
cherokee_buffer_init (&n->write_buffer);
cherokee_buffer_ensure_size (&n->write_buffer, 512);
@@ -520,6 +522,8 @@ connect_to_server (cherokee_handler_fcgi_t *hdl)
}
TRACE (ENTRIES, "Connected sucessfully try=%d, fd=%d\n", try, hdl->socket.socket);
+
+ cherokee_fd_set_nonblocking (SOCKET_FD(&hdl->socket));
return ret_ok;
}
@@ -532,9 +536,18 @@ do_send (cherokee_handler_fcgi_t *hdl, cherokee_buffer_t *buffer)
cherokee_connection_t *conn = HANDLER_CONN(hdl);
ret = cherokee_socket_write (&hdl->socket, buffer, &written);
- if (ret != ret_ok) {
+ printf ("send ret %d\n", ret);
+ switch (ret) {
+ case ret_ok:
+ return ret_ok;
+ case ret_eagain:
+ cherokee_thread_deactive_to_polling (HANDLER_THREAD(hdl), HANDLER_CONN(hdl),
+ hdl->socket.socket, 1, false);
+ return ret_eagain;
+ default:
+ printf ("Error? %d\n", ret);
conn->error_code = http_bad_gateway;
- return ret;
+ return ret_error;
}
cherokee_buffer_move_to_begin (buffer, written);
View
2  cherokee/handler_scgi.c
@@ -278,6 +278,8 @@ connect_to_server (cherokee_handler_scgi_t *hdl)
}
TRACE (ENTRIES, "connected fd=%d\n", hdl->socket.socket);
+
+ cherokee_fd_set_nonblocking (SOCKET_FD(&hdl->socket));
return ret_ok;
}
View
2  configure.in
@@ -25,7 +25,7 @@ dnl Version
m4_define([cherokee_major_version], [0])
m4_define([cherokee_minor_version], [6])
m4_define([cherokee_micro_version], [0])
-m4_define([cherokee_patch_version], [b442])
+m4_define([cherokee_patch_version], [b466])
m4_define([cherokee_version], m4_format('%s.%s.%s%s', cherokee_major_version, cherokee_minor_version, cherokee_micro_version, cherokee_patch_version))
dnl Init autoconf and automake
Please sign in to comment.
Something went wrong with that request. Please try again.