Skip to content

Commit

Permalink
CDRIVER-744: Remove unused variables, and fix missing format character
Browse files Browse the repository at this point in the history
  • Loading branch information
bjori committed May 27, 2016
1 parent 2128e45 commit bfee60f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/mongoc/mongoc-secure-channel.c
Expand Up @@ -237,8 +237,6 @@ mongoc_secure_channel_setup_ca (mongoc_stream_tls_secure_channel_t *secure_chann
PCCERT_CONTEXT cert = NULL;
DWORD encrypted_cert_len = 0;
LPBYTE encrypted_cert = NULL;
DWORD cbKeyBlob = 0;
LPBYTE pbKeyBlob = NULL;

file = fopen (opt->ca_file, "r");
if (!file) {
Expand All @@ -250,7 +248,7 @@ mongoc_secure_channel_setup_ca (mongoc_stream_tls_secure_channel_t *secure_chann
length = ftell (file);
fseek (file, 0, SEEK_SET);
if (length < 1) {
MONGOC_WARNING ("Couldn't determin file size of '%s'", opt->ca_file);
MONGOC_WARNING ("Couldn't determine file size of '%s'", opt->ca_file);
return false;
}

Expand Down Expand Up @@ -725,7 +723,7 @@ mongoc_secure_channel_handshake_step_2 (mongoc_stream_tls_t *tls,
LPTSTR msg = NULL;
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ARGUMENT_ARRAY,
NULL, GetLastError(), LANG_NEUTRAL, (LPTSTR)&msg, 0, NULL );
MONGOC_ERROR ("Failed to initialize security context, error code: 0x%04X%04X: ",
MONGOC_ERROR ("Failed to initialize security context, error code: 0x%04X%04X: %s",
(sspi_status >> 16) & 0xffff, sspi_status & 0xffff, msg);
LocalFree (msg);
}
Expand Down
3 changes: 1 addition & 2 deletions src/mongoc/mongoc-stream-tls-secure-channel.c
Expand Up @@ -738,7 +738,6 @@ _mongoc_stream_tls_secure_channel_readv (mongoc_stream_t *stream,
mongoc_stream_tls_secure_channel_t *secure_channel = (mongoc_stream_tls_secure_channel_t *)tls->ctx;
ssize_t ret = 0;
size_t i;
size_t read_ret;
size_t iov_pos = 0;
int64_t now;
int64_t expire = 0;
Expand Down Expand Up @@ -1020,7 +1019,7 @@ mongoc_stream_tls_secure_channel_new (mongoc_stream_t *base_stream,
LPTSTR msg = NULL;
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ARGUMENT_ARRAY,
NULL, GetLastError(), LANG_NEUTRAL, (LPTSTR)&msg, 0, NULL );
MONGOC_ERROR ("Failed to initialize security context, error code: 0x%04X%04X: ",
MONGOC_ERROR ("Failed to initialize security context, error code: 0x%04X%04X: '%s'",
(sspi_status >> 16) & 0xffff, sspi_status & 0xffff, msg);
LocalFree (msg);
RETURN (NULL);
Expand Down

0 comments on commit bfee60f

Please sign in to comment.