Integrated the DKIM signer into serv_smtpclient, but disabled it
[citadel.git] / webcit / http_datestring.c
index 2e2bef8dafbde31c11dee9811a0a652acdb97cd9..d1f6634e3df5c1b16f8d4266ac305d583c8e2f36 100644 (file)
@@ -1,15 +1,9 @@
-/*
- * $Id$
- */
-/**
- * \defgroup HTTPDateTime Function to generate HTTP-compliant textual time/date stamp
- * (This module was lifted directly from the Citadel server source)
- *
- * \ingroup WebcitHttpServer
- */
-/*@{*/
 #include "webcit.h"
 
+#ifdef __FreeBSD__
+/** I like to believe there is a better way to do this. */
+#define HAVE_STRUCT_TM_TM_GMTOFF
+#endif
 /** HTTP Months - do not translate - these are not for human consumption */
 static char *httpdate_months[] = {
        "Jan", "Feb", "Mar", "Apr", "May", "Jun",
@@ -71,7 +65,11 @@ void tmplput_nowstr(StrBuf *Target, WCTemplputParams *TP)
        time_t now;
        
        now = time(NULL);
+#ifdef HAVE_SOLARIS_LOCALTIME_R
+       asctime_r(localtime(&now), buf, sizeof(buf));
+#else
        asctime_r(localtime(&now), buf);
+#endif
        bufused = strlen(buf);
        if ((bufused > 0) && (buf[bufused - 1] == '\n')) {
                buf[bufused - 1] = '\0';
@@ -93,5 +91,3 @@ InitModule_DATE
        RegisterNamespace("DATE:NOW:STR", 0, 0, tmplput_nowstr, NULL, CTX_NONE);
        RegisterNamespace("DATE:NOW:NO", 0, 0, tmplput_nowno, NULL, CTX_NONE);
 }
-
-/*@}*/