From c952a9396a1843aa45d6afa3c6785dec607de112 Mon Sep 17 00:00:00 2001 From: Andy Schwerin Date: Mon, 20 Apr 2015 18:51:35 -0400 Subject: SERVER-18131 Clean up LastError. Makes LastError a decoration on Client. Removes behavior that was specific to the dbKillCursors wire protocol message into the processing for that message, and out of last error. Simplifies lifetime of LastError. It always exists on Clients, so there's no checking for its existence, and no passing it around through parts of the networking library. --- src/mongo/db/dbdirectclient.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/mongo/db/dbdirectclient.cpp') diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp index 41b75377060..3aee1750172 100644 --- a/src/mongo/db/dbdirectclient.cpp +++ b/src/mongo/db/dbdirectclient.cpp @@ -33,6 +33,7 @@ #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/instance.h" +#include "mongo/db/lasterror.h" #include "mongo/db/operation_context.h" #include "mongo/util/log.h" @@ -122,9 +123,7 @@ namespace mongo { bool assertOk, string* actualServer) { DirectClientScope directClientScope(_txn); - if (lastError._get()) { - lastError.startRequest(toSend, lastError._get()); - } + LastError::get(_txn->getClient()).startRequest(); DbResponse dbResponse; assembleResponse(_txn, toSend, dbResponse, dummyHost); @@ -139,9 +138,7 @@ namespace mongo { void DBDirectClient::say(Message& toSend, bool isRetry, string* actualServer) { DirectClientScope directClientScope(_txn); - if (lastError._get()) { - lastError.startRequest(toSend, lastError._get()); - } + LastError::get(_txn->getClient()).startRequest(); DbResponse dbResponse; assembleResponse(_txn, toSend, dbResponse, dummyHost); -- cgit v1.2.1