if the write is waiting, break the loop.

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@621 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 18 years ago
parent f08537ee87
commit e93ac5407b

@ -213,7 +213,7 @@ static int connection_handle_read(server *srv, connection *con) {
#ifdef USE_OPENSSL
if (srv_sock->is_ssl) {
int r;
int r, ssl_err;
switch ((r = SSL_get_error(con->ssl, len))) {
case SSL_ERROR_WANT_READ:
@ -237,8 +237,15 @@ static int connection_handle_read(server *srv, connection *con) {
/* fall thourgh */
default:
log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
r, ERR_error_string(ERR_get_error(), NULL));
ssl_err = ERR_get_error();
switch(ssl_err) {
case SSL_F_SSL23_GET_CLIENT_HELLO:
/* a unencrypted HTTP request on a HTTPS socket. Do a redirect to the right location */
default:
log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
r, ERR_error_string(ERR_get_error(), NULL));
break;
}
break;
}
} else {

@ -357,7 +357,7 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
if (-1 == mkdir(p->b->ptr, 0700)) {
if (errno != EEXIST) {
log_error_write(srv, __FILE__, __LINE__, "ssss", "creating cache-directory", p->b->ptr, "failed", strerror(errno));
log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cache-directory", p->b, "failed", strerror(errno));
return -1;
}

@ -123,6 +123,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, chunkqueue *c
size_t toSend;
stat_cache_entry *sce = NULL;
int ifd;
int write_wait = 0;
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->data.file.name, &sce)) {
log_error_write(srv, __FILE__, __LINE__, "sb",
@ -162,6 +163,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, chunkqueue *c
if ((r = SSL_write(con->ssl, s, toSend)) <= 0) {
switch ((ssl_r = SSL_get_error(con->ssl, r))) {
case SSL_ERROR_WANT_WRITE:
write_wait = 1;
break;
case SSL_ERROR_SYSCALL:
switch(errno) {
@ -196,7 +198,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, chunkqueue *c
if (c->offset == c->data.file.length) {
chunk_finished = 1;
}
} while(!chunk_finished);
} while(!chunk_finished && !write_wait);
break;
}

Loading…
Cancel
Save