Skip to content

Commit ffdc47e

Browse files
CDRIVER-4493 collect FaaS platform info in handshake metadata (#1340)
Include FaaS info (provider, timeout, memory, region) in handshake --------- Co-authored-by: Kevin Albertson <[email protected]>
1 parent 6d2be25 commit ffdc47e

12 files changed

+889
-232
lines changed

src/libbson/src/bson/bson.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,6 @@ bson_copy_to_excluding_noinit (const bson_t *src,
22962296
va_end (args);
22972297
}
22982298

2299-
23002299
void
23012300
bson_destroy (bson_t *bson)
23022301
{

src/libbson/src/bson/bson.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ bson_copy_to_excluding_noinit_va (const bson_t *src,
361361
const char *first_exclude,
362362
va_list args);
363363

364+
364365
/**
365366
* bson_destroy:
366367
* @bson: A bson_t.

src/libmongoc/src/mongoc/mongoc-handshake-private.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ typedef enum {
8585
LAST_MONGOC_MD_FLAG
8686
} mongoc_handshake_config_flag_bit_t;
8787

88+
typedef enum {
89+
MONGOC_HANDSHAKE_ENV_NONE,
90+
MONGOC_HANDSHAKE_ENV_AWS,
91+
MONGOC_HANDSHAKE_ENV_VERCEL,
92+
MONGOC_HANDSHAKE_ENV_GCP,
93+
MONGOC_HANDSHAKE_ENV_AZURE
94+
} mongoc_handshake_env_t;
95+
96+
typedef struct _optional_int32 {
97+
bool set;
98+
int32_t value;
99+
} optional_int32;
88100

89101
typedef struct _mongoc_handshake_t {
90102
char *os_type;
@@ -97,6 +109,11 @@ typedef struct _mongoc_handshake_t {
97109
char *platform;
98110
char *compiler_info;
99111
char *flags;
112+
113+
mongoc_handshake_env_t env;
114+
optional_int32 env_timeout_sec;
115+
optional_int32 env_memory_mb;
116+
char *env_region;
100117

101118
bool frozen;
102119
} mongoc_handshake_t;
@@ -107,8 +124,8 @@ _mongoc_handshake_init (void);
107124
void
108125
_mongoc_handshake_cleanup (void);
109126

110-
bool
111-
_mongoc_handshake_build_doc_with_application (bson_t *doc,
127+
bson_t *
128+
_mongoc_handshake_build_doc_with_application (
112129
const char *application);
113130

114131
void

0 commit comments

Comments
 (0)