Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ private InternalConnectionInitializationDescription createInitializationDescript

private BsonDocument createHelloCommand(final Authenticator authenticator, final InternalConnection connection) {
BsonDocument helloCommandDocument = new BsonDocument(getHandshakeCommandName(), new BsonInt32(1))
.append("helloOk", BsonBoolean.TRUE);
.append("helloOk", BsonBoolean.TRUE)
.append("backpressure", BsonBoolean.TRUE);
if (clientMetadataDocument != null) {
helloCommandDocument.append("client", clientMetadataDocument);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class InternalStreamConnectionInitializerSpecification extends Specification {
def initializer = new InternalStreamConnectionInitializer(SINGLE, null, clientMetadataDocument, [], null)
def expectedHelloCommandDocument = new BsonDocument(LEGACY_HELLO, new BsonInt32(1))
.append('helloOk', BsonBoolean.TRUE)
.append('backpressure', BsonBoolean.TRUE)
.append('\$db', new BsonString('admin'))
if (clientMetadataDocument != null) {
expectedHelloCommandDocument.append('client', clientMetadataDocument)
Expand Down Expand Up @@ -233,6 +234,7 @@ class InternalStreamConnectionInitializerSpecification extends Specification {
def initializer = new InternalStreamConnectionInitializer(SINGLE, null, null, compressors, null)
def expectedHelloCommandDocument = new BsonDocument(LEGACY_HELLO, new BsonInt32(1))
.append('helloOk', BsonBoolean.TRUE)
.append('backpressure', BsonBoolean.TRUE)
.append('\$db', new BsonString('admin'))

def compressionArray = new BsonArray()
Expand Down Expand Up @@ -403,7 +405,8 @@ class InternalStreamConnectionInitializerSpecification extends Specification {
((SpeculativeAuthenticator) authenticator).getSpeculativeAuthenticateResponse() == null
((SpeculativeAuthenticator) authenticator)
.createSpeculativeAuthenticateCommand(internalConnection) == null
BsonDocument.parse("{$LEGACY_HELLO: 1, helloOk: true, '\$db': 'admin'}") == decodeCommand(internalConnection.getSent()[0])
BsonDocument.parse("{$LEGACY_HELLO: 1, helloOk: true, backpressure: true, '\$db': 'admin'}") ==
decodeCommand(internalConnection.getSent()[0])

where:
async << [true, false]
Expand Down Expand Up @@ -500,7 +503,7 @@ class InternalStreamConnectionInitializerSpecification extends Specification {

def createHelloCommand(final String firstClientChallenge, final String mechanism,
final boolean hasSaslSupportedMechs) {
String hello = "{$LEGACY_HELLO: 1, helloOk: true, " +
String hello = "{$LEGACY_HELLO: 1, helloOk: true, backpressure: true, " +
(hasSaslSupportedMechs ? 'saslSupportedMechs: "database.user", ' : '') +
(mechanism == 'MONGODB-X509' ?
'speculativeAuthenticate: { authenticate: 1, ' +
Expand Down