Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc139de3

Browse files
We don't need to use a ranom value for our ECHO liveness challenge.
A microsecond resolution timestamp combined with a monotonicallyincremented counter should be sufficient.This also fixes PHP 8.4 compilation as PHP 8.4 doesn't seem to have`php_rand()`.
1 parentdab6a62 commitc139de3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎library.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2886,11 +2886,13 @@ redis_sock_create(char *host, int host_len, int port,
28862886
}
28872887

28882888
staticintredis_uniqid(char*buf,size_tbuflen) {
2889+
staticunsigned longcounter=0;
28892890
structtimevaltv;
2891+
28902892
gettimeofday(&tv,NULL);
28912893

28922894
returnsnprintf(buf,buflen,"phpredis:%08lx%05lx:%08lx",
2893-
(long)tv.tv_sec, (long)tv.tv_usec,(long)php_rand());
2895+
(long)tv.tv_sec, (long)tv.tv_usec,counter++);
28942896
}
28952897

28962898
staticintredis_stream_liveness_check(php_stream*stream) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp