Fossil SCM

Adjust the cgi_rfc822_datetime() routine to use the newer rfc2822 date/time format that uses "+0000" for the timezone instead of "GMT".

drh 2018-06-30 13:42 trunk
Commit d2a94aa96c78ede34ff4f23f8a554bf7db891a355c964ef6e8458c113330d519
1 file changed +3 -3
+3 -3
--- src/cgi.c
+++ src/cgi.c
@@ -1929,12 +1929,12 @@
19291929
19301930
19311931
/*
19321932
** Returns an RFC822-formatted time string suitable for HTTP headers.
19331933
** The timezone is always GMT. The value returned is always a
1934
-** string obtained from mprintf() and must be freed using free() to
1935
-** avoid a memory leak.
1934
+** string obtained from mprintf() and must be freed using fossil_free()
1935
+** to avoid a memory leak.
19361936
**
19371937
** See http://www.faqs.org/rfcs/rfc822.html, section 5
19381938
** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3.
19391939
*/
19401940
char *cgi_rfc822_datestamp(time_t now){
@@ -1941,11 +1941,11 @@
19411941
struct tm *pTm;
19421942
pTm = gmtime(&now);
19431943
if( pTm==0 ){
19441944
return mprintf("");
19451945
}else{
1946
- return mprintf("%s, %d %s %02d %02d:%02d:%02d GMT",
1946
+ return mprintf("%s, %d %s %02d %02d:%02d:%02d +0000",
19471947
azDays[pTm->tm_wday], pTm->tm_mday, azMonths[pTm->tm_mon],
19481948
pTm->tm_year+1900, pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
19491949
}
19501950
}
19511951
19521952
--- src/cgi.c
+++ src/cgi.c
@@ -1929,12 +1929,12 @@
1929
1930
1931 /*
1932 ** Returns an RFC822-formatted time string suitable for HTTP headers.
1933 ** The timezone is always GMT. The value returned is always a
1934 ** string obtained from mprintf() and must be freed using free() to
1935 ** avoid a memory leak.
1936 **
1937 ** See http://www.faqs.org/rfcs/rfc822.html, section 5
1938 ** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3.
1939 */
1940 char *cgi_rfc822_datestamp(time_t now){
@@ -1941,11 +1941,11 @@
1941 struct tm *pTm;
1942 pTm = gmtime(&now);
1943 if( pTm==0 ){
1944 return mprintf("");
1945 }else{
1946 return mprintf("%s, %d %s %02d %02d:%02d:%02d GMT",
1947 azDays[pTm->tm_wday], pTm->tm_mday, azMonths[pTm->tm_mon],
1948 pTm->tm_year+1900, pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
1949 }
1950 }
1951
1952
--- src/cgi.c
+++ src/cgi.c
@@ -1929,12 +1929,12 @@
1929
1930
1931 /*
1932 ** Returns an RFC822-formatted time string suitable for HTTP headers.
1933 ** The timezone is always GMT. The value returned is always a
1934 ** string obtained from mprintf() and must be freed using fossil_free()
1935 ** to avoid a memory leak.
1936 **
1937 ** See http://www.faqs.org/rfcs/rfc822.html, section 5
1938 ** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3.
1939 */
1940 char *cgi_rfc822_datestamp(time_t now){
@@ -1941,11 +1941,11 @@
1941 struct tm *pTm;
1942 pTm = gmtime(&now);
1943 if( pTm==0 ){
1944 return mprintf("");
1945 }else{
1946 return mprintf("%s, %d %s %02d %02d:%02d:%02d +0000",
1947 azDays[pTm->tm_wday], pTm->tm_mday, azMonths[pTm->tm_mon],
1948 pTm->tm_year+1900, pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
1949 }
1950 }
1951
1952

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button