Skip to content

Commit

Permalink
update to GMTIME_THREAD_SAFE, also lock around increment in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanctech committed Jan 29, 2024
1 parent f7dd651 commit a65fd5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/source/Common/AwsV4Signer.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ STATUS generateSignatureDateTime(UINT64 currentTime, PCHAR pDateTimeStr)

// Convert to time_t
timeT = (time_t) (currentTime / HUNDREDS_OF_NANOS_IN_A_SECOND);
retSize = STRFTIME(pDateTimeStr, SIGNATURE_DATE_TIME_STRING_LEN, DATE_TIME_STRING_FORMAT, GMTIME_SAFE(&timeT));
retSize = STRFTIME(pDateTimeStr, SIGNATURE_DATE_TIME_STRING_LEN, DATE_TIME_STRING_FORMAT, GMTIME_THREAD_SAFE(&timeT));
CHK(retSize > 0, STATUS_BUFFER_TOO_SMALL);
pDateTimeStr[retSize] = '\0';

Expand Down
8 changes: 4 additions & 4 deletions tst/ProducerTestFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,10 @@ STATUS ProducerClientTestBase::curlReadCallbackHookFunc(PCurlResponse pCurlRespo

STATUS ProducerClientTestBase::testFreeApiCallbackFunc(PUINT64 customData)
{
ProducerClientTestBase* pTestBase = (ProducerClientTestBase*) *customData;

pTestBase->mFreeApiCallbacksFnCount++;

ProducerClientTestBase* pTest = (ProducerClientTestBase*) *customData;
MUTEX_LOCK(pTest->mTestCallbackLock);
pTest->mFreeApiCallbacksFnCount++;
MUTEX_UNLOCK(pTest->mTestCallbackLock);
return STATUS_SUCCESS;
}

Expand Down

0 comments on commit a65fd5e

Please sign in to comment.