浏览代码

Check TODO marks and assign priorities

bel 10 年之前
父节点
当前提交
3291c1d388
共有 3 个文件被更改,包括 64 次插入60 次删除
  1. 33 44
      src/civetweb.c
  2. 10 7
      src/main.c
  3. 21 9
      src/mod_lua.inl

+ 33 - 44
src/civetweb.c

@@ -1153,7 +1153,7 @@ static void mg_set_thread_name(const char *name)
 {
 {
 	char threadName[16]; /* Max. thread length in Linux/OSX/.. */
 	char threadName[16]; /* Max. thread length in Linux/OSX/.. */
 
 
-	/* TODO: use strcpy and strcat instad of snprintf, use server name, don't
+	/* TODO (low): use strcpy and strcat instad of snprintf, use server name, don't
 	 * return */
 	 * return */
 	if (snprintf(threadName, sizeof(threadName), "civetweb-%s", name) < 0)
 	if (snprintf(threadName, sizeof(threadName), "civetweb-%s", name) < 0)
 		return;
 		return;
@@ -1491,20 +1491,6 @@ static void sockaddr_to_string(char *buf, size_t len, const union usa *usa)
 		            NI_NUMERICHOST);
 		            NI_NUMERICHOST);
 	}
 	}
 #endif
 #endif
-
-#if 0
-    /* TODO: test alternative code, remove old code */
-#if defined(USE_IPV6)
-    mg_inet_ntop(usa->sa.sa_family, usa->sa.sa_family == AF_INET ?
-        (void *) &usa->sin.sin_addr :
-    (void *) &usa->sin6.sin6_addr, buf, len);
-#elif defined(_WIN32)
-    /* Only Windows Vista (and newer) have inet_ntop() */
-    mg_strlcpy(buf, inet_ntoa(usa->sin.sin_addr), len);
-#else
-    inet_ntop(usa->sa.sa_family, (void *) &usa->sin.sin_addr, buf, (socklen_t)len);
-#endif
-#endif
 }
 }
 
 
 /* Convert time_t to a string. According to RFC2616, Sec 14.18, this must be
 /* Convert time_t to a string. According to RFC2616, Sec 14.18, this must be
@@ -1614,8 +1600,9 @@ static char *skip_quoted(char **buf,
 	if (end_word > begin_word) {
 	if (end_word > begin_word) {
 		p = end_word - 1;
 		p = end_word - 1;
 		while (*p == quotechar) {
 		while (*p == quotechar) {
-			/* TODO (bel): it seems this code is never reached, so quotechar is
-			 * actually not needed - check if this code may be droped */
+			/* TODO (bel, low): it seems this code is never reached, so
+			 * quotechar is actually not needed - check if this code may be
+             * droped */
 
 
 			/* If there is anything beyond end_word, copy it */
 			/* If there is anything beyond end_word, copy it */
 			if (*end_word == '\0') {
 			if (*end_word == '\0') {
@@ -2664,7 +2651,7 @@ static pid_t spawn_process(struct mg_connection *conn,
 	memset(&si, 0, sizeof(si));
 	memset(&si, 0, sizeof(si));
 	si.cb = sizeof(si);
 	si.cb = sizeof(si);
 
 
-	/* TODO(lsm): redirect CGI errors to the error log file */
+	/* TODO(lsm, mid): redirect CGI errors to the error log file */
 	si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
 	si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
 	si.wShowWindow = SW_HIDE;
 	si.wShowWindow = SW_HIDE;
 
 
@@ -4615,7 +4602,7 @@ static SOCKET conn2(struct mg_context *ctx /* may be null */,
 		snprintf(ebuf, ebuf_len, "%s", "SSL is not initialized");
 		snprintf(ebuf, ebuf_len, "%s", "SSL is not initialized");
 #ifdef _MSC_VER
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(push)
-/* TODO(lsm): use something threadsafe instead of gethostbyname() */
+/* TODO(lsm, high): use something threadsafe instead of gethostbyname() */
 /* getaddrinfo is the replacement here but isn't cross platform */
 /* getaddrinfo is the replacement here but isn't cross platform */
 #pragma warning(disable : 4996)
 #pragma warning(disable : 4996)
 #endif
 #endif
@@ -4899,8 +4886,8 @@ static void dir_scan_callback(struct de *de, void *data)
 		dsd->entries = (struct de *)realloc2(
 		dsd->entries = (struct de *)realloc2(
 		    dsd->entries, dsd->arr_size * sizeof(dsd->entries[0]));
 		    dsd->entries, dsd->arr_size * sizeof(dsd->entries[0]));
 	}
 	}
-	if (dsd->entries == NULL) {
-		/* TODO(lsm): propagate an error to the caller */
+	if (dsd->entries == NULL) {x
+		/* TODO(lsm, low): propagate an error to the caller */
 		dsd->num_entries = 0;
 		dsd->num_entries = 0;
 	} else {
 	} else {
 		dsd->entries[dsd->num_entries].file_name = mg_strdup(de->file_name);
 		dsd->entries[dsd->num_entries].file_name = mg_strdup(de->file_name);
@@ -5485,7 +5472,9 @@ forward_body_data(struct mg_connection *conn, FILE *fp, SOCKET sock, SSL *ssl)
 
 
 		/* Each error code path in this function must send an error */
 		/* Each error code path in this function must send an error */
 		if (!success) {
 		if (!success) {
-			/* TODO: Maybe some data has already been sent. */
+			/* NOTE: Maybe some data has already been sent. */
+            /* TODO (low): If some data has been sent, a correct error
+             * reply can no longer be sent, so just close the connection */
 			send_http_error(conn, 500, "%s", "");
 			send_http_error(conn, 500, "%s", "");
 		}
 		}
 	}
 	}
@@ -5581,7 +5570,7 @@ static void prepare_cgi_environment(struct mg_connection *conn,
 	addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1");
 	addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1");
 	addenv(blk, "%s", "REDIRECT_STATUS=200"); /* For PHP */
 	addenv(blk, "%s", "REDIRECT_STATUS=200"); /* For PHP */
 
 
-	/* TODO(lsm): fix this for IPv6 case */
+	/* TODO(lsm, high): fix this for IPv6 case */
 	addenv(blk, "SERVER_PORT=%d", ntohs(conn->client.lsa.sin.sin_port));
 	addenv(blk, "SERVER_PORT=%d", ntohs(conn->client.lsa.sin.sin_port));
 
 
 	addenv(blk, "REQUEST_METHOD=%s", conn->request_info.request_method);
 	addenv(blk, "REQUEST_METHOD=%s", conn->request_info.request_method);
@@ -5936,7 +5925,7 @@ static void mkcol(struct mg_connection *conn, const char *path)
 	if (conn == NULL)
 	if (conn == NULL)
 		return;
 		return;
 
 
-	/* TODO: Check the send_http_error situations in this function */
+	/* TODO (mid): Check the send_http_error situations in this function */
 
 
 	memset(&de.file, 0, sizeof(de.file));
 	memset(&de.file, 0, sizeof(de.file));
 	if (!mg_stat(conn, path, &de.file)) {
 	if (!mg_stat(conn, path, &de.file)) {
@@ -6143,7 +6132,7 @@ static void delete_file(struct mg_connection *conn, const char *path)
 
 
 	if (de.file.is_directory) {
 	if (de.file.is_directory) {
 		remove_directory(conn, path);
 		remove_directory(conn, path);
-		/* TODO: remove_dir does not return success of the operation */
+		/* TODO (mid): remove_dir does not return success of the operation */
 		/* Assume delete is successful: Return 204 without content. */
 		/* Assume delete is successful: Return 204 without content. */
 		send_http_error(conn, 204, "%s", "");
 		send_http_error(conn, 204, "%s", "");
 		return;
 		return;
@@ -6827,8 +6816,6 @@ static void read_websocket(struct mg_connection *conn,
 
 
 	/* Loop continuously, reading messages from the socket, invoking the
 	/* Loop continuously, reading messages from the socket, invoking the
 	 * callback, and waiting repeatedly until an error occurs. */
 	 * callback, and waiting repeatedly until an error occurs. */
-	/* TODO: Investigate if this next line is needed */
-	/* assert(conn->content_len == 0); */
 	while (!conn->ctx->stop_flag) {
 	while (!conn->ctx->stop_flag) {
 		header_len = 0;
 		header_len = 0;
 		assert(conn->data_len >= conn->request_len);
 		assert(conn->data_len >= conn->request_len);
@@ -7056,8 +7043,9 @@ handle_websocket_request(struct mg_connection *conn,
 	/* Step 4: Check if there is a responsible websocket handler. */
 	/* Step 4: Check if there is a responsible websocket handler. */
 	if (!is_callback_resource && !lua_websock) {
 	if (!is_callback_resource && !lua_websock) {
 		/* There is no callback, an Lua is not responsible either. */
 		/* There is no callback, an Lua is not responsible either. */
-		/* Reply with a 404 Not Found or with nothing at all? TODO: check if
-		 * this is correct for websockets */
+		/* Reply with a 404 Not Found or with nothing at all?
+         * TODO (mid): check the websocket standards, how to reply to
+         * requests to invalid websocket addresses. */
 		send_http_error(conn, 404, "%s", "Not found");
 		send_http_error(conn, 404, "%s", "Not found");
 		return;
 		return;
 	}
 	}
@@ -7178,7 +7166,7 @@ static uint32_t get_remote_ip(const struct mg_connection *conn)
 
 
 int mg_upload(struct mg_connection *conn, const char *destination_dir)
 int mg_upload(struct mg_connection *conn, const char *destination_dir)
 {
 {
-	/* TODO: set a timeout */
+	/* TODO (mid): set a timeout */
 	const char *content_type_header, *boundary_start, *sc;
 	const char *content_type_header, *boundary_start, *sc;
 	char *s;
 	char *s;
 	char buf[MG_BUF_LEN], path[PATH_MAX], tmp_path[PATH_MAX], fname[1024],
 	char buf[MG_BUF_LEN], path[PATH_MAX], tmp_path[PATH_MAX], fname[1024],
@@ -7824,7 +7812,7 @@ static void handle_request(struct mg_connection *conn)
 					/* Do nothing, callback has served the request */
 					/* Do nothing, callback has served the request */
 					discard_unread_request_data(conn);
 					discard_unread_request_data(conn);
 				} else {
 				} else {
-					/* TODO: what if the handler did NOT handle the request */
+					/* TODO (high): what if the handler did NOT handle the request */
 					/* The last version did handle this as a file request, but
 					/* The last version did handle this as a file request, but
 					 * since a file request is not always a script resource,
 					 * since a file request is not always a script resource,
 					 * the authorization check might be different */
 					 * the authorization check might be different */
@@ -7837,8 +7825,8 @@ static void handle_request(struct mg_connection *conn)
 					              &is_put_or_delete_request);
 					              &is_put_or_delete_request);
 					callback_handler = NULL;
 					callback_handler = NULL;
 
 
-					/* TODO: for the moment, a goto is simpler than some
-					 * curious loop. */
+					/* TODO (very low): goto is deprecatedm but for the moment, a goto is
+					 * simpler than some curious loop. */
 					/* The situation "callback does not handle the request"
 					/* The situation "callback does not handle the request"
 					 * needs to be reconsidered anyway. */
 					 * needs to be reconsidered anyway. */
 					goto no_callback_resource;
 					goto no_callback_resource;
@@ -7971,7 +7959,7 @@ static void handle_request(struct mg_connection *conn)
 		if (file.is_directory) {
 		if (file.is_directory) {
 			if (substitute_index_file(conn, path, sizeof(path), &file)) {
 			if (substitute_index_file(conn, path, sizeof(path), &file)) {
 				/* 14.1. use a substitute file */
 				/* 14.1. use a substitute file */
-				/* TODO: substitute index may be a script resource.
+				/* TODO (high): substitute index may be a script resource.
 				 * define what should be possible in this case. */
 				 * define what should be possible in this case. */
 			} else {
 			} else {
 				/* 14.2. no substitute file */
 				/* 14.2. no substitute file */
@@ -8085,8 +8073,11 @@ static int mg_inet_pton(int af, const char *src, void *dst)
 #endif
 #endif
 
 
 /* Valid listening port specification is: [ip_address:]port[s]
 /* Valid listening port specification is: [ip_address:]port[s]
- * Examples: 80, 443s, 127.0.0.1:3128, 1.2.3.4:8080s
- * TODO(lsm): add parsing of the IPv6 address */
+ * Examples for IPv4: 80, 443s, 127.0.0.1:3128, 1.2.3.4:8080s
+ * Examples for IPv6: [::1]:80, 
+ *   TODO (high): check ipv6 port without IP> [::]:80
+ *   [FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:443s
+ *   see https://tools.ietf.org/html/rfc3513#section-2.2 */
 static int parse_port_string(const struct vec *vec, struct socket *so)
 static int parse_port_string(const struct vec *vec, struct socket *so)
 {
 {
 	unsigned int a, b, c, d, port;
 	unsigned int a, b, c, d, port;
@@ -8116,8 +8107,6 @@ static int parse_port_string(const struct vec *vec, struct socket *so)
 #endif
 #endif
 	} else if (sscanf(vec->ptr, "%u%n", &port, &len) == 1) {
 	} else if (sscanf(vec->ptr, "%u%n", &port, &len) == 1) {
 		/* If only port is specified, bind to IPv4, INADDR_ANY */
 		/* If only port is specified, bind to IPv4, INADDR_ANY */
-		/* TODO: check -- so->lsa.sin6.sin6_family = AF_INET6; */
-		/* TODO: check -- so->lsa.sin6.sin6_port = htons((uint16_t) port); */
 		so->lsa.sin.sin_port = htons((uint16_t)port);
 		so->lsa.sin.sin_port = htons((uint16_t)port);
 	} else {
 	} else {
 		/* Parsing failure. Make port invalid. */
 		/* Parsing failure. Make port invalid. */
@@ -8205,7 +8194,7 @@ static int set_ports_option(struct mg_context *ctx)
 			                    : sizeof(so.lsa.sa)) != 0 ||
 			                    : sizeof(so.lsa.sa)) != 0 ||
 			           listen(so.sock, SOMAXCONN) != 0 ||
 			           listen(so.sock, SOMAXCONN) != 0 ||
 			           getsockname(so.sock, &(usa.sa), &len) != 0) {
 			           getsockname(so.sock, &(usa.sa), &len) != 0) {
-				/* TODO: rewrite this IF above */
+				/* TODO(mid): rewrite this IF above */
 				mg_cry(fc(ctx),
 				mg_cry(fc(ctx),
 				       "%s: cannot bind to %.*s: %d (%s)",
 				       "%s: cannot bind to %.*s: %d (%s)",
 				       __func__,
 				       __func__,
@@ -8979,7 +8968,7 @@ int mg_get_response(struct mg_connection *conn,
 		ret = getreq(conn, ebuf, ebuf_len, &err);
 		ret = getreq(conn, ebuf, ebuf_len, &err);
 		conn->ctx = octx;
 		conn->ctx = octx;
 
 
-		/* TODO: Define proper return values - maybe return length?
+		/* TODO (mid): Define proper return values - maybe return length?
 		 * For the first test use <0 for error and >0 for OK */
 		 * For the first test use <0 for error and >0 for OK */
 		return (ret == 0) ? -1 : +1;
 		return (ret == 0) ? -1 : +1;
 	}
 	}
@@ -9333,7 +9322,7 @@ static void *worker_thread_run(void *thread_func_param)
 			/* Fill in IP, port info early so even if SSL setup below fails,
 			/* Fill in IP, port info early so even if SSL setup below fails,
 			 * error handler would have the corresponding info.
 			 * error handler would have the corresponding info.
 			 * Thanks to Johannes Winkelmann for the patch.
 			 * Thanks to Johannes Winkelmann for the patch.
-			 * TODO(lsm): Fix IPv6 case */
+			 * TODO(lsm, high): Fix IPv6 case */
 			conn->request_info.remote_port =
 			conn->request_info.remote_port =
 			    ntohs(conn->client.rsa.sin.sin_port);
 			    ntohs(conn->client.rsa.sin.sin_port);
 			sockaddr_to_string(conn->request_info.remote_addr,
 			sockaddr_to_string(conn->request_info.remote_addr,
@@ -9754,8 +9743,7 @@ struct mg_context *mg_start(const struct mg_callbacks *callbacks,
 		InitializeCriticalSection(&global_log_file_lock);
 		InitializeCriticalSection(&global_log_file_lock);
 #endif /* _WIN32 && !__SYMBIAN32__ */
 #endif /* _WIN32 && !__SYMBIAN32__ */
 
 
-	/* Allocate context and initialize reasonable general case defaults.
-	 * TODO(lsm): do proper error handling here. */
+	/* Allocate context and initialize reasonable general case defaults. */
 	if ((ctx = (struct mg_context *)mg_calloc(1, sizeof(*ctx))) == NULL) {
 	if ((ctx = (struct mg_context *)mg_calloc(1, sizeof(*ctx))) == NULL) {
 		return NULL;
 		return NULL;
 	}
 	}
@@ -9770,7 +9758,8 @@ struct mg_context *mg_start(const struct mg_callbacks *callbacks,
 			return NULL;
 			return NULL;
 		}
 		}
 	} else {
 	} else {
-		/* TODO: check if sTlsKey is already initialized */
+		/* TODO (low): istead of sleeping, check if sTlsKey is already 
+         * initialized. */
 		mg_sleep(1);
 		mg_sleep(1);
 	}
 	}
 
 

+ 10 - 7
src/main.c

@@ -298,11 +298,13 @@ static const char *get_option(char **options, const char *option_name)
 	int i = 0;
 	int i = 0;
 	const char *opt_value = NULL;
 	const char *opt_value = NULL;
 
 
-	/* TODO: options should be an array of key-value-pairs, like
-	   struct {const char * key, const char * value} options[]
-	   but it currently is an array with
-	   options[2*i] = key, options[2*i + 1] = value
-	*/
+	/* TODO (low, api makeover): options should be an array of key-value-pairs,
+	 * like 
+     *     struct {const char * key, const char * value} options[]
+	 * but it currently is an array with
+	 *     options[2*i] = key, options[2*i + 1] = value
+     * (probably with a MG_LEGACY_INTERFACE definition)
+	 */
 	while (options[2 * i] != NULL) {
 	while (options[2 * i] != NULL) {
 		if (strcmp(options[2 * i], option_name) == 0) {
 		if (strcmp(options[2 * i], option_name) == 0) {
 			opt_value = options[2 * i + 1];
 			opt_value = options[2 * i + 1];
@@ -355,7 +357,7 @@ static int set_option(char **options, const char *name, const char *value)
 		break;
 		break;
 	case CONFIG_TYPE_FILE:
 	case CONFIG_TYPE_FILE:
 	case CONFIG_TYPE_DIRECTORY:
 	case CONFIG_TYPE_DIRECTORY:
-		/* TODO: check this option when it is set, instead of calling
+		/* TODO (low): check this option when it is set, instead of calling
 		 * verify_existence later */
 		 * verify_existence later */
 		break;
 		break;
 	case CONFIG_TYPE_EXT_PATTERN:
 	case CONFIG_TYPE_EXT_PATTERN:
@@ -1811,7 +1813,8 @@ static void change_password_file()
 static int manage_service(int action)
 static int manage_service(int action)
 {
 {
 	static const char *service_name =
 	static const char *service_name =
-	    "Civetweb"; /* TODO: check using server_name instead of service_name */
+	    "Civetweb"; /* TODO (mid): check using server_name instead of 
+                     * service_name */
 	SC_HANDLE hSCM = NULL, hService = NULL;
 	SC_HANDLE hSCM = NULL, hService = NULL;
 	SERVICE_DESCRIPTION descr;
 	SERVICE_DESCRIPTION descr;
 	char path[PATH_MAX + 20] = ""; /* Path to executable plus magic argument */
 	char path[PATH_MAX + 20] = ""; /* Path to executable plus magic argument */

+ 21 - 9
src/mod_lua.inl

@@ -6,9 +6,11 @@
 static void *
 static void *
 mmap(void *addr, int64_t len, int prot, int flags, int fd, int offset)
 mmap(void *addr, int64_t len, int prot, int flags, int fd, int offset)
 {
 {
-
-	/* TODO: This is an incomplete implementation of mmap for windows.
+	/* TODO (low): This is an incomplete implementation of mmap for windows.
 	 * Currently it is sufficient, but there are a lot of unused parameters.
 	 * Currently it is sufficient, but there are a lot of unused parameters.
+     * Better use a function "mg_map" which only has the required parameters,
+     * and implement it using mmap in Linux and CreateFileMapping in Windows.
+     * Noone should expect a full mmap for Windows here.
 	 */
 	 */
 	HANDLE fh = (HANDLE)_get_osfhandle(fd);
 	HANDLE fh = (HANDLE)_get_osfhandle(fd);
 	HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
 	HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
@@ -537,7 +539,7 @@ static int lsp_get_var(lua_State *L)
 			/* Variable found: return value to Lua */
 			/* Variable found: return value to Lua */
 			lua_pushstring(L, dst);
 			lua_pushstring(L, dst);
 		} else {
 		} else {
-			/* Variable not found (TODO: may be string too long) */
+			/* Variable not found (TODO (mid): may be string too long) */
 			lua_pushnil(L);
 			lua_pushnil(L);
 		}
 		}
 	} else {
 	} else {
@@ -986,7 +988,7 @@ static int lwebsocket_set_timer(lua_State *L, int is_periodic)
 		                (taction)(is_periodic ? lua_action : lua_action_free),
 		                (taction)(is_periodic ? lua_action : lua_action_free),
 		                (void *)arg));
 		                (void *)arg));
 	} else if (type1 == LUA_TFUNCTION && type2 == LUA_TNUMBER) {
 	} else if (type1 == LUA_TFUNCTION && type2 == LUA_TNUMBER) {
-		/* TODO: not implemented yet */
+		/* TODO (mid): not implemented yet */
 		return luaL_error(L, "invalid arguments for set_timer/interval() call");
 		return luaL_error(L, "invalid arguments for set_timer/interval() call");
 	} else {
 	} else {
 		return luaL_error(L, "invalid arguments for set_timer/interval() call");
 		return luaL_error(L, "invalid arguments for set_timer/interval() call");
@@ -1039,7 +1041,7 @@ static void prepare_lua_request_info(struct mg_connection *conn, lua_State *L)
 	                                                          instead */
 	                                                          instead */
 #endif
 #endif
 	reg_string(L, "remote_addr", conn->request_info.remote_addr);
 	reg_string(L, "remote_addr", conn->request_info.remote_addr);
-	/* TODO: ip version */
+	/* TODO (high): ip version */
 	reg_int(L, "remote_port", conn->request_info.remote_port);
 	reg_int(L, "remote_port", conn->request_info.remote_port);
 	reg_int(L, "num_headers", conn->request_info.num_headers);
 	reg_int(L, "num_headers", conn->request_info.num_headers);
 	reg_int(L, "server_port", ntohs(conn->client.lsa.sin.sin_port));
 	reg_int(L, "server_port", ntohs(conn->client.lsa.sin.sin_port));
@@ -1106,6 +1108,16 @@ void lua_civet_open_all_libs(lua_State *L)
 		luaopen_lfs(L);
 		luaopen_lfs(L);
 	}
 	}
 #endif
 #endif
+#ifdef USE_LUA_BINARY
+    {
+        /* TODO (low): Test if this could be used as a replacement for bit32.
+         * Check again with Lua 5.3 later. */
+		extern int luaopen_binary(lua_State *);
+
+        luaL_requiref(L, "binary", luaopen_binary, 1);
+        lua_pop(L, 1);
+    }
+#endif
 }
 }
 
 
 static void prepare_lua_environment(struct mg_context *ctx,
 static void prepare_lua_environment(struct mg_context *ctx,
@@ -1237,7 +1249,7 @@ static int lua_error_handler(lua_State *L)
 		IGNORE_UNUSED_RESULT(
 		IGNORE_UNUSED_RESULT(
 		    luaL_dostring(L, "print(debug.traceback(), '\\n')"));
 		    luaL_dostring(L, "print(debug.traceback(), '\\n')"));
 	}
 	}
-	/* TODO(lsm): leave the stack balanced */
+	/* TODO(lsm, low): leave the stack balanced */
 
 
 	return 0;
 	return 0;
 }
 }
@@ -1401,7 +1413,7 @@ static void *lua_websocket_new(const char *script, struct mg_connection *conn)
 		}
 		}
 		/* init ws list element */
 		/* init ws list element */
 		ws = &(*shared_websock_list)->ws;
 		ws = &(*shared_websock_list)->ws;
-		ws->script = mg_strdup(script); /* TODO: handle OOM */
+		ws->script = mg_strdup(script); /* TODO (low): handle OOM */
 		pthread_mutex_init(&(ws->ws_mutex), NULL);
 		pthread_mutex_init(&(ws->ws_mutex), NULL);
 		ws->state = lua_newstate(lua_allocator, NULL);
 		ws->state = lua_newstate(lua_allocator, NULL);
 		ws->conn[0] = conn;
 		ws->conn[0] = conn;
@@ -1444,8 +1456,8 @@ static void *lua_websocket_new(const char *script, struct mg_connection *conn)
 	}
 	}
 	if (!ok) {
 	if (!ok) {
 		/* Remove from ws connection list. */
 		/* Remove from ws connection list. */
-		/* TODO: Check if list entry and Lua state needs to be deleted (see
-		 * websocket_close). */
+		/* TODO (mid): Check if list entry and Lua state needs to be deleted
+		 * (see websocket_close). */
 		(*shared_websock_list)->ws.conn[--(ws->references)] = 0;
 		(*shared_websock_list)->ws.conn[--(ws->references)] = 0;
 	}
 	}