| 80 | WaitressHandle_t waithSync; |
| 81 | char *syncTime; |
| 82 | unsigned long int syncTimeInt; |
| 83 | |
| 84 | /* skip sync step by fetching time from somewhere else */ |
| 85 | WaitressInit (&waithSync); |
| 86 | WaitressSetUrl (&waithSync, "http://ridetheclown.com/s2/synctime.php"); |
| 87 | if (app->settings.proxy != NULL && strlen (app->settings.proxy) > 0) { |
| 88 | WaitressSetProxy (&waithSync, app->settings.proxy); |
| 89 | } |
| 90 | wRet = WaitressFetchBuf (&waithSync, &syncTime); |
| 91 | WaitressFree (&waithSync); |
| 92 | if (wRet != WAITRESS_RET_OK) { |
| 93 | BarUiMsg (&app->settings, MSG_ERR, "Unable to sync: %s\n", |
| 94 | WaitressErrorToStr (wRet)); |
| 95 | return false; |
| 96 | } |
| 97 | |
| 98 | syncTimeInt = strtoul (syncTime, NULL, 0); |
| 99 | app->ph.timeOffset = time (NULL) - syncTimeInt; |
| 100 | free (syncTime); |