Skip to content

Commit

Permalink
2.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PEPSIMANTR committed Feb 18, 2024
1 parent 8d034ec commit 047240f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Alyssa.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,5,1,0
PRODUCTVERSION 2,5,1,0
FILEVERSION 2,5,2,0
PRODUCTVERSION 2,5,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Alyssa Software"
VALUE "FileDescription", "Alyssa HTTP Server Project"
VALUE "FileVersion", "2.5.1"
VALUE "FileVersion", "2.5.2"
VALUE "InternalName", "AlyssaHTTP.exe"
VALUE "LegalCopyright", "Copyright (C) 2024 Alyssa Software - GPLv3 Licensed"
VALUE "OriginalFilename", "AlyssaHTTP.exe"
VALUE "ProductName", "Alyssa HTTP Server Project"
VALUE "ProductVersion", "2.5.1"
VALUE "ProductVersion", "2.5.2"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Alyssa HTTP Server Changelog

## 2.5.2 - 18.02.2024
- Potential fix to crash caused by SSL on some requests
- Connections with SSL now will be logged as '(SSL)' on log file.

## 2.5.1 - 16.02.2024
- Fixed the integer overflow on code that causes infinite loop, and eventually using all of CPU
- Problem was happening with long requests. Now limit of request paths are increased to 32768 bytes
Expand Down
4 changes: 2 additions & 2 deletions src/Alyssa.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ static const char* MsgTypeStr[] = { "Error: ","Warning: ","Info: " };
#endif
#else
#ifdef _DEBUG
static std::string version = "2.5.1d";
static std::string version = "2.5.2d";
#else
static std::string version = "2.5.1";
static std::string version = "2.5.2";
#endif
#endif
#ifdef _WIN32
Expand Down
4 changes: 2 additions & 2 deletions src/AlyssaH2.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class AlyssaHTTP2 {
}
static void Get(H2Stream* s);
static bool __AlyssaH2ParsePath(H2Stream* s, std::string& Value) {
uint8_t pos = -1;
uint16_t pos = -1;
// Decode percents
pos = Value.size();
for (char t = 0; t < pos; t++) {
Expand All @@ -129,7 +129,7 @@ class AlyssaHTTP2 {
Value.resize(pos);
// Query string
pos = Value.find('?');
if (pos != 255) {
if (pos != 65535) {
unsigned char _sz = Value.size();
s->cl.qStr.resize(_sz - pos); memcpy(s->cl.qStr.data(), &Value[pos + 1], _sz - pos - 1);
Value.resize(pos);
Expand Down
6 changes: 3 additions & 3 deletions src/AlyssaHTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ int8_t AlyssaHTTP::parseHeader(clientInfo* cl, char* buf, int sz) {
ServerHeadersM(cl, 403); return -3;
}
else if (VirtualHosts[i].Type == 3) { // "Hang-up" virtual host
closesocket(cl->Sr->sock);
if (logging) AlyssaLogging::literal(cl->Sr->clhostname + " -> " + VirtualHosts[i].Hostname + cl->RequestPath + " rejected and hung-up.", 'C');
shutdown(cl->Sr->sock, 2);
if (logging) AlyssaLogging::literal(((cl->Sr->ssl) ? "(SSL)" : "") + cl->Sr->clhostname + " -> " + VirtualHosts[i].Hostname + cl->RequestPath + " rejected and hung-up.", 'C');
return -3;// No clean shutdown or anything, we just say fuck off to client.
}
break;
Expand All @@ -274,7 +274,7 @@ int8_t AlyssaHTTP::parseHeader(clientInfo* cl, char* buf, int sz) {
ServerHeadersM(cl, 403); return -3;
}
else if (VirtualHosts[0].Type == 3) {
closesocket(cl->Sr->sock);
shutdown(cl->Sr->sock, 2);
if (logging) AlyssaLogging::literal(cl->Sr->clhostname + " -> " + cl->host + cl->RequestPath + " rejected and hung-up.", 'C');
return -3;
}
Expand Down
5 changes: 3 additions & 2 deletions src/AlyssaLogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ namespace AlyssaLogging {
std::terminate();
}
logMutex.lock();
Log << "C [" << currentTime() << "] (" << statusCode << ") "
<< cl->Sr->clhostname << " -> "<< cl->host << cl->RequestPath
Log << "C [" << currentTime() << "] (" << statusCode <<
((cl->Sr->ssl) ? ") (SSL) '" : ") '")
<< cl->Sr->clhostname << "' -> "<< cl->host << cl->RequestPath
<< std::endl;
logMutex.unlock();
}
Expand Down

0 comments on commit 047240f

Please sign in to comment.