1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
This commit is contained in:
stefanocasazza 2017-04-01 12:36:27 +02:00
parent 568419a451
commit 48d7ee4fb4
6 changed files with 58 additions and 21 deletions

View File

@ -72,7 +72,7 @@ The current version offers the following features :
## Who is Using ULib
It is the main software component of [city of Florence wireless network](http://wifi-aaa2.comune.fi.it/login?mac=00%3A00%3A00%3A00%3A00%3A00&ip=172.22.11.124&redirect=http%3A//pasta.dianxinos.com/api/data&gateway=159.213.248.230%3A5280&timeout=0&token=1810300063&ap=05@159.213.248.230&ts=21467819142)
It is the main software component of [city of Florence wireless network](http://wifi-aaa2.comune.fi.it/login?mac=00%3A00%3A00%3A00%3A00%3A00&ip=172.22.11.124&redirect=http%3A//pasta.dianxinos.com/api/data&gateway=159.213.248.230%3A5280&timeout=0&token=1810300063&ap=90@151.11.47.5&ts=2467819142)
## Benchmark

View File

@ -1169,15 +1169,14 @@ loop: pos = db_anagrafica->find(*ap_address, pos);
{
if (findLabel() == false)
{
if (binsert == false ||
ap_address_trust == false)
if (ap_address_trust == false) U_RETURN(false);
if (binsert)
{
U_RETURN(false);
op = RDB_REPLACE;
addAccessPoint(getNoConsumeFromAnagrafica());
}
op = RDB_REPLACE;
addAccessPoint(getNoConsumeFromAnagrafica());
}
if ( ap_hostname->empty()) *ap_hostname = hostname;

View File

@ -518,6 +518,22 @@ public:
U_RETURN(false);
}
static bool jfind(const UString& json, const char* query, uint32_t query_len, unsigned int& result)
{
U_TRACE(0, "UValue::jfind(%V,%.*S,%u,%p)", json.rep, query_len, query, query_len, &result)
UString x;
if (jfind(json, query, query_len, x))
{
result = u_strtoul(x.data(), x.pend());
U_RETURN(true);
}
U_RETURN(false);
}
static bool jfind(const UString& json, const char* query, uint32_t query_len, int64_t& result)
{
U_TRACE(0, "UValue::jfind(%V,%.*S,%u,%p)", json.rep, query_len, query, query_len, &result)
@ -534,7 +550,21 @@ public:
U_RETURN(false);
}
static bool jfind(const UString& json, const UString& query, int64_t& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const char* query, uint32_t query_len, uint64_t& result)
{
U_TRACE(0, "UValue::jfind(%V,%.*S,%u,%p)", json.rep, query_len, query, query_len, &result)
UString x;
if (jfind(json, query, query_len, x))
{
result = u_strtoull(x.data(), x.pend());
U_RETURN(true);
}
U_RETURN(false);
}
static bool jfind(const UString& json, const char* query, uint32_t query_len, double& result)
{
@ -552,10 +582,13 @@ public:
U_RETURN(false);
}
static bool jfind(const UString& json, const UString& query, UString& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, bool& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, int& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, double& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, UString& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, bool& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, int& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, unsigned int& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, int64_t& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, uint64_t& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
static bool jfind(const UString& json, const UString& query, double& result) { return jfind(json, U_STRING_TO_PARAM(query), result); }
// reads one value from an array

View File

@ -1322,19 +1322,20 @@ void UServer_Base::manageChangeOfSystemTime()
if (u_setStartTime() == false)
{
U_WARNING("System date update failed: %#5D", u_now->tv_sec);
return;
}
#if defined(U_LINUX) && defined(ENABLE_THREAD)
else
if (u_now_adjust_old != u_now_adjust &&
update_date)
{
if (u_now_adjust_old != u_now_adjust)
{
if (u_pthread_time) (void) U_SYSCALL(pthread_rwlock_wrlock, "%p", ULog::prwlock);
if (u_pthread_time) (void) U_SYSCALL(pthread_rwlock_wrlock, "%p", ULog::prwlock);
(void) u_strftime2(ULog::ptr_shared_date->date1, 17, U_CONSTANT_TO_PARAM("%d/%m/%y %T"), u_now->tv_sec + u_now_adjust);
(void) u_strftime2(ULog::ptr_shared_date->date2, 26, U_CONSTANT_TO_PARAM("%d/%b/%Y:%T %z"), u_now->tv_sec + u_now_adjust);
(void) u_strftime2(ULog::ptr_shared_date->date1, 17, U_CONSTANT_TO_PARAM("%d/%m/%y %T"), u_now->tv_sec + u_now_adjust);
(void) u_strftime2(ULog::ptr_shared_date->date2, 26, U_CONSTANT_TO_PARAM("%d/%b/%Y:%T %z"), u_now->tv_sec + u_now_adjust);
if (u_pthread_time) (void) U_SYSCALL(pthread_rwlock_unlock, "%p", ULog::prwlock);
}
if (u_pthread_time) (void) U_SYSCALL(pthread_rwlock_unlock, "%p", ULog::prwlock);
}
#endif
}

View File

@ -9151,6 +9151,8 @@ bool UHTTP::getCGIEnvironment(UString& environment, int type)
sz = UClientImage_Base::request_uri->size();
ptr = UClientImage_Base::request_uri->data();
(void) buffer.reserve(2000U + sz * 2);
if (U_http_info.query_len &&
(type & U_SHELL) == 0)
{

View File

@ -59,6 +59,8 @@ DIR_CMD="../../examples/userver"
#STRACE=$TRUSS
start_prg_background userver_ssl -c inp/webserver.cfg
wait_server_ready localhost 443
#$SLEEP
#kill_prg userver_ssl TERM