Don't shadow variables.

This commit is contained in:
Jordan Bancino 2023-02-05 14:19:07 +00:00
parent e1efac41fa
commit dc972385ea
2 changed files with 3 additions and 5 deletions

View file

@ -689,8 +689,6 @@ HttpServerEventThread(void *args)
/* Don't even accept connections if the queue is full. */
if (!QueueFull(server->connQueue))
{
FILE *fp;
connFd = accept(server->sd, (struct sockaddr *) & addr, &addrLen);
if (connFd < 0)

View file

@ -68,7 +68,7 @@ UserInteractiveAuth(HttpServerContext * context, Db * db,
{
HashMap *response = NULL;
HashMap *persist;
char *session = StrRandom(24);
char *sessionRand = StrRandom(24);
ref = DbLock(db, 1, "user_interactive");
if (!ref)
@ -77,14 +77,14 @@ UserInteractiveAuth(HttpServerContext * context, Db * db,
}
persist = DbJson(ref);
HashMapSet(persist, session, JsonValueNull());
HashMapSet(persist, sessionRand, JsonValueNull());
DbUnlock(db, ref);
HttpResponseStatus(context, HTTP_UNAUTHORIZED);
response = BuildDummyFlow();
HashMapSet(response, "session",
JsonValueString(StrDuplicate(session)));
JsonValueString(StrDuplicate(sessionRand)));
return response;
}