1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-12 15:54:27 +01:00

120 Commits

Author SHA1 Message Date
Klas Lindfors
3a85744814 limit how many queued entries we get on each run
if there's more than 1000 queued we will get another 1000 on the next
run.
2016-03-14 14:52:15 +01:00
Klas Lindfors
ba0d6fc193 put building syncurl in a function 2016-03-08 09:33:53 +01:00
Klas Lindfors
2a0f74c78d implement paralell syncing with curl_multi 2016-03-08 09:33:53 +01:00
Jean Paul Galea
5381074a73 Refactor out function into library. 2015-09-08 17:45:37 +02:00
Jean Paul Galea
0c3a48ee63 Don't set a default value for reSync argument.
- reSync() is only called in ykval-queue,
	and that sets an $older_than argument.

- additionally, the defaults did not match.

- the value in ykval-queue (via ykval-config) is 10 seconds,
	and the value in reSync($older_than=) was 60 seconds.

- no functional change, just makes things less confusing.
2015-08-18 11:25:15 +02:00
Jean Paul Galea
b417759932 Update copyright year. 2015-07-20 20:01:16 +00:00
Jean Paul Galea
5ed2f1d4d5 Refactor.
- negate test and return early.

- avoid wrapping whole function in `if () { }`.

- move $condition below $arr,
	since $arr is passwed first, then $condition, to conditionalUpdateBy().
2015-07-20 19:53:45 +00:00
Jean Paul Galea
3097d13629 Refactor. 2015-07-20 19:44:56 +00:00
Jean Paul Galea
16d8dfe6ac Refactor counter logic.
- break up into multiple if comparisons.
2015-07-18 00:46:17 +02:00
Jean Paul Galea
b4b44c4d04 Added helper comments. 2015-07-18 00:34:42 +02:00
Jean Paul Galea
7689fe4ba1 Cosmetic changes.
- method grouping.
2015-07-18 00:30:31 +02:00
Jean Paul Galea
0e6fe1e1e8 Change scope on private methods.
- mainly to help refactor,
	and avoid grep'ing globally.
2015-07-18 00:26:24 +02:00
Jean Paul Galea
635981f3d3 Set scopes on methods.
- confirmed to be used publically.
2015-07-18 00:16:03 +02:00
Jean Paul Galea
b3c5ecc724 Refactor.
- use single quotes where possible.
2015-07-18 00:05:32 +02:00
Jean Paul Galea
39ce50b772 Cosmetic changes. 2015-07-17 23:59:26 +02:00
Jean Paul Galea
23474aec31 Cosmetic changes. 2015-07-17 23:55:44 +02:00
Jean Paul Galea
ba160c9976 FIXME marker.
- probably should be '&local_counter' not ',local_counter'.

- check later as this is written to db and if we fix here,
	we might break other stuff.
2015-07-17 23:48:56 +02:00
Jean Paul Galea
47422f9c70 Cosmetic changes. 2015-07-17 23:46:54 +02:00
Jean Paul Galea
c865edcc15 Cosmetic changes. 2015-07-17 23:41:44 +02:00
Jean Paul Galea
645c5c5467 Fix bug.
- this was not introduced by my refactoring.

- LOG_ALERT message was incorrect,
	probably yy,p from counter block.
2015-07-17 23:38:17 +02:00
Jean Paul Galea
3aecc617c3 Fix bug.
- this was not introduced by my refactoring.

- LOG_ALERT for; yk_low, yk_high, nonce was written only
	if yk_use failed to be parsed.

- as a result, this commit might change LOG_ALERT output.
2015-07-17 23:35:15 +02:00
Jean Paul Galea
a0f57bd674 Cosmetic changes. 2015-07-17 23:33:29 +02:00
Jean Paul Galea
be4ee3116e Cosmetic changes. 2015-07-17 23:30:57 +02:00
Jean Paul Galea
60d1e7e302 Refactor away useless else { } wrap. 2015-07-17 23:27:43 +02:00
Jean Paul Galea
9869bfe84d Cosmetic changes. 2015-07-17 23:25:52 +02:00
Jean Paul Galea
afc81e484a Refactor away useless variable. 2015-07-17 23:22:27 +02:00
Jean Paul Galea
a20b0b69ae Cosmetic changes. 2015-07-17 23:21:22 +02:00
Jean Paul Galea
acfafc5d72 Refactor.
- be explicit and declare as public,
	since we're clearly using it.
2015-07-17 23:17:37 +02:00
Jean Paul Galea
5a272cf928 Refactor.
- remove unnecessary else { } wrap.
2015-07-17 23:07:17 +02:00
Jean Paul Galea
fd5391bb91 Cosmetic changes. 2015-07-17 23:06:21 +02:00
Jean Paul Galea
a0de5b9fd5 Refactor.
- str sub instead of concat
2015-07-17 23:03:40 +02:00
Jean Paul Galea
ef6adeb826 Cosmetic changes.
- adhere with some form of convetion for comments.

- use single quotes where possible.
2015-07-17 22:48:35 +02:00
Jean Paul Galea
13530c532f Cosmetic changes. 2015-07-17 22:38:43 +02:00
Jean Paul Galea
c5b6b3c567 Refactor.
- retrieveURLasync() always returns FALSE on failure now,
	before it might have returned a string.

- use array_shift($a) to pop first element,
	safer than $a[0];

- this commit might affect what is written to LOG_DEBUG,
	since now we only write the YK-KSM message when we
	are certain to have a valid response.
2015-07-17 22:25:42 +02:00
Jean Paul Galea
60a487a996 Cosmetic changes. 2015-07-17 22:12:59 +02:00
Jean Paul Galea
bc5319327b Unwrap function. 2015-07-16 22:35:34 +02:00
Jean Paul Galea
731eed8fa9 Refactor.
- syncServers was mostly always an array.

- change init value from NULL to array().

- simplify getNumberOfServers.
2015-07-16 22:31:51 +02:00
Jean Paul Galea
057eb0b563 Removed dead code, second try.
- grep with -i switch.

- left UnixToDbTime...
	will refactor later and unwrap to plain date()

- left timestamp* methods in ykval-db,
	not used but might be useful while refactoring other code.
2015-07-16 22:07:39 +02:00
Jean Paul Galea
b4f9bd4939 Revert "Removed dead code."
This reverts commit 29deb6007dd66a47ab9275687fcac140a228e404.

PHP functions are __not__ case-sensitive!
2015-07-16 15:44:35 +02:00
Jean Paul Galea
29deb6007d Removed dead code. 2015-07-16 14:26:14 +02:00
Jean Paul Galea
514b943945 Cosmetic changes.
- remove last remaining tabs,
	so now the whole file is using the same indentation convention.
2015-07-15 17:52:26 +02:00
Jean Paul Galea
2cc0f50257 Cosmetic changes.
- make it easier to read,
	even though we have a couple of long lines now...
2015-07-15 17:08:44 +02:00
Jean Paul Galea
dfdc4610d6 Refactor.
- make it easier to follow what is happenining in queue().
2015-07-15 17:01:51 +02:00
Jean Paul Galea
d5a56f6b8c Refactor updateDbCounters.
- make it easier to follow what is happening.
2015-07-15 16:46:45 +02:00
Jean Paul Galea
3b4735d34d Cosmetic changes. 2015-07-15 16:46:06 +02:00
Jean Paul Galea
6f74d8336b Refactor.
- removed unnecessary else,
	always return at end of function.
2015-07-15 16:24:04 +02:00
Jean Paul Galea
edf7ad632d Cosmetic changes.
- use spaces where possible.
2015-07-15 16:15:26 +02:00
Jean Paul Galea
a4a12d2f2d Refactor.
- remove wrapper which provides no help,
	just makes it harder to follow the code.
2015-07-15 15:44:29 +02:00
Jean Paul Galea
e76c5002f2 Drop php closing tags. 2015-07-15 15:14:25 +02:00
Jean Paul Galea
642c2a79d5 Reduce argument passing.
- set curlopts directly in wrapper invocation.
2015-04-14 09:26:56 +02:00