Преглед изворни кода

Add websocket.trace to .gitignore and format latest changes

bel2125 пре 5 година
родитељ
комит
8e911a9fa3
3 измењених фајлова са 20 додато и 21 уклоњено
  1. 1 0
      .gitignore
  2. 9 9
      src/civetweb.c
  3. 10 12
      src/main.c

+ 1 - 0
.gitignore

@@ -10,6 +10,7 @@ out
 *.msi
 *.exe
 *.zip
+*.trace
 [oO]utput
 [tT]esting
 

+ 9 - 9
src/civetweb.c

@@ -4000,7 +4000,7 @@ mg_get_request_link(const struct mg_connection *conn, char *buf, size_t buflen)
 			int auth_domain_check_enabled =
 			    conn->dom_ctx->config[ENABLE_AUTH_DOMAIN_CHECK]
 			    && (!mg_strcasecmp(
-			        conn->dom_ctx->config[ENABLE_AUTH_DOMAIN_CHECK], "yes"));
+			           conn->dom_ctx->config[ENABLE_AUTH_DOMAIN_CHECK], "yes"));
 			const char *server_domain =
 			    conn->dom_ctx->config[AUTHENTICATION_DOMAIN];
 
@@ -12227,7 +12227,7 @@ print_dav_dir_entry(struct de *de, void *data)
 	struct mg_connection *conn = (struct mg_connection *)data;
 	if (!de || !conn
 	    || !print_props(
-	        conn, conn->request_info.local_uri, de->file_name, &de->file)) {
+	           conn, conn->request_info.local_uri, de->file_name, &de->file)) {
 		return -1;
 	}
 	return 0;
@@ -14567,7 +14567,7 @@ parse_port_string(const struct vec *vec, struct socket *so, int *ip_version)
 #if defined(USE_IPV6)
 	} else if (sscanf(vec->ptr, "[%49[^]]]:%u%n", buf, &port, &len) == 2
 	           && mg_inet_pton(
-	               AF_INET6, buf, &so->lsa.sin6, sizeof(so->lsa.sin6))) {
+	                  AF_INET6, buf, &so->lsa.sin6, sizeof(so->lsa.sin6))) {
 		/* IPv6 address, examples: see above */
 		/* so->lsa.sin6.sin6_family = AF_INET6; already set by mg_inet_pton
 		 */
@@ -16112,9 +16112,9 @@ init_ssl_ctx_impl(struct mg_context *phys_ctx,
 	callback_ret = (phys_ctx->callbacks.init_ssl_domain == NULL)
 	                   ? 0
 	                   : (phys_ctx->callbacks.init_ssl_domain(
-	                       dom_ctx->config[AUTHENTICATION_DOMAIN],
-	                       dom_ctx->ssl_ctx,
-	                       phys_ctx->user_data));
+	                         dom_ctx->config[AUTHENTICATION_DOMAIN],
+	                         dom_ctx->ssl_ctx,
+	                         phys_ctx->user_data));
 
 	/* If domain callback returns 0, civetweb sets up the SSL certificate.
 	 * If it returns 1, civetweb assumes the calback already did this.
@@ -16280,9 +16280,9 @@ init_ssl_ctx(struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 	callback_ret = (phys_ctx->callbacks.external_ssl_ctx_domain == NULL)
 	                   ? 0
 	                   : (phys_ctx->callbacks.external_ssl_ctx_domain(
-	                       dom_ctx->config[AUTHENTICATION_DOMAIN],
-	                       &ssl_ctx,
-	                       phys_ctx->user_data));
+	                         dom_ctx->config[AUTHENTICATION_DOMAIN],
+	                         &ssl_ctx,
+	                         phys_ctx->user_data));
 
 	if (callback_ret < 0) {
 		mg_cry_ctx_internal(

+ 10 - 12
src/main.c

@@ -2072,7 +2072,7 @@ get_password(const char *user,
 
 	ok = (IDOK
 	      == DialogBoxIndirectParam(
-	          NULL, dia, NULL, InputDlgProc, (LPARAM)&s_dlg_proc_param));
+	             NULL, dia, NULL, InputDlgProc, (LPARAM)&s_dlg_proc_param));
 
 	s_dlg_proc_param.hWnd = NULL;
 	s_dlg_proc_param.guard = 0;
@@ -2578,10 +2578,11 @@ change_password_file()
 		s_dlg_proc_param.name = path;
 		s_dlg_proc_param.fRetry = NULL;
 
-	} while ((IDOK
-	          == DialogBoxIndirectParam(
-	              NULL, dia, NULL, PasswordDlgProc, (LPARAM)&s_dlg_proc_param))
-	         && (!g_exit_flag));
+	} while (
+	    (IDOK
+	     == DialogBoxIndirectParam(
+	            NULL, dia, NULL, PasswordDlgProc, (LPARAM)&s_dlg_proc_param))
+	    && (!g_exit_flag));
 
 	s_dlg_proc_param.hWnd = NULL;
 	s_dlg_proc_param.guard = 0;
@@ -2704,7 +2705,7 @@ show_system_info()
 
 	ok = (IDOK
 	      == DialogBoxIndirectParam(
-	          NULL, dia, NULL, InputDlgProc, (LPARAM)&s_dlg_proc_param));
+	             NULL, dia, NULL, InputDlgProc, (LPARAM)&s_dlg_proc_param));
 
 	s_dlg_proc_param.hWnd = NULL;
 	s_dlg_proc_param.guard = 0;
@@ -3041,15 +3042,13 @@ main(int argc, char *argv[])
 @end
 
 @implementation Civetweb
-- (void)openBrowser
-{
+- (void)openBrowser {
 	[[NSWorkspace sharedWorkspace]
 	    openURL:[NSURL URLWithString:[NSString stringWithUTF8String:
 	                                               get_url_to_first_open_port(
 	                                                   g_ctx)]]];
 }
-- (void)editConfig
-{
+- (void)editConfig {
 	create_config_file(g_ctx, g_config_file_name);
 	NSString *path = [NSString stringWithUTF8String:g_config_file_name];
 	if (![[NSWorkspace sharedWorkspace] openFile:path
@@ -3062,8 +3061,7 @@ main(int argc, char *argv[])
 		(void)[alert runModal];
 	}
 }
-- (void)shutDown
-{
+- (void)shutDown {
 	[NSApp terminate:nil];
 }
 @end