Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocasazza committed Jul 25, 2017
1 parent a181674 commit b6ee1e7
Show file tree
Hide file tree
Showing 83 changed files with 2,306 additions and 1,961 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ cleandist:
$(distdir)/tests/examples/docroot/tmp \
$(distdir)/tests/examples/docroot/uploads \
$(distdir)/tests/examples/docroot/vuoto.txt \
$(distdir)/tests/examples/docroot/__BomB__.gz \
$(distdir)/tests/examples/docroot/www.sito1.com \
$(distdir)/tests/examples/ok/client_server.ok \
$(distdir)/tests/examples/ok/web_server_multiclient.ok \
Expand Down
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ cleandist:
$(distdir)/tests/examples/docroot/tmp \
$(distdir)/tests/examples/docroot/uploads \
$(distdir)/tests/examples/docroot/vuoto.txt \
$(distdir)/tests/examples/docroot/__BomB__.gz \
$(distdir)/tests/examples/docroot/www.sito1.com \
$(distdir)/tests/examples/ok/client_server.ok \
$(distdir)/tests/examples/ok/web_server_multiclient.ok \
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -7719,6 +7719,7 @@ else
CLANG_FALSE=
fi

gcc_version=`clang -dumpversion`
fi

ULIB_LIBS=
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ AC_MSG_RESULT([$GCC_IS_CLANG])
AM_CONDITIONAL(CLANG, false)
if test "$GCC_IS_CLANG" = "yes"; then
AM_CONDITIONAL(CLANG, true)
gcc_version=`clang -dumpversion`
fi

ULIB_LIBS=
Expand Down
4 changes: 2 additions & 2 deletions examples/IR/posting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ UPosting::UPosting(uint32_t dimension, bool parsing, bool index)

dimension += dimension / 4;

U_NEW(UHashMap<UString>, tbl_name, UHashMap<UString>(U_GET_NEXT_PRIME_NUMBER(dimension)));
U_NEW(UHashMap<UString>, tbl_words, UHashMap<UString>(U_GET_NEXT_PRIME_NUMBER(approximate_num_words), ignore_case));
U_NEW(UHashMap<UString>, tbl_name, UHashMap<UString>(u_nextPowerOfTwo64(dimension)));
U_NEW(UHashMap<UString>, tbl_words, UHashMap<UString>(u_nextPowerOfTwo64(approximate_num_words), ignore_case));
}

if (parsing)
Expand Down
6 changes: 3 additions & 3 deletions examples/PEC_log/PEC_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,11 +931,11 @@ bool PEC_report::readContent()

// month[3] = '\0';

day = atoi(ptr + 4);
day = u_atoi(ptr + 4);

if (rejected == false)
{
year = atoi(ptr + U_LINEDATA + 10);
year = u_atoi(ptr + U_LINEDATA + 10);

year_present = (year > 0); // check if year is present or not...

Expand Down Expand Up @@ -1348,7 +1348,7 @@ void PEC_report::manageOptions()
mittente = new UString;
identifier = new UString;

tfile = new UHashMap<UString>(U_GET_NEXT_PRIME_NUMBER(1024));
tfile = new UHashMap<UString>(1024);

if (rejected)
{
Expand Down
10 changes: 7 additions & 3 deletions examples/PEC_log/PEC_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,15 @@ class PEC_report : public UApplication {

static unsigned getMonth(const char* ptr)
{
U_TRACE(5, "PEC_report::getMonth(%p)", ptr)
U_TRACE(5, "PEC_report::getMonth(%20S)", ptr)

while (u__isspace(*ptr)) ++ptr;
if (u__istext(*ptr) &&
u__isspace(*ptr) == false)
{
return u_getMonth(ptr);
}

return u_getMonth(ptr);
return 0;
}

static bool setLine();
Expand Down
2 changes: 1 addition & 1 deletion examples/PEC_log/PEC_report_anomalie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void PEC_report_anomalie::processLine(bool bnew)
U_INTERNAL_DUMP("flag[U_OUTPUT] = %C", Messaggio::msg->flag[U_OUTPUT])

if (Messaggio::msg->flag[U_OUTPUT] == '0' &&
atoi(Messaggio::msg->vdestinatari_domini) == 0)
u_atoi(Messaggio::msg->vdestinatari_domini) == 0)
{
U_WARNING(U_ERROR_MESSAGE_INCORRECT_MESSAGE, U_STRING_TO_TRACE(*PEC_report::identifier));
}
Expand Down
2 changes: 1 addition & 1 deletion examples/PEC_log/PEC_report_anomalie1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class Application : public PEC_report_anomalie {

// setting for anomalie

table = new UHashMap<Messaggio*>(U_GET_NEXT_PRIME_NUMBER(max_size_table + MARGINE), true); // ignore case
table = new UHashMap<Messaggio*>(u_nextPowerOfTwo64(max_size_table + MARGINE), true); // ignore case

rdbname = new UString(100U);
Messaggio::id_max_ttl = new UString;
Expand Down
2 changes: 1 addition & 1 deletion examples/PEC_log/PEC_report_messaggi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class Application : public PEC_report {

// setting for messaggi

table = new UHashMap<VCasellaIdCounter*>(U_GET_NEXT_PRIME_NUMBER(16 * 1024), true); // ignore case
table = new UHashMap<VCasellaIdCounter*>(u_nextPowerOfTwo64(16 * 1024), true); // ignore case

PEC_report::parse = Application::parseLineForMessaggi;
PEC_report::change_file = Application::reportNumCaselle;
Expand Down
2 changes: 1 addition & 1 deletion examples/doc_classifier/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Application : public UApplication {

if (str_time.empty() == false)
{
DocumentClassifier::certsVerificationTime = UTimeDate::getSecondFromTime(str_time.data(), false, "%4d-%02d-%02d+%02d:%02d:%02d");
DocumentClassifier::certsVerificationTime = UTimeDate::getSecondFromDate(str_time.data(), false, U_NULLPTR, "%4d-%02d-%02d+%02d:%02d:%02d");

U_INTERNAL_DUMP("certsVerificationTime = %ld", DocumentClassifier::certsVerificationTime)
}
Expand Down
11 changes: 7 additions & 4 deletions examples/userver/userver.cfg.default
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,16 @@
# >1 - pool of process serialize plus monitoring process
#
# if PREFORK_CHILD is not defined is as case (>1) with num process the number of CPU in the system
#
# CRASH_COUNT this is the threshold for the number of crash of child server processes
# CRASH_EMAIL_NOTIFY the email address to send a message whenever the number of crash > CRASH_COUNT
# ----------------------------------------------------------------------------------------------------------------------------------------
# This directive are for evasive action in the event of an HTTP DoS or DDoS attack or brute force attack
# ----------------------------------------------------------------------------------------------------------------------------------------
# DOS_PAGE_COUNT this is the threshhold for the number of requests for the same page (or URI) per page interval
# DOS_PAGE_INTERVAL the interval for the page count threshhold; defaults to 1 second intervals
# DOS_SITE_COUNT this is the threshhold for the total number of requests for any object by the same client per site interval
# DOS_SITE_INTERVAL the interval for the site count threshhold; defaults to 1 second intervals
# DOS_PAGE_COUNT this is the threshold for the number of requests for the same page (or URI) per page interval
# DOS_PAGE_INTERVAL the interval for the page count threshold; defaults to 1 second intervals
# DOS_SITE_COUNT this is the threshold for the total number of requests for any object by the same client per site interval
# DOS_SITE_INTERVAL the interval for the site count threshold; defaults to 1 second intervals
# DOS_BLOCKING_PERIOD the blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list (defaults to 10)
# DOS_WHITE_LIST list of comma separated IP addresses of trusted clients can be whitelisted to insure they are never denied (IPADDR[/MASK])
# DOS_EMAIL_NOTIFY the email address to send a message whenever an IP address becomes blacklisted
Expand Down
11 changes: 7 additions & 4 deletions examples/userver/userver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,16 @@ class Application : public UApplication {
// PREFORK_CHILD number of child server processes created at startup ( 0 - serialize, no forking
// 1 - classic, forking after accept client)
// >1 - pool of process serialize plus monitoring process)
//
// CRASH_COUNT this is the threshold for the number of crash of child server processes
// CRASH_EMAIL_NOTIFY the email address to send a message whenever the number of crash > CRASH_COUNT
// ---------------------------------------------------------------------------------------------------------------------------------------
// This directive are for evasive action in the event of an HTTP DoS or DDoS attack or brute force attack
// ---------------------------------------------------------------------------------------------------------------------------------------
// DOS_PAGE_COUNT this is the threshhold for the number of requests for the same page (or URI) per page interval
// DOS_PAGE_INTERVAL the interval for the page count threshhold; defaults to 1 second intervals
// DOS_SITE_COUNT this is the threshhold for the total number of requests for any object by the same client per site interval
// DOS_SITE_INTERVAL the interval for the site count threshhold; defaults to 1 second intervals
// DOS_PAGE_COUNT this is the threshold for the number of requests for the same page (or URI) per page interval
// DOS_PAGE_INTERVAL the interval for the page count threshold; defaults to 1 second intervals
// DOS_SITE_COUNT this is the threshold for the total number of requests for any object by the same client per site interval
// DOS_SITE_INTERVAL the interval for the site count threshold; defaults to 1 second intervals
// DOS_BLOCKING_PERIOD the blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list (defaults to 10)
// DOS_WHITE_LIST list of comma separated IP addresses of trusted clients can be whitelisted to insure they are never denied (IPADDR[/MASK])
// DOS_EMAIL_NOTIFY the email address to send a message whenever an IP address becomes blacklisted
Expand Down
Loading

0 comments on commit b6ee1e7

Please sign in to comment.