فهرست منبع

Fix indentation to use tabs instead of spaces.

Alex Szpakowski 6 سال پیش
والد
کامیت
cbd1653741
2فایلهای تغییر یافته به همراه44 افزوده شده و 44 حذف شده
  1. 32 32
      src/lua/main.cpp
  2. 12 12
      src/macos/NSURLClient.mm

+ 32 - 32
src/lua/main.cpp

@@ -121,38 +121,38 @@ static int w_request(lua_State *L)
 		lua_pop(L, 1);
 	}
 
-    for (size_t i = 0; clients[i]; ++i)
-    {
-        HTTPSClient &client = *clients[i];
-        if (!client.valid())
-            continue;
-
-        auto reply = client.request(req);
-        lua_pushinteger(L, reply.responseCode);
-        w_pushstring(L, reply.body);
-
-        if (advanced)
-        {
-            lua_newtable(L);
-            for (const auto &header : reply.headers)
-            {
-                w_pushstring(L, header.first);
-                w_pushstring(L, header.second);
-                lua_settable(L, -3);
-            }
-        }
-
-        foundClient = true;
-        break;
-    }
-
-    if (!foundClient)
-    {
-        lua_pushnil(L);
-        lua_pushstring(L, "No applicable implementation found");
-        if (advanced)
-            lua_pushnil(L);
-    }
+	for (size_t i = 0; clients[i]; ++i)
+	{
+		HTTPSClient &client = *clients[i];
+		if (!client.valid())
+			continue;
+
+		auto reply = client.request(req);
+		lua_pushinteger(L, reply.responseCode);
+		w_pushstring(L, reply.body);
+
+		if (advanced)
+		{
+			lua_newtable(L);
+			for (const auto &header : reply.headers)
+			{
+				w_pushstring(L, header.first);
+				w_pushstring(L, header.second);
+				lua_settable(L, -3);
+			}
+		}
+
+		foundClient = true;
+		break;
+	}
+
+	if (!foundClient)
+	{
+		lua_pushnil(L);
+		lua_pushstring(L, "No applicable implementation found");
+		if (advanced)
+			lua_pushnil(L);
+	}
 
 	return advanced ? 3 : 2;
 }

+ 12 - 12
src/macos/NSURLClient.mm

@@ -39,25 +39,25 @@ HTTPSClient::Reply NSURLClient::request(const HTTPSClient::Request &req)
 	}
 
 	for (auto &header : req.headers)
-		[request setValue: toNSString(header.second) forHTTPHeaderField: toNSString(header.first)];
+		[request setValue:toNSString(header.second) forHTTPHeaderField:toNSString(header.first)];
 
 	__block NSHTTPURLResponse *response = nil;
 	__block NSError *error = nil;
-    __block NSData *body = nil;
+	__block NSData *body = nil;
 
-    dispatch_semaphore_t sem = dispatch_semaphore_create(0);
+	dispatch_semaphore_t sem = dispatch_semaphore_create(0);
 
-    NSURLSessionTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
-        completionHandler:^(NSData *data, NSURLResponse *resp, NSError *err) {
-            body = data;
-            response = (NSHTTPURLResponse *)resp;
-            error = err;
-            dispatch_semaphore_signal(sem);
-    }];
+	NSURLSessionTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
+		completionHandler:^(NSData *data, NSURLResponse *resp, NSError *err) {
+			body = data;
+			response = (NSHTTPURLResponse *)resp;
+			error = err;
+			dispatch_semaphore_signal(sem);
+	}];
 
-    [task resume];
+	[task resume];
 
-    dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
+	dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
 
 	HTTPSClient::Reply reply;
 	reply.responseCode = 400;