1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

src/Cedar/Protocol.c: remove logically dead code

found by coverity
This commit is contained in:
Ilya Shipitsin 2018-08-12 16:15:53 +05:00
parent e302cb5f74
commit 981e8d0e77

View File

@ -6112,51 +6112,12 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str)
{ {
// Root directory // Root directory
SERVER *s = c->Cedar->Server; SERVER *s = c->Cedar->Server;
bool is_free = false;
*error_detail_str = "HTTP_ROOT"; *error_detail_str = "HTTP_ROOT";
{ {
if (is_free == false) // Other than free version
{ HttpSendForbidden(c->FirstSock, h->Target, "");
// Other than free version
HttpSendForbidden(c->FirstSock, h->Target, "");
}
else
{
// Free version
BUF *b = ReadDump("|free.htm");
if (b != NULL)
{
char *src = ZeroMalloc(b->Size + 1);
UINT dst_size = b->Size * 2 + 64;
char *dst = ZeroMalloc(dst_size);
char host[MAX_PATH];
char portstr[64];
GetMachineName(host, sizeof(host));
ToStr(portstr, c->FirstSock->LocalPort);
Copy(src, b->Buf, b->Size);
ReplaceStrEx(dst, dst_size, src,
"$HOST$", host, false);
ReplaceStrEx(dst, dst_size, dst,
"$PORT$", portstr, false);
FreeHttpHeader(h);
h = NewHttpHeader("HTTP/1.1", "202", "OK");
AddHttpValue(h, NewHttpValue("Content-Type", HTTP_CONTENT_TYPE4));
AddHttpValue(h, NewHttpValue("Connection", "Keep-Alive"));
AddHttpValue(h, NewHttpValue("Keep-Alive", HTTP_KEEP_ALIVE));
PostHttp(c->FirstSock, h, dst, StrLen(dst));
Free(src);
Free(dst);
FreeBuf(b);
}
}
} }
} }
else else