summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-10 04:56:58 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-10 04:56:58 +0000
commit49a5dd09b9aaba81fa217c9d41fce5e1f90c054b (patch)
treef29b230c95592a89e7d4735d372c0c3addd5afd3 /source3/lib
parentc03c56b2e29fd773b19b01d22be4ce347be9f05b (diff)
downloadsamba-49a5dd09b9aaba81fa217c9d41fce5e1f90c054b.tar.gz
samba-49a5dd09b9aaba81fa217c9d41fce5e1f90c054b.tar.bz2
samba-49a5dd09b9aaba81fa217c9d41fce5e1f90c054b.zip
added Date and Expires headers in the mini web server so clients know
what they can cache. (This used to be commit b6055e40bb91775a29b756640d95910a6f19814f)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/time.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index f60af60c7a..c5584fd143 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -451,6 +451,21 @@ time_t make_unix_date3(void *date_ptr)
return(t);
}
+
+/***************************************************************************
+return a HTTP/1.0 time string
+ ***************************************************************************/
+char *http_timestring(time_t t)
+{
+ static char buf[40];
+ struct tm *tm = LocalTime(&t);
+
+ strftime(buf, sizeof(buf)-1, "%a, %d %b %Y %H:%M:%S %Z", tm);
+ return buf;
+}
+
+
+
/****************************************************************************
return the date and time as a string
****************************************************************************/