forked from Telodendria/Telodendria
Don't shadow variables.
This commit is contained in:
parent
e1efac41fa
commit
dc972385ea
2 changed files with 3 additions and 5 deletions
|
@ -689,8 +689,6 @@ HttpServerEventThread(void *args)
|
||||||
/* Don't even accept connections if the queue is full. */
|
/* Don't even accept connections if the queue is full. */
|
||||||
if (!QueueFull(server->connQueue))
|
if (!QueueFull(server->connQueue))
|
||||||
{
|
{
|
||||||
FILE *fp;
|
|
||||||
|
|
||||||
connFd = accept(server->sd, (struct sockaddr *) & addr, &addrLen);
|
connFd = accept(server->sd, (struct sockaddr *) & addr, &addrLen);
|
||||||
|
|
||||||
if (connFd < 0)
|
if (connFd < 0)
|
||||||
|
|
|
@ -68,7 +68,7 @@ UserInteractiveAuth(HttpServerContext * context, Db * db,
|
||||||
{
|
{
|
||||||
HashMap *response = NULL;
|
HashMap *response = NULL;
|
||||||
HashMap *persist;
|
HashMap *persist;
|
||||||
char *session = StrRandom(24);
|
char *sessionRand = StrRandom(24);
|
||||||
|
|
||||||
ref = DbLock(db, 1, "user_interactive");
|
ref = DbLock(db, 1, "user_interactive");
|
||||||
if (!ref)
|
if (!ref)
|
||||||
|
@ -77,14 +77,14 @@ UserInteractiveAuth(HttpServerContext * context, Db * db,
|
||||||
}
|
}
|
||||||
|
|
||||||
persist = DbJson(ref);
|
persist = DbJson(ref);
|
||||||
HashMapSet(persist, session, JsonValueNull());
|
HashMapSet(persist, sessionRand, JsonValueNull());
|
||||||
DbUnlock(db, ref);
|
DbUnlock(db, ref);
|
||||||
|
|
||||||
HttpResponseStatus(context, HTTP_UNAUTHORIZED);
|
HttpResponseStatus(context, HTTP_UNAUTHORIZED);
|
||||||
response = BuildDummyFlow();
|
response = BuildDummyFlow();
|
||||||
|
|
||||||
HashMapSet(response, "session",
|
HashMapSet(response, "session",
|
||||||
JsonValueString(StrDuplicate(session)));
|
JsonValueString(StrDuplicate(sessionRand)));
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue