Selaa lähdekoodia

Support multiple domains (Step 3/?)

bel2125 7 vuotta sitten
vanhempi
commit
62015a270e
2 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 1 1
      src/civetweb.c
  2. 4 3
      test/private.c

+ 1 - 1
src/civetweb.c

@@ -13405,7 +13405,7 @@ set_ports_option(struct mg_context *phys_ctx)
 		               sizeof(on)) != 0) {
 
 			/* Set reuse option, but don't abort on errors. */
-			mg_cry(fc(ctx),
+			mg_cry(fc(phys_ctx),
 			       "cannot set socket option SO_EXCLUSIVEADDRUSE (entry %i)",
 			       portsTotal);
 		}

+ 4 - 3
test/private.c

@@ -238,16 +238,17 @@ START_TEST(test_should_keep_alive)
 
 	memset(&ctx, 0, sizeof(ctx));
 	memset(&conn, 0, sizeof(conn));
-	conn.ctx = &ctx;
+	conn.phys_ctx = &ctx;
+	conn.dom_ctx = &(ctx.dd);
 	ck_assert_int_eq(test_parse_http_request(req1, lenreq1, &conn.request_info),
 	                 lenreq1);
 	conn.connection_type = 1; /* Valid request */
 	ck_assert_int_eq(conn.request_info.num_headers, 0);
 
-	ctx.config[ENABLE_KEEP_ALIVE] = no;
+	ctx.dd.config[ENABLE_KEEP_ALIVE] = no;
 	ck_assert_int_eq(should_keep_alive(&conn), 0);
 
-	ctx.config[ENABLE_KEEP_ALIVE] = yes;
+	ctx.dd.config[ENABLE_KEEP_ALIVE] = yes;
 	ck_assert_int_eq(should_keep_alive(&conn), 1);
 
 	conn.must_close = 1;