summaryrefslogtreecommitdiff
path: root/docs/examples/synctime.c
diff options
context:
space:
mode:
authorViktor Szakats <commit@vszakats.net>2018-09-22 21:44:36 +0000
committerViktor Szakats <commit@vszakats.net>2018-09-22 21:44:36 +0000
commitc42849bb4888ab53745449dcd342ab37b85d69a4 (patch)
tree09e2dc4e3392462b012cb166edffb01286991f34 /docs/examples/synctime.c
parent5c41f88c056fce8b051192df2ca579815aa8117e (diff)
downloadcurl-c42849bb4888ab53745449dcd342ab37b85d69a4.tar.gz
examples/Makefile.m32: sync with core [ci skip]
also: - fix two warnings in synctime.c (one of them Windows-specific) - upgrade URLs in synctime.c and remove a broken one Closes https://github.com/curl/curl/pull/3033
Diffstat (limited to 'docs/examples/synctime.c')
-rw-r--r--docs/examples/synctime.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c
index e5cdfed3d..596962dc2 100644
--- a/docs/examples/synctime.c
+++ b/docs/examples/synctime.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -30,11 +30,11 @@
* Set proxy as according to your network, but beware of proxy Cache-Control.
*
* To set your system clock, root access is required.
- * # date -s "`curl -sI http://nist.time.gov/timezone.cgi?UTC/s/0 \
+ * # date -s "`curl -sI https://nist.time.gov/timezone.cgi?UTC/s/0 \
* | awk -F': ' '/Date: / {print $2}'`"
*
* To view remote webserver date and time.
- * $ curl -sI http://nist.time.gov/timezone.cgi?UTC/s/0 \
+ * $ curl -sI https://nist.time.gov/timezone.cgi?UTC/s/0 \
* | awk -F': ' '/Date: / {print $2}'
*
* Synchronising your computer clock via Internet time server usually relies
@@ -63,8 +63,8 @@
* webserver provide Cache-Control to prevent caching.
*
* References:
- * http://tf.nist.gov/timefreq/service/its.htm
- * http://tf.nist.gov/timefreq/service/firewall.htm
+ * https://web.archive.org/web/20100228012139/tf.nist.gov/timefreq/service/its.htm
+ * https://web.archive.org/web/20100409024302/tf.nist.gov/timefreq/service/firewall.htm
*
* Usage:
* This software will synchronise your computer clock only when you issue
@@ -88,6 +88,7 @@
#include <stdio.h>
#include <time.h>
#ifndef __CYGWIN__
+#include <winsock2.h>
#include <windows.h>
#endif
#include <curl/curl.h>
@@ -107,9 +108,8 @@ typedef struct
const char DefaultTimeServer[3][MAX_STRING1] =
{
- "http://pool.ntp.org/",
- "http://nist.time.gov/",
- "http://www.google.com/"
+ "https://nist.time.gov/",
+ "https://www.google.com/"
};
const char *DayStr[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
@@ -138,6 +138,8 @@ size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb,
int i, RetVal;
char TmpStr1[26], TmpStr2[26];
+ (void)stream;
+
if(ShowAllHeader == 1)
fprintf(stderr, "%s", (char *)(ptr));