summaryrefslogtreecommitdiff
path: root/www/lighttpd/files/patch-src-connections.c
diff options
context:
space:
mode:
Diffstat (limited to 'www/lighttpd/files/patch-src-connections.c')
-rw-r--r--www/lighttpd/files/patch-src-connections.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/www/lighttpd/files/patch-src-connections.c b/www/lighttpd/files/patch-src-connections.c
new file mode 100644
index 000000000000..96cf9698fc7d
--- /dev/null
+++ b/www/lighttpd/files/patch-src-connections.c
@@ -0,0 +1,47 @@
+--- src/connections.c.orig
++++ src/connections.c
+@@ -310,6 +310,8 @@ static int connection_handle_read_ssl(server *srv, connection *con) {
+ /* the other end close the connection -> KEEP-ALIVE */
+
+ return -2;
++ } else {
++ joblist_append(srv, con);
+ }
+
+ return 0;
+@@ -320,6 +322,7 @@ static int connection_handle_read_ssl(server *srv, connection *con) {
+ #endif
+ }
+
++/* 0: everything ok, -1: error, -2: con closed */
+ static int connection_handle_read(server *srv, connection *con) {
+ int len;
+ buffer *b;
+@@ -1180,15 +1183,20 @@ static handler_t connection_handle_fdevent(void *s, void *context, int revents)
+
+ joblist_append(srv, con);
+
+- if (revents & FDEVENT_IN) {
+- con->is_readable = 1;
+-#if 0
+- log_error_write(srv, __FILE__, __LINE__, "sd", "read-wait - done", con->fd);
+-#endif
+- }
+- if (revents & FDEVENT_OUT) {
+- con->is_writable = 1;
+- /* we don't need the event twice */
++ if (con->conf.is_ssl) {
++ /* ssl may read and write for both reads and writes */
++ if (revents & (FDEVENT_IN | FDEVENT_OUT)) {
++ con->is_readable = 1;
++ con->is_writable = 1;
++ }
++ } else {
++ if (revents & FDEVENT_IN) {
++ con->is_readable = 1;
++ }
++ if (revents & FDEVENT_OUT) {
++ con->is_writable = 1;
++ /* we don't need the event twice */
++ }
+ }