Browse Source

Quick fix for #244

Later mg_fopen and mg_stat should be restructured, so the do not work on different members of the same structure.
bel 9 years ago
parent
commit
de5c287ad6
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/civetweb.c

+ 4 - 1
src/civetweb.c

@@ -1476,7 +1476,10 @@ mg_fopen(struct mg_connection *conn,
 		return 0;
 		return 0;
 	}
 	}
 
 
-	memset(filep, 0, sizeof(*filep));
+	/* TODO (high): mg_fopen should only open a file, while mg_stat should
+	 * only get the file status. They should not work on different members of
+	 * the same structure (bad cohesion). */
+	/* memset(filep, 0, sizeof(*filep)); <-- remove this (issue #244) */
 
 
 	if (!is_file_in_memory(conn, path, filep)) {
 	if (!is_file_in_memory(conn, path, filep)) {
 #ifdef _WIN32
 #ifdef _WIN32