Kaynağa Gözat

Fix some TODOs

bel 9 yıl önce
ebeveyn
işleme
40aacf0533
2 değiştirilmiş dosya ile 3 ekleme ve 28 silme
  1. 1 25
      src/civetweb.c
  2. 2 3
      src/main.c

+ 1 - 25
src/civetweb.c

@@ -137,7 +137,7 @@ int clock_gettime(int clk_id, struct timespec *t);
 int
 clock_gettime(int clk_id, struct timespec *t)
 {
-    memset(t, 0, sizeof(*t));
+	memset(t, 0, sizeof(*t));
 	if (clk_id == CLOCK_REALTIME) {
 		struct timeval now;
 		int rv = gettimeofday(&now, NULL);
@@ -10082,30 +10082,6 @@ initialize_ssl(struct mg_context *ctx)
 	return 1;
 }
 
-#if 0 /* TODO: check if this function is required at all */
-static int
-verify_ssl_client(int preverify_ok, X509_STORE_CTX *x509_ctx)
-{
-	int ret = preverify_ok;
-	/*
-    TODO: store rejected connection attempts
-	char buf[256];
-	struct X509 *err_cert;
-	int err, depth;
-	SSL *ssl;
-	*/
-
-	/* Ignore pre-verification - only accept clients we know locally */
-	(void)preverify_ok;
-	/*
-	err_cert = X509_STORE_CTX_get_current_cert(x509_st);
-	err = X509_STORE_CTX_get_error(x509_st);
-	depth = X509_STORE_CTX_get_error_depth(x509_st);
-	*/
-	return ret;
-}
-#endif
-
 
 static int
 ssl_use_pem_file(struct mg_context *ctx, const char *pem)

+ 2 - 3
src/main.c

@@ -2067,9 +2067,7 @@ change_password_file()
 static int
 manage_service(int action)
 {
-	static const char *service_name =
-	    "Civetweb"; /* TODO (mid): check using server_name instead of
-	                 * service_name */
+	const char *service_name = g_server_name;
 	SC_HANDLE hSCM = NULL, hService = NULL;
 	SERVICE_DESCRIPTION descr;
 	char path[PATH_MAX + 20] = ""; /* Path to executable plus magic argument */
@@ -2126,6 +2124,7 @@ manage_service(int action)
 	return success;
 }
 
+
 static LRESULT CALLBACK
 WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {