mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-18 19:31:02 +00:00
ephemeral stuff
This commit is contained in:
1 parent
b0f5e9cec4
commit
501c5a4bcd
1 file changed
+4
-5
+4
-5
@@ -3992,9 +3992,8 @@ static void ph(struct mg_connection *c, int ev, void *ev_data) {
|
|||||||
static void test_poll(void) {
|
static void test_poll(void) {
|
||||||
int count = 0, i;
|
int count = 0, i;
|
||||||
struct mg_mgr mgr;
|
struct mg_mgr mgr;
|
||||||
mg_mgr_init(&mgr);
|
mg_mgr_init(&mgr); // To prevent bind errors on Windows
|
||||||
mg_http_listen(&mgr, "http://127.0.0.1:42346", ph,
|
mg_http_listen(&mgr, "http://127.0.0.1:32345", ph, &count);
|
||||||
&count); // To prevent bind errors on Windows
|
|
||||||
for (i = 0; i < 10; i++) mg_mgr_poll(&mgr, 0);
|
for (i = 0; i < 10; i++) mg_mgr_poll(&mgr, 0);
|
||||||
ASSERT(count == 10);
|
ASSERT(count == 10);
|
||||||
mg_mgr_free(&mgr);
|
mg_mgr_free(&mgr);
|
||||||
@@ -5479,8 +5478,8 @@ static void test_wakeup(void) {
|
|||||||
struct wudata *data;
|
struct wudata *data;
|
||||||
int i;
|
int i;
|
||||||
mg_mgr_init(&mgr); // Initialise event manager
|
mg_mgr_init(&mgr); // Initialise event manager
|
||||||
mg_log_set(MG_LL_DEBUG); // Set debug log level
|
mg_log_set(MG_LL_DEBUG); // To prevent bind errors on Windows
|
||||||
c = mg_http_listen(&mgr, "http://127.0.0.1:42347", hwu, NULL);
|
c = mg_http_listen(&mgr, "http://127.0.0.1:32346", hwu, NULL);
|
||||||
mg_wakeup_init(&mgr); // Initialise wakeup socket pair
|
mg_wakeup_init(&mgr); // Initialise wakeup socket pair
|
||||||
data = (struct wudata *) calloc(1, sizeof(*data)); // wuthread owns it
|
data = (struct wudata *) calloc(1, sizeof(*data)); // wuthread owns it
|
||||||
data->conn_id = c->id;
|
data->conn_id = c->id;
|
||||||
|
|||||||
Reference in new issue
Block a user