Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
stefanocasazza committed Apr 11, 2020
1 parent 64c60ba commit ca1ad76
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 5 additions & 4 deletions examples/WiAuth/v2/wi_auth_declaration2.h
Original file line number Diff line number Diff line change
@@ -37,8 +37,9 @@ static uint64_t counter, device_counter, max_traffic_daily;
static uint8_t policySessionNotify, policySessionNotifyDefault;
static uint32_t addr, old_addr, ip_peer, created, lastUpdate, lastReset, idx, duration_privacy_policy, vec_logout[8192];

#define U_CLEAN_INTERVAL (60U * 60U) // 1h
#define U_MAX_TIME_NO_TRAFFIC (15U * 60U) // 15m
#define U_CLEAN_INTERVAL (60U * 60U) // 1h
#define U_MAX_TIME_NO_TRAFFIC (15U * 60U) // 15m
#define U_MAX_ELAPSED_TIME (100000U * 60U) // 69g

#define U_LOGGER(fmt,args...) ULog::log(file_WARNING->getFd(), U_CONSTANT_TO_PARAM("%v: " fmt), UClientImage_Base::request_uri->rep , ##args)

@@ -702,9 +703,9 @@ static void writeSessionToLOG(const UString& lmac, const UString& label, const c

UString opt(200U);

uint32_t elapsed = u_now->tv_sec - created;
uint32_t elapsed = (u_now->tv_sec > created ? u_now->tv_sec - created : 0);

if (elapsed > U_ONE_DAY_IN_SECOND) elapsed = U_ONE_DAY_IN_SECOND;
if (elapsed > U_MAX_ELAPSED_TIME) elapsed = U_MAX_ELAPSED_TIME;

opt.snprintf(U_CONSTANT_TO_PARAM(", traffic: %llu, elapsed: %u"), counter/1024, elapsed/60);

2 changes: 1 addition & 1 deletion include/ulib/container/vector.h
Original file line number Diff line number Diff line change
@@ -1023,7 +1023,7 @@ template <> class U_EXPORT UVector<UString> : public UVector<UStringRep*> {
UVector<void*>::move(source); // add to end and reset source
}

explicit UVector(const UVector<UString>& source) : UVector(source._length)
explicit UVector(const UVector<UString>& source) : UVector<UStringRep*>(source._length)
{
U_TRACE_CTOR(0, UVector<UString>, "copy ctor")

4 changes: 4 additions & 0 deletions src/ulib/ssl/net/sslsocket.cpp
Original file line number Diff line number Diff line change
@@ -1058,7 +1058,11 @@ int USSLSocket::SPKIPinVerification(X509_STORE_CTX* context, void *arg)

UString *tls_pin = (UString *)arg;

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
STACK_OF(X509) *certChain = X509_STORE_CTX_get0_untrusted(context);
#else
STACK_OF(X509) *certChain; // TODO
#endif

X509 *workingCert = NULL;
bool result = false;

0 comments on commit ca1ad76

Please sign in to comment.