Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocasazza committed Jul 26, 2017
1 parent b6ee1e7 commit 01e5f28
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/ulib/net/server/client_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,9 @@ int UClientImage_Base::handlerWrite()

if (U_ClientImage_parallelization == U_PARALLELIZATION_CHILD)
{
wait: if (UNotifier::waitForWrite(socket->iSockDesc, U_TIMEOUT_MS) == 1) goto write;
wait: if (socket->isOpen() == false) goto end;

if (UNotifier::waitForWrite(socket->iSockDesc, U_TIMEOUT_MS) == 1) goto write;

U_RETURN(U_NOTIFIER_DELETE);
}
Expand All @@ -1986,6 +1988,7 @@ wait: if (UNotifier::waitForWrite(socket->iSockDesc, U_TIMEOUT_MS) == 1) goto
U_RETURN(U_NOTIFIER_OK);
}

end:
U_SRV_LOG("sendfile failed - sock_fd %d sfd %d count %u U_ClientImage_pclose(this) %d %B", socket->iSockDesc, sfd, count, U_ClientImage_pclose(this), U_ClientImage_pclose(this));

if ((U_ClientImage_pclose(this) & U_CLOSE) != 0) UFile::close(sfd);
Expand Down
4 changes: 2 additions & 2 deletions src/ulib/net/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2038,10 +2038,10 @@ void UServer_Base::loadConfigParam()
#ifdef U_EVASIVE_SUPPORT
/**
* This is the threshold for the number of requests for the same page (or URI) per page interval.
* Once the threshold for that interval has been exceeded (defaults to 3), the IP address of the client will be added to the blocking list
* Once the threshold for that interval has been exceeded (defaults to 2), the IP address of the client will be added to the blocking list
*/

page_count = cfg->readLong(U_CONSTANT_TO_PARAM("DOS_PAGE_COUNT"), 3);
page_count = cfg->readLong(U_CONSTANT_TO_PARAM("DOS_PAGE_COUNT"), 2);

/**
* The interval for the page count threshold; defaults to 1 second intervals
Expand Down
2 changes: 2 additions & 0 deletions src/ulib/utility/uhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3973,6 +3973,8 @@ int UHTTP::handlerREAD()

if (UClientImage_Base::bsendGzipBomp)
{
UClientImage_Base::bsendGzipBomp = false;

U_DEBUG("we strike back sending gzip bomb...", 0);

U_SRV_LOG("we strike back sending gzip bomb...", 0);
Expand Down
2 changes: 2 additions & 0 deletions tests/ulib/test_ssl_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class USSLClientImage : public UClientImage<USSLSocket> {
{
x509 = ((USSLSocket*)socket)->getPeerCertificate();

# if OPENSSL_VERSION_NUMBER < 0x10100000L
U_INTERNAL_ASSERT_DIFFERS(x509, 0)
# endif
}

if (x509) cerr << UCertificate(x509).print();
Expand Down

0 comments on commit 01e5f28

Please sign in to comment.