소스 검색

Format code after merge (using clang-format 7.0.0)

bel2125 6 년 전
부모
커밋
ea3ebaffff
2개의 변경된 파일12개의 추가작업 그리고 15개의 파일을 삭제
  1. 3 3
      src/civetweb.c
  2. 9 12
      src/main.c

+ 3 - 3
src/civetweb.c

@@ -15059,7 +15059,7 @@ sslize(struct mg_connection *conn,
 {
 	int ret, err;
 	int short_trust;
-	unsigned timeout=1024;
+	unsigned timeout = 1024;
 	unsigned i;
 
 	if (!conn) {
@@ -15101,7 +15101,7 @@ sslize(struct mg_connection *conn,
 
 	/* Reuse the request timeout for the SSL_Accept/SSL_connect timeout  */
 	if (conn->dom_ctx->config[REQUEST_TIMEOUT]) {
-		/* NOTE: The loop below acts as a back-off, so we can end 
+		/* NOTE: The loop below acts as a back-off, so we can end
 		 * up sleeping for more (or less) than the REQUEST_TIMEOUT. */
 		timeout = atoi(conn->dom_ctx->config[REQUEST_TIMEOUT]);
 	}
@@ -16947,7 +16947,7 @@ get_request(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 	/* Message is a valid request */
 
 	/* Is there a "host" ? */
-	if (conn->host!=NULL) {
+	if (conn->host != NULL) {
 		mg_free((void *)conn->host);
 	}
 	conn->host = alloc_get_host(conn);

+ 9 - 12
src/main.c

@@ -1330,20 +1330,20 @@ start_civetweb(int argc, char *argv[])
 #if defined(DAEMONIZE)
 	/* Daemonize */
 	for (i = 0; options[i] != NULL; i++) {
-		if (strcmp(options[i],"daemonize") ==  0) {
-			if(options[i+1] != NULL) {
-				if(mg_strcasecmp(options[i+1], "yes") == 0) {
+		if (strcmp(options[i], "daemonize") == 0) {
+			if (options[i + 1] != NULL) {
+				if (mg_strcasecmp(options[i + 1], "yes") == 0) {
 					fprintf(stdout, "daemonize.\n");
-					if(daemon(0,0) != 0) {
+					if (daemon(0, 0) != 0) {
 						fprintf(stdout, "Faild to daemonize main process.\n");
 						exit(EXIT_FAILURE);
 					}
 					FILE *fp;
-					if((fp=fopen(PID_FILE,"w")) == 0) {
+					if ((fp = fopen(PID_FILE, "w")) == 0) {
 						fprintf(stdout, "Can not open %s.\n", PID_FILE);
 						exit(EXIT_FAILURE);
 					}
-					fprintf(fp,"%d",getpid());
+					fprintf(fp, "%d", getpid());
 					fclose(fp);
 				}
 			}
@@ -2980,15 +2980,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
@@ -3001,8 +2999,7 @@ main(int argc, char *argv[])
 		(void)[alert runModal];
 	}
 }
-- (void)shutDown
-{
+- (void)shutDown {
 	[NSApp terminate:nil];
 }
 @end