Skip to content

Commit

Permalink
Check in 1.7.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gwanglst committed Mar 28, 2024
1 parent df73ffe commit 7682e5d
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/extensions/proxy/proxyconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ int ProxyConn::sendReqHeader()

if (pSession->shouldIncludePeerAddr())
headerLen = addForwardedFor(pBegin);
if (pReq->isHeaderSet(HttpHeader::H_TRANSFER_ENCODING))
pReq->dropReqHeader(HttpHeader::H_TRANSFER_ENCODING);

#if 1 //always set "Accept-Encoding" header to "gzip"
char *pAE = (char *)pReq->getHeader(HttpHeader::H_ACC_ENCODING);
Expand Down
9 changes: 8 additions & 1 deletion src/http/httpreq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@ int HttpReq::processHeaderLines()
{
if (index == HttpHeader::H_HOST)
*((char *)pLineBegin + 3) = '2';
else if (index == HttpHeader::H_TRANSFER_ENCODING)
{
LS_INFO(getLogSession(), "Remove duplicate transfer-encoding header!");
memset((void *)pLineBegin, 'x', nameLen);
}
index = HttpHeader::H_HEADER_END;
}
}
Expand Down Expand Up @@ -1133,7 +1138,8 @@ int HttpReq::processHeader(int index)
LS_INFO(getLogSession(), "Status 400: bad Transfer-Encoding starts with ','!");
return SC_400;
}
if (strncasecmp(pCur, "chunked", 7) == 0)
if (strncasecmp(pCur, "chunked", 7) == 0
&& m_commonHeaderLen[index] == 7)
{
if (getMethod() <= HttpMethod::HTTP_HEAD)
return SC_400;
Expand Down Expand Up @@ -2759,6 +2765,7 @@ void HttpReq::tranEncodeToContentLen()
pBegin + 16 - m_headerBuf.begin();
m_commonHeaderLen[ HttpHeader::H_CONTENT_LENGTH] = n - 16;
m_lEntityLength = m_lEntityFinished;
m_commonHeaderOffset[HttpHeader::H_TRANSFER_ENCODING] = 0;
}


Expand Down
4 changes: 2 additions & 2 deletions src/http/httpvhost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ int HttpVHost::configNodeJsStarter(char *pRunnerCmd, int cmdLen,
const char *pBinPath)
{
const char *defaultBin[2] = { "/usr/local/bin/node", "/usr/bin/node" };
if (!pBinPath)
if (!pBinPath || !*pBinPath)
{
for (int i = 0; i < 2; ++i)
{
Expand All @@ -1972,7 +1972,7 @@ int HttpVHost::configNodeJsStarter(char *pRunnerCmd, int cmdLen,
}
}
}
if (!pBinPath)
if (!pBinPath || !*pBinPath)
{
LS_NOTICE("[%s] Cannot find node interpreter, node easy configuration "
"is turned off", TmpLogId::getLogId());
Expand Down
2 changes: 1 addition & 1 deletion src/http/stderrlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int StdErrLogger::setLogFileName(const char *pName)


const char *StdErrLogger::getLogFileName() const
{ return m_pAppender->getName(); }
{ return m_pAppender ? m_pAppender->getName() : NULL; }


int StdErrLogger::initLogger(Multiplexer *pMultiplexer)
Expand Down
2 changes: 1 addition & 1 deletion src/main/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4220,7 +4220,7 @@ int HttpServerImpl::initQuic(const XmlNode *pNode)
settings.es_max_sfcw = GET_VAL(pNode, "quicMaxSfcw", 64 * 1024,
128 * 1024 * 1024, 0);
settings.es_max_streams_in
= GET_VAL(pNode, "quicMaxIncomingStreams",
= GET_VAL(pNode, "quicMaxStreams",
10, 1000, 500);
settings.es_init_max_streams_bidi
= GET_VAL(pNode, "quicInitMaxIncomingStreamsBidi",
Expand Down
2 changes: 1 addition & 1 deletion src/main/lshttpdmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
/***
* Do not change the below format, it will be set correctly while packing the code
*/
#define BUILDTIME "built: Mon Feb 5 23:11:12 UTC 2024"
#define BUILDTIME "built: Thu Mar 28 14:44:42 UTC 2024"

static const char s_pVersionFull[] = "LiteSpeed/" PACKAGE_VERSION
" Open (" LS_MODULE_VERSION_INFO_ONELINE ") BUILD (" BUILDTIME ")";
Expand Down
2 changes: 1 addition & 1 deletion src/main/plainconf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ plainconfKeywords plainconf::sKeywords[] =
{"quicmaxcfcw", NULL},
{"quicsfcw", NULL},
{"quicmaxsfcw", NULL},
{"quicmaxincomingstreams", NULL},
{"quicmaxstreams", NULL},
{"quicInitMaxIncomingStreamsBidi", NULL},
{"quichandshaketimeout", NULL},
{"quicidletimeout", NULL},
Expand Down
18 changes: 13 additions & 5 deletions src/modules/cache/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ static void house_keeping_cb(const void *p)
{
pStore->houseKeeping();
pStore->cleanByTracking(100, 100);
g_api->log(NULL, LSI_LOG_DEBUG, "[%s]house_keeping_cb with store %p.\n",
ModuleNameStr, pStore);
//g_api->log(NULL, LSI_LOG_DEBUG, "[%s]house_keeping_cb with store %p.\n",
// ModuleNameStr, pStore);
}
}

Expand Down Expand Up @@ -834,7 +834,15 @@ static int32_t getVaryFlag(const lsi_session_t *session, CacheConfig *pConfig)
ModuleNameStr, (*iter)->len(), (*iter)->c_str());
continue;
}
flag |= (1 << index);
if (index == LSI_HDR_COOKIE)
g_api->log(session, LSI_LOG_DEBUG, "[%s] skip vary on full cookie header",
ModuleNameStr);
else
{ g_api->log(session, LSI_LOG_DEBUG, "[%s] add vary request header"
" \"%.*s\" with index %d.\n",
ModuleNameStr, (*iter)->len(), (*iter)->c_str(), index);
flag |= (1 << index);
}
}
}

Expand Down Expand Up @@ -2820,8 +2828,8 @@ static int checkAssignHandler(lsi_param_t *rec)
rec->session, &MNAME);
if (!pConfig)
{
g_api->log(rec->session, LSI_LOG_ERROR,
"[%s] checkAssignHandler config error.\n", ModuleNameStr);
g_api->log(rec->session, LSI_LOG_DEBUG,
"[%s] checkAssignHandler no configuration.\n", ModuleNameStr);
return bypassUrimapHook(rec, myData);
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/modsecurity-ls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ add_library(mod_security SHARED

target_link_libraries(mod_security libmodsecurity.a
-nodefaultlibs libstdc++.a
pthread rt -llmdb -lxml2 -lcurl -lGeoIP -lssl -lcrypto -lz -lpcre -lyajl
pthread rt -llmdb -lxml2 -lcurl -lssl -lcrypto -lz -lpcre -lyajl
${LIBSAN} crypt m gcc_eh c c_nonshared gcc)

set_target_properties(mod_security PROPERTIES PREFIX "")
2 changes: 1 addition & 1 deletion src/modules/modsecurity-ls/Makefile.f
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

LIBFLAGS := $(shell pwd)/ModSecurity/src/.libs/libmodsecurity.a -lxml2 -lcurl -lyajl
ifeq ($(BUILDSTATIC), 1)
ALLLIB := -nodefaultlibs $(shell g++ -print-file-name='libstdc++.a') -lm -lc -lssl -lcrypto -lpthread -lGeoIP -lz -lpcre -lyajl -lgcc_eh -lc_nonshared -lgcc
ALLLIB := -nodefaultlibs $(shell g++ -print-file-name='libstdc++.a') -lm -lc -lssl -lcrypto -lpthread -lz -lpcre -lyajl -lgcc_eh -lc_nonshared -lgcc
LIBFLAGS := -L$(shell pwd)/../../../../../../thirdparty/lib -lmodsecurity -lxml2 -lcurl -lyajl
endif

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ set ( libUnitTest UnitTest++ )
SET( unittestlib
modgzip cache lsiapi main http lsiapi ssi
registry cgi fcgi jk extensions lsapi proxy
socket sslpp lsshm thread log4cxx GeoIP adns
socket sslpp lsshm thread log4cxx adns
quic h2 lsquic bcrypt
-Wl,--whole-archive util lsr -Wl,--no-whole-archive
edio udns pthread rt ${CMAKE_DL_LIBS} ${libUnitTest} ${BSSL_ADD_LIB}
Expand Down

0 comments on commit 7682e5d

Please sign in to comment.