-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
493e28d
commit 1b6ce8e
Showing
81 changed files
with
5,435 additions
and
1,224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,3 +101,9 @@ Comments and suggestions are welcome. | |
stefano casazza <[email protected]> | ||
|
||
Please, excuse me for my bad english, it's not my natural language, if some parts of this page seems wrong to you, feel free to suggest me better ones. | ||
|
||
## Donation | ||
|
||
If this project help you reduce time to develop, you can give me a cup of coffee :) | ||
|
||
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/stefanocasazza) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// cdbmake.cpp | ||
|
||
#include <ulib/db/cdb.h> | ||
#include <ulib/net/server/server.h> | ||
#include <ulib/utility/string_ext.h> | ||
|
||
#undef PACKAGE | ||
|
@@ -27,9 +28,20 @@ class Application : public UApplication { | |
|
||
UApplication::run(argc, argv, env); | ||
|
||
UString records = UFile::contentOf(UString(argv[optind])); | ||
uint32_t len; | ||
const char* path_of_record_file = argv[optind]; | ||
|
||
if (path_of_record_file == U_NULLPTR || | ||
(len = u__strlen(path_of_record_file, __PRETTY_FUNCTION__)) == 0) | ||
{ | ||
U_ERROR("missing <path_of_record_file> argument"); | ||
} | ||
|
||
UString filename = UString(path_of_record_file, len); | ||
|
||
# ifdef U_STDCPP_ENABLE | ||
UString records = UFile::contentOf(filename); | ||
|
||
if (records) | ||
{ | ||
UCDB x(false); | ||
|
@@ -38,9 +50,7 @@ class Application : public UApplication { | |
x.UFile::ftruncate(UCDB::sizeFor(1) + records.size() * 2) && | ||
x.UFile::memmap(PROT_READ | PROT_WRITE)) | ||
{ | ||
const char* bcheck = argv[++optind]; | ||
|
||
if (bcheck) | ||
if (argv[++optind]) | ||
{ | ||
// +11,10:[email protected]>0 10.8.1.5 | ||
// .... | ||
|
@@ -86,6 +96,17 @@ class Application : public UApplication { | |
records = output; | ||
} | ||
|
||
UString basename = UStringExt::basename(filename); | ||
|
||
const char* p = basename.data(); | ||
|
||
# ifdef U_EVASIVE_SUPPORT | ||
if (memcmp(p, U_CONSTANT_TO_PARAM("Evasive")) == 0) UCDB::getValueFromBuffer = UServer_Base::getEvasiveRecFromBuffer; | ||
# endif | ||
# ifdef U_THROTTLING_SUPPORT | ||
if (memcmp(p, U_CONSTANT_TO_PARAM("BandWidthThrottling")) == 0) UCDB::getValueFromBuffer = UServer_Base::getThrottlingRecFromBuffer; | ||
# endif | ||
|
||
istrstream is(U_STRING_TO_PARAM(records)); | ||
|
||
is >> x; // NB: this do ftruncate() e munmap()... | ||
|
Oops, something went wrong.