bel2125 7 年 前
コミット
558a0f3a3b
2 ファイル変更26 行追加26 行削除
  1. 1 1
      src/civetweb.c
  2. 25 25
      src/mod_lua_shared.inl

+ 1 - 1
src/civetweb.c

@@ -12845,7 +12845,7 @@ alloc_get_host(struct mg_connection *conn)
 			/* terminate after ']' */
 			pos[1] = 0;
 		} else {
-
+			/* Otherwise, a ':' separates hostname and port number */
 			pos = strchr(host, ':');
 			if (pos != NULL) {
 				*pos = '\0';

+ 25 - 25
src/mod_lua_shared.inl

@@ -140,38 +140,38 @@ lua_shared_exchange(struct lua_State *L)
 static int
 lua_shared_push(struct lua_State *L)
 {
-	int val_type = lua_type(L, 1);
+    int val_type = lua_type(L, 1);
 
-	if ((val_type != LUA_TNUMBER) && (val_type != LUA_TSTRING)
-	    && (val_type != LUA_TBOOLEAN)) {
-		return luaL_error(L, "shared value must be string, number or boolean");
-	}
+    if ((val_type != LUA_TNUMBER) && (val_type != LUA_TSTRING)
+        && (val_type != LUA_TBOOLEAN)) {
+        return luaL_error(L, "shared value must be string, number or boolean");
+    }
 
-	pthread_mutex_lock(&lua_shared_lock);
+    pthread_mutex_lock(&lua_shared_lock);
 
-	lua_getglobal(L_shared, "shared");
-	lua_pushnumber(L_shared, num);
+    lua_getglobal(L_shared, "shared");
+    lua_pushnumber(L_shared, num);
 
-	if (val_type == LUA_TNUMBER) {
-		double num = lua_tonumber(L, 3);
-		lua_pushnumber(L_shared, num);
+    if (val_type == LUA_TNUMBER) {
+        double num = lua_tonumber(L, 3);
+        lua_pushnumber(L_shared, num);
 
-	} else if (val_type == LUA_TBOOLEAN) {
-		int i = lua_toboolean(L, 3);
-		lua_pushboolean(L_shared, i);
+    } else if (val_type == LUA_TBOOLEAN) {
+        int i = lua_toboolean(L, 3);
+        lua_pushboolean(L_shared, i);
 
-	} else {
-		size_t len = 0;
-		const char *str = lua_tolstring(L, 3, &len);
-		lua_pushlstring(L_shared, str, len);
-	}
+    } else {
+        size_t len = 0;
+        const char *str = lua_tolstring(L, 3, &len);
+        lua_pushlstring(L_shared, str, len);
+    }
 
-	lua_rawset(L_shared, -3);
-	lua_pop(L_shared, 1);
+    lua_rawset(L_shared, -3);
+    lua_pop(L_shared, 1);
 
-	pthread_mutex_unlock(&lua_shared_lock);
+    pthread_mutex_unlock(&lua_shared_lock);
 
-	return 0;
+    return 0;
 }
 */
 #endif
@@ -219,12 +219,12 @@ lua_shared_index(struct lua_State *L)
 				lua_pushcclosure(L, lua_shared_dec, 0);
 			} else if (0 == strcmp(str, "__exchange")) {
 				lua_pushcclosure(L, lua_shared_exchange, 0);
-                /*
+				/*
 			} else if (0 == strcmp(str, "__push")) {
 				lua_pushcclosure(L, lua_shared_push, 0);
 			} else if (0 == strcmp(str, "__pop")) {
 				lua_pushcclosure(L, lua_shared_pop, 0);
-                */
+				*/
 			} else
 #endif
 			{