Merge pull request #676 from C-o-r-E/master

libfreerdp-locale: Temporary fix for setting the server's time from the client. Disabled use of timezone rules.
This commit is contained in:
Marc-André Moreau 2012-07-30 13:23:05 -07:00
commit d469cccdaa
2 changed files with 4 additions and 4 deletions

View File

@ -143,12 +143,10 @@ void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings)
rdp_write_system_time(s, &clientTimeZone->standardDate); /* StandardDate */
sbias = clientTimeZone->standardBias - clientTimeZone->bias;
if (sbias < 0)
bias2c = (uint32) sbias;
else
bias2c = ~((uint32) sbias) + 1;
stream_write_uint32(s, bias2c); /* StandardBias */
/* daylightName (64 bytes) */
@ -163,7 +161,6 @@ void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings)
bias2c = (uint32) sbias;
else
bias2c = ~((uint32) sbias) + 1;
stream_write_uint32(s, bias2c); /* DaylightBias */
xfree(standardName);

View File

@ -1635,10 +1635,12 @@ TIME_ZONE_RULE_ENTRY* freerdp_get_current_time_zone_rule(TIME_ZONE_RULE_ENTRY* r
{
if ((rules[i].TicksStart <= windows_time) && (windows_time >= rules[i].TicksEnd))
{
/*printf("Got rule %d from table at %p with count %u\n", i, rules, count);*/
return &rules[i];
}
}
printf("Unable to get current timezone rule\n");
return NULL;
}
@ -1671,7 +1673,6 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
#else
clientTimeZone->bias = 0;
#endif
if (local_time->tm_isdst > 0)
{
clientTimeZone->standardBias = clientTimeZone->bias - 60;
@ -1696,6 +1697,7 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
TIME_ZONE_RULE_ENTRY* rule;
rule = freerdp_get_current_time_zone_rule(tz->RuleTable, tz->RuleTableCount);
/* issue #574 -- temporarily disabled this block as it seems to be setting the wrong time
if (rule != NULL)
{
clientTimeZone->standardBias = 0;
@ -1719,6 +1721,7 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
clientTimeZone->daylightDate.wSecond = rule->DaylightDate.wSecond;
clientTimeZone->daylightDate.wMilliseconds = rule->DaylightDate.wMilliseconds;
}
*/
}
xfree(tz);