Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
5 changes: 3 additions & 2 deletions src/libmongoc/src/mongoc/mcd-azure.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <mongoc/mongoc-util-private.h>

#include <mlib/cmp.h>
#include <mlib/duration.h>

#define AZURE_API_VERSION "2018-02-01"

Expand Down Expand Up @@ -132,7 +133,7 @@ mcd_azure_access_token_try_init_from_json_str(mcd_azure_access_token *out,
mlib_in_range(int, expires_in_len) ? (int)expires_in_len : INT_MAX,
expires_in_str);
} else {
out->expires_in = mcd_seconds(s);
out->expires_in = mlib_duration(s, s);
okay = true;
}
}
Expand Down Expand Up @@ -174,7 +175,7 @@ mcd_azure_access_token_from_imds(mcd_azure_access_token *const out,
mcd_azure_imds_request req = MCD_AZURE_IMDS_REQUEST_INIT;
mcd_azure_imds_request_init(&req, opt_imds_host, opt_port, opt_extra_headers);

if (!_mongoc_http_send(&req.req, 3 * 1000, false, NULL, &resp, error)) {
if (!_mongoc_http_send(&req.req, mlib_duration(3, s), false, NULL, &resp, error)) {
goto fail;
}

Expand Down
5 changes: 3 additions & 2 deletions src/libmongoc/src/mongoc/mcd-azure.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

#include <mongoc/mongoc-http-private.h>

#include <mongoc/mcd-time.h>
#include <mongoc/mongoc.h>

#include <mlib/duration.h>

/**
* @brief An Azure OAuth2 access token obtained from the Azure API
*/
Expand All @@ -36,7 +37,7 @@ typedef struct mcd_azure_access_token {
char *token_type;
/// The duration after which it will the token will expires. This is relative
/// to the "issue time" of the token.
mcd_duration expires_in;
mlib_duration expires_in;
} mcd_azure_access_token;

/**
Expand Down
348 changes: 0 additions & 348 deletions src/libmongoc/src/mongoc/mcd-time.h

This file was deleted.

Loading