diff options
Diffstat (limited to 'src/mongo/util/net/message.cpp')
-rw-r--r-- | src/mongo/util/net/message.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/mongo/util/net/message.cpp b/src/mongo/util/net/message.cpp index 4d68aa01177..f2777cb7972 100644 --- a/src/mongo/util/net/message.cpp +++ b/src/mongo/util/net/message.cpp @@ -40,34 +40,33 @@ namespace mongo { - void Message::send( MessagingPort &p, const char *context ) { - if ( empty() ) { - return; - } - if ( _buf != 0 ) { - p.send( _buf, MsgData::ConstView(_buf).getLen(), context ); - } - else { - p.send( _data, context ); - } +void Message::send(MessagingPort& p, const char* context) { + if (empty()) { + return; } + if (_buf != 0) { + p.send(_buf, MsgData::ConstView(_buf).getLen(), context); + } else { + p.send(_data, context); + } +} - AtomicWord<MSGID> NextMsgId; - - /*struct MsgStart { - MsgStart() { - NextMsgId = (((unsigned) time(0)) << 16) ^ curTimeMillis(); - verify(MsgDataHeaderSize == 16); - } - } msgstart;*/ +AtomicWord<MSGID> NextMsgId; - MSGID nextMessageId() { - return NextMsgId.fetchAndAdd(1); +/*struct MsgStart { + MsgStart() { + NextMsgId = (((unsigned) time(0)) << 16) ^ curTimeMillis(); + verify(MsgDataHeaderSize == 16); } +} msgstart;*/ - bool doesOpGetAResponse( int op ) { - return op == dbQuery || op == dbGetMore; - } +MSGID nextMessageId() { + return NextMsgId.fetchAndAdd(1); +} + +bool doesOpGetAResponse(int op) { + return op == dbQuery || op == dbGetMore; +} -} // namespace mongo +} // namespace mongo |