mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-27 20:48:29 +00:00
Using #define MGSQLEN for the socket queue length
This commit is contained in:
1 parent
e95dbb90a7
commit
1ef29c1b3b
1 file changed
+6
-1
+6
-1
@@ -304,6 +304,11 @@ typedef int socklen_t;
|
|||||||
#define PATH_MAX 4096
|
#define PATH_MAX 4096
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Size of the accepted socket queue
|
||||||
|
#if !defined(MGSQLEN)
|
||||||
|
#define MGSQLEN 20
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *http_500_error = "Internal Server Error";
|
static const char *http_500_error = "Internal Server Error";
|
||||||
|
|
||||||
#if defined(NO_SSL_DL)
|
#if defined(NO_SSL_DL)
|
||||||
@@ -494,7 +499,7 @@ struct mg_context {
|
|||||||
pthread_mutex_t mutex; // Protects (max|num)_threads
|
pthread_mutex_t mutex; // Protects (max|num)_threads
|
||||||
pthread_cond_t cond; // Condvar for tracking workers terminations
|
pthread_cond_t cond; // Condvar for tracking workers terminations
|
||||||
|
|
||||||
struct socket queue[20]; // Accepted sockets
|
struct socket queue[MGSQLEN]; // Accepted sockets
|
||||||
volatile int sq_head; // Head of the socket queue
|
volatile int sq_head; // Head of the socket queue
|
||||||
volatile int sq_tail; // Tail of the socket queue
|
volatile int sq_tail; // Tail of the socket queue
|
||||||
pthread_cond_t sq_full; // Signaled when socket is produced
|
pthread_cond_t sq_full; // Signaled when socket is produced
|
||||||
|
|||||||
Reference in new issue
Block a user