Skip to content

Commit 671d5da

Browse files
author
Christian Hergert
committed
client: implement stream initiator.
Sorry Hannes!
1 parent 287800a commit 671d5da

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/mongoc/mongoc-client.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,3 +1322,22 @@ mongoc_client_get_server_status (mongoc_client_t *client, /* IN */
13221322

13231323
return ret;
13241324
}
1325+
1326+
1327+
void
1328+
mongoc_client_set_stream_initiator (mongoc_client_t *client,
1329+
mongoc_stream_initiator_t initiator,
1330+
void *user_data)
1331+
{
1332+
bson_return_if_fail (client);
1333+
1334+
if (!initiator) {
1335+
initiator = mongoc_client_default_stream_initiator;
1336+
user_data = client;
1337+
} else {
1338+
MONGOC_DEBUG ("Using custom stream initiator.");
1339+
}
1340+
1341+
client->initiator = initiator;
1342+
client->initiator_data = user_data;
1343+
}

0 commit comments

Comments
 (0)