Conversation
src/cmd/cmd.cpp
Outdated
| #endif | ||
|
|
||
| qsrand(QTime::currentTime().msec() * QCoreApplication::applicationPid()); | ||
| qsrand(QDateTime::currentMSecsSinceEpoch()); |
There was a problem hiding this comment.
Why did you remove this? I remember this was be added for smashbox doing parallel testing which had before this lead to duplicate transferids used in chunking
There was a problem hiding this comment.
Oh, makes sense to leave in the pid then. My complaint was that msec() just has values between 0-999.
|
@ogoffart QUuid has curly braces, which can't appear. And not being limited to hex digits allows for shorter ids. Will update. |
|
People on the internet seem to be using this header with smaller values separated by dashes.. (looks UUIDish..) but no braces.. |
src/cmd/cmd.cpp
Outdated
There was a problem hiding this comment.
could this overflow? both calls return (signed) qint64
Epoch should be ~40 bits and i don't know how many bits is PID on windows for example.
could be worth casting to unsiged.
I would suggest qHash(QDateTime::currentMSecsSinceEpoch()) ^ qhash(QCoreApplication::applicationPid())
|
Uuid is perfect as request id. |
|
We could allow curly braces on the server side. Discuss with @PVince81 or @tomneedham while I am on vacation ;-) |
|
Oh and yes, the request id must be uniqe for every request so it can be logged and traced through the whole server side stack. |
No description provided.