MCPcopy Index your code
hub / github.com/assaultcube/AC / deferredprocessingthread

Function deferredprocessingthread

source/src/server.cpp:3053–3080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3051sl_semaphore servinfoauth_deferred(0, NULL);
3052
3053int deferredprocessingthread(void *nop)
3054{
3055 for(;;)
3056 {
3057 servinfoauth_deferred.wait();
3058 if(!servinfoauth_done && servinfoauths.length())
3059 {
3060 servinfoauth *sa = servinfoauths.remove();
3061 servinfoauth_dropbox = sa;
3062 sa->success = 0;
3063 switch(sa->type)
3064 {
3065 case SV_SERVINFO_RESPONSE:
3066 {
3067 if(!sa->wantauth) sa->success = 1;
3068 else if(sa->clientmsglen && ed25519_sign_check((uchar*)sa->clientmsg, sa->clientmsglen + 64, sa->clientpubkey))
3069 { // client message checks out, now sign the answer
3070 ed25519_sign((uchar*)sa->servermsg, NULL, (uchar*)sa->servermsg, sa->servermsglen, ssk);
3071 sa->success = 1;
3072 }
3073 break;
3074 }
3075 }
3076 servinfoauth_done = true;
3077 }
3078 }
3079 return 0;
3080}
3081
3082void polldeferredprocessing()
3083{

Callers

nothing calls this directly

Calls 5

ed25519_sign_checkFunction · 0.85
ed25519_signFunction · 0.85
waitMethod · 0.80
lengthMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected