mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-25 04:33:23 +00:00
Updated so log about certificate not being found, is only written if database didn't exist when agent was started
This commit is contained in:
@@ -75,6 +75,34 @@ EncoderParameters encParam;
|
||||
LPVOID tilebuffer = NULL;
|
||||
unsigned int tilebuffersize = 0;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void __jpeghelp(void *xx)
|
||||
{
|
||||
EncoderParameters *pp = (EncoderParameters*)xx;
|
||||
GUID x = EncoderQuality;
|
||||
printf("ImageCodecInfo: %d", sizeof(ImageCodecInfo));
|
||||
printf("MimeType: %d\n", FIELD_OFFSET(ImageCodecInfo, MimeType));
|
||||
printf("Clsid: %d\n", FIELD_OFFSET(ImageCodecInfo, Clsid));
|
||||
printf("EncoderParameters::Count => %d\n", FIELD_OFFSET(EncoderParameters, Count));
|
||||
printf("EncoderParameters::Parameter => %d\n", FIELD_OFFSET(EncoderParameters, Parameter));
|
||||
printf("EncoderParameter::Guid => %d\n", FIELD_OFFSET(EncoderParameter, Guid));
|
||||
printf("EncoderParameter::NumberOfValues => %d\n", FIELD_OFFSET(EncoderParameter, NumberOfValues));
|
||||
printf("EncoderParameter::Type => %d\n", FIELD_OFFSET(EncoderParameter, Type));
|
||||
printf("EncoderParameter::Value => %d\n", FIELD_OFFSET(EncoderParameter, Value));
|
||||
printf("sizeof(EncoderParameters): %d\n", sizeof(EncoderParameters));
|
||||
}
|
||||
void __jpeghelp2(void *x)
|
||||
{
|
||||
ImageCodecInfo *info = (ImageCodecInfo*)x;
|
||||
printf("MIME: %d\n", (char*)&(info->MimeType) - (char*)info);
|
||||
if (info != NULL)
|
||||
{
|
||||
printf("x");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Used to obtain the GUID for the image encoder.
|
||||
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
|
||||
{
|
||||
|
||||
@@ -2182,10 +2182,6 @@ int agent_GenerateCertificates(MeshAgentHostContainer *agent, char* certfile)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void agent_LoadCertificates_DB_Check(ILibSimpleDataStore sender, char* Key, int KeyLen, void *user)
|
||||
{
|
||||
((size_t*)user)[0] += 1;
|
||||
}
|
||||
int agent_LoadCertificates(MeshAgentHostContainer *agent)
|
||||
{
|
||||
int len;
|
||||
@@ -2270,11 +2266,7 @@ int agent_LoadCertificates(MeshAgentHostContainer *agent)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
size_t keycount = 0;
|
||||
ILibSimpleDataStore_EnumerateKeys(agent->masterDb, agent_LoadCertificates_DB_Check, &keycount);
|
||||
|
||||
if (keycount > 1)
|
||||
if(ILibSimpleDataStore_WasCreatedAsNew(agent->masterDb)==0)
|
||||
{
|
||||
// No certificate in the database. Return 1 here so we can generate one.
|
||||
ILibRemoteLogging_printf(ILibChainGetLogger(agent->chain), ILibRemoteLogging_Modules_Agent_GuardPost, ILibRemoteLogging_Flags_VerbosityLevel_1, "...Failed to load Node Certificate from Database");
|
||||
|
||||
Reference in New Issue
Block a user