Commit 9fa66bf2 authored by Sergey Lyubka's avatar Sergey Lyubka

Merge branch 'master' of ssh://github.com/valenok/mongoose

parents 99ddb2f1 98c382e7
...@@ -11,6 +11,7 @@ Features ...@@ -11,6 +11,7 @@ Features
- Crossplatform - works on Windows, MacOS and most flavors of UNIX - Crossplatform - works on Windows, MacOS and most flavors of UNIX
- CGI, SSL, SSI, Digest (MD5) authorization, Websocket, WEbDAV support - CGI, SSL, SSI, Digest (MD5) authorization, Websocket, WEbDAV support
- Lua server pages
- Resumed download, URL rewrite support - Resumed download, URL rewrite support
- IP-based ACL, Windows service, GET, POST, HEAD, PUT, DELETE methods - IP-based ACL, Windows service, GET, POST, HEAD, PUT, DELETE methods
- Excluding files from serving by URI pattern - Excluding files from serving by URI pattern
...@@ -19,6 +20,7 @@ Features ...@@ -19,6 +20,7 @@ Features
- Embeddable with simple and clean API ([mongoose.h](https://github.com/valenok/mongoose/blob/master/mongoose.h)). The source is in single [mongoose.c](https://github.com/valenok/mongoose/blob/master/mongoose.c) file to make things easy. - Embeddable with simple and clean API ([mongoose.h](https://github.com/valenok/mongoose/blob/master/mongoose.h)). The source is in single [mongoose.c](https://github.com/valenok/mongoose/blob/master/mongoose.c) file to make things easy.
- Embedding examples: [hello.c](https://github.com/valenok/mongoose/blob/master/examples/hello.c), [post.c](https://github.com/valenok/mongoose/blob/master/examples/post.c), [upload.c](https://github.com/valenok/mongoose/blob/master/examples/upload.c), [websocket.c](https://github.com/valenok/mongoose/blob/master/examples/websocket.c) - Embedding examples: [hello.c](https://github.com/valenok/mongoose/blob/master/examples/hello.c), [post.c](https://github.com/valenok/mongoose/blob/master/examples/post.c), [upload.c](https://github.com/valenok/mongoose/blob/master/examples/upload.c), [websocket.c](https://github.com/valenok/mongoose/blob/master/examples/websocket.c)
- Python and C# bindings - Python and C# bindings
- Super-liberal MIT license, great for commercial users!
Mailing list Mailing list
......
...@@ -306,6 +306,7 @@ extern int SSL_read(SSL *, void *, int); ...@@ -306,6 +306,7 @@ extern int SSL_read(SSL *, void *, int);
extern int SSL_write(SSL *, const void *, int); extern int SSL_write(SSL *, const void *, int);
extern int SSL_get_error(const SSL *, int); extern int SSL_get_error(const SSL *, int);
extern int SSL_set_fd(SSL *, int); extern int SSL_set_fd(SSL *, int);
extern int SSL_pending(SSL *);
extern SSL *SSL_new(SSL_CTX *); extern SSL *SSL_new(SSL_CTX *);
extern SSL_CTX *SSL_CTX_new(SSL_METHOD *); extern SSL_CTX *SSL_CTX_new(SSL_METHOD *);
extern SSL_METHOD *SSLv23_server_method(void); extern SSL_METHOD *SSLv23_server_method(void);
...@@ -351,6 +352,7 @@ struct ssl_func { ...@@ -351,6 +352,7 @@ struct ssl_func {
#define SSL_CTX_use_certificate_chain_file \ #define SSL_CTX_use_certificate_chain_file \
(* (int (*)(SSL_CTX *, const char *)) ssl_sw[16].ptr) (* (int (*)(SSL_CTX *, const char *)) ssl_sw[16].ptr)
#define SSLv23_client_method (* (SSL_METHOD * (*)(void)) ssl_sw[17].ptr) #define SSLv23_client_method (* (SSL_METHOD * (*)(void)) ssl_sw[17].ptr)
#define SSL_pending (* (int (*)(SSL *)) ssl_sw[18].ptr)
#define CRYPTO_num_locks (* (int (*)(void)) crypto_sw[0].ptr) #define CRYPTO_num_locks (* (int (*)(void)) crypto_sw[0].ptr)
#define CRYPTO_set_locking_callback \ #define CRYPTO_set_locking_callback \
...@@ -383,6 +385,7 @@ static struct ssl_func ssl_sw[] = { ...@@ -383,6 +385,7 @@ static struct ssl_func ssl_sw[] = {
{"SSL_load_error_strings", NULL}, {"SSL_load_error_strings", NULL},
{"SSL_CTX_use_certificate_chain_file", NULL}, {"SSL_CTX_use_certificate_chain_file", NULL},
{"SSLv23_client_method", NULL}, {"SSLv23_client_method", NULL},
{"SSL_pending", NULL},
{NULL, NULL} {NULL, NULL}
}; };
...@@ -1469,6 +1472,9 @@ static int wait_until_socket_is_readable(struct mg_connection *conn) { ...@@ -1469,6 +1472,9 @@ static int wait_until_socket_is_readable(struct mg_connection *conn) {
FD_ZERO(&set); FD_ZERO(&set);
FD_SET(conn->client.sock, &set); FD_SET(conn->client.sock, &set);
result = select(conn->client.sock + 1, &set, NULL, NULL, &tv); result = select(conn->client.sock + 1, &set, NULL, NULL, &tv);
if(result == 0 && conn->ssl != NULL) {
result = SSL_pending(conn->ssl);
}
} while ((result == 0 || (result < 0 && ERRNO == EINTR)) && } while ((result == 0 || (result < 0 && ERRNO == EINTR)) &&
conn->ctx->stop_flag == 0); conn->ctx->stop_flag == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment