0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

start cleaning clientId handling - fixes dups case

This commit is contained in:
Eliot Horowitz 2010-09-14 21:51:13 -04:00
parent 8c82a9c5c6
commit 8d53011001
2 changed files with 1 additions and 10 deletions

View File

@ -660,7 +660,6 @@ namespace mongo {
MSGID NextMsgId;
bool usingClientIds = 0;
ThreadLocalValue<int> clientId;
struct MsgStart {
@ -672,12 +671,6 @@ namespace mongo {
MSGID nextMessageId(){
MSGID msgid = NextMsgId++;
if ( usingClientIds ){
msgid = msgid & 0xFFFF;
msgid = msgid | clientId.get();
}
return msgid;
}
@ -686,9 +679,6 @@ namespace mongo {
}
void setClientId( int id ){
usingClientIds = true;
id = id & 0xFFFF0000;
massert( 10445 , "invalid id" , id );
clientId.set( id );
}

View File

@ -86,6 +86,7 @@ namespace mongo {
virtual int getClientId(){
int x = remotePort();
x = x << 16;
x |= ( 0xFF & (long long)this );
return x;
}
};