Browse Source

Format code and add end-of-file comments

bel2125 8 years ago
parent
commit
c5b8e38fd7
7 changed files with 22 additions and 1 deletions
  1. 5 1
      src/civetweb.c
  2. 3 0
      src/handle_form.inl
  3. 3 0
      src/md5.inl
  4. 3 0
      src/mod_duktape.inl
  5. 2 0
      src/mod_lua.inl
  6. 3 0
      src/sha1.inl
  7. 3 0
      src/timer.inl

+ 5 - 1
src/civetweb.c

@@ -10226,16 +10226,20 @@ mg_websocket_write_exec(struct mg_connection *conn,
 	 * but mongoose's mg_printf/mg_write is not (because of the loop in
 	 * push(), although that is only a problem if the packet is large or
 	 * outgoing buffer is full). */
+
 	/* TODO: Check if this lock should be moved to user land.
 	 * Currently the server sets this lock for websockets, but
 	 * not for any other connection. It must be set for every
 	 * conn read/written by more than one thread, no matter if
 	 * it is a websocket or regular connection. */
 	(void)mg_lock_connection(conn);
+
 	retval = mg_write(conn, header, headerLen);
 	if (dataLen > 0) {
 		retval = mg_write(conn, data, dataLen);
 	}
+
+	/* TODO: Remove this unlock as well, when lock is moved. */
 	mg_unlock_connection(conn);
 
 	return retval;
@@ -13361,7 +13365,7 @@ mg_close_connection(struct mg_connection *conn)
 		mg_free(client_ctx);
 		(void)pthread_mutex_destroy(&conn->mutex);
 		mg_free(conn);
-	} else if (conn->ctx->context_type == 0) {//Client
+	} else if (conn->ctx->context_type == 0) { // Client
 		mg_free(conn);
 	}
 }

+ 3 - 0
src/handle_form.inl

@@ -893,3 +893,6 @@ mg_handle_form_request(struct mg_connection *conn,
 	/* Unknown Content-Type */
 	return -1;
 }
+
+
+/* End of handle_form.inl */

+ 3 - 0
src/md5.inl

@@ -466,3 +466,6 @@ md5_finish(md5_state_t *pms, md5_byte_t digest[16])
 	for (i = 0; i < 16; ++i)
 		digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
 }
+
+
+/* End of md5.inl */

+ 3 - 0
src/mod_duktape.inl

@@ -248,3 +248,6 @@ mg_exec_duktape_script(struct mg_connection *conn, const char *script_name)
 exec_duktape_finished:
 	duk_destroy_heap(ctx);
 }
+
+
+/* End of mod_duktape.inl */

+ 2 - 0
src/mod_lua.inl

@@ -2057,3 +2057,5 @@ lua_exit_optional_libraries(void)
 	lib_handle_uuid = NULL;
 }
 
+
+/* End of mod_lua.inl */

+ 3 - 0
src/sha1.inl

@@ -321,3 +321,6 @@ SHA1_Final(unsigned char *digest, SHA_CTX *context)
 	memset(context, '\0', sizeof(*context));
 	memset(&finalcount, '\0', sizeof(finalcount));
 }
+
+
+/* End of sha1.inl */

+ 3 - 0
src/timer.inl

@@ -221,3 +221,6 @@ timers_exit(struct mg_context *ctx)
 		mg_free(ctx->timers);
 	}
 }
+
+
+/* End of timer.inl */