Check-in [070e63db33]
Not logged in
Overview

SHA1 Hash:070e63db3362346be6782a270135c950434e7518
Date: 2008-08-17 20:53:20
User: eric
Comment:Merge old tagview branch into this branch
Timelines: ancestors | descendants | both | eric-tagview-rework | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/cgi.c from [5d10f16d56] to [cf67a58e94].

@@ -200,13 +200,15 @@
   int lifetime          /* Expiration of the cookie in seconds from now */
 ){
   if( zPath==0 ) zPath = g.zTop;
   if( lifetime>0 ){
     lifetime += (int)time(0);
+    char * zDate = cgi_rfc822_datestamp(lifetime);
     blob_appendf(&extraHeader,
-       "Set-Cookie: %s=%t; Path=%s; expires=%s; Version=1\r\n",
-        zName, zValue, zPath, cgi_rfc822_datestamp(lifetime));
+       "Set-Cookie: %s=%t; Path=%s; expires=%z; Version=1\r\n",
+        zName, zValue, zPath, zDate);
+    if( zDate[0] ) free( zDate );
   }else{
     blob_appendf(&extraHeader,
        "Set-Cookie: %s=%t; Path=%s; Version=1\r\n",
        zName, zValue, zPath);
   }
@@ -286,11 +288,13 @@
   }
 #endif
 
   if( g.fullHttpReply ){
     fprintf(g.httpOut, "HTTP/1.0 %d %s\r\n", iReplyStatus, zReplyStatus);
-    fprintf(g.httpOut, "Date: %s\r\n", cgi_rfc822_datestamp(time(0)));
+    char * zDate = cgi_rfc822_datestamp(time(0));
+    fprintf(g.httpOut, "Date: %s\r\n", zDate );
+    if( zDate[0] ) free( zDate );
     fprintf(g.httpOut, "Connection: close\r\n");
   }else{
     fprintf(g.httpOut, "Status: %d %s\r\n", iReplyStatus, zReplyStatus);
   }
 
@@ -307,11 +311,13 @@
     ** stale cache is the least of the problem. So we provide an Expires
     ** header set to a reasonable period (default: one week).
     */
     /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
     time_t expires = time(0) + 604800;
-    fprintf(g.httpOut, "Expires: %s\r\n", cgi_rfc822_datestamp(expires));
+    char * zDate = cgi_rfc822_datestamp(expires);
+    fprintf(g.httpOut, "Expires: %s\r\n", zDate );
+    if( zDate[0] ) free( zDate );
   }
 
   /* Content intended for logged in users should only be cached in
   ** the browser, not some shared location.
   */
@@ -1267,10 +1273,12 @@
 
 /*
 ** Returns an RFC822-formatted time string suitable for HTTP headers, among
 ** other things.
 ** Returned timezone is always GMT as required by HTTP/1.1 specification.
+** The returned string is allocated with malloc() and must be freed
+** with free().
 **
 ** See http://www.faqs.org/rfcs/rfc822.html, section 5
 ** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3.
 */
 char *cgi_rfc822_datestamp(time_t now){

Modified src/style.c from [1b159a6ade] to [934dddd1ca].

@@ -326,10 +326,16 @@
 @   padding: 5px 10px 5px 10px;
 @   text-align: right;
 @   background-color: #558195;
 @   color: white;
 @ }
+@
+@ /* Make the links in the footer less ugly... */
+@ div.footer a { color: white; }
+@ div.footer a:link { color: white; }
+@ div.footer a:visited { color: white; }
+@ div.footer a:hover { background-color: white; color: #558195; }
 @
 @ /* <verbatim> blocks */
 @ pre.verbatim {
 @    background-color: #f5f5f5;
 @    padding: 0.5em;

Modified src/tagview.c from [8e6ed27d79] to [b4a9071e7b].

@@ -60,11 +60,11 @@
     "   linktagid(t.tagid) AS 'Tag ID',"
     "   linktagname(t.tagname) AS 'Name',"
     "   DATETIME(tx.mtime) AS 'Timestamp',"
     "   linkuuid(b.uuid) AS 'Version'"
     "  FROM tag t, tagxref tx, blob b "
-    " WHERE t.tagid=tx.tagid AND tx.srcid=b.rid"
+    " WHERE t.tagid=tx.tagid AND tx.rid=b.rid"
     "   AND tx.tagtype!=0 %s "
     TAGVIEW_DEFAULT_FILTER
     " ORDER BY tx.mtime DESC %s",
     zLikeClause, zLimit
   );
@@ -105,11 +105,11 @@
     "SELECT DISTINCT"
     "       linktagname(t.tagname) AS 'Tag Name',"
     "       DATETIME(tx.mtime) AS 'Timestamp',"
     "       linkuuid(b.uuid) AS 'Version'"
     "  FROM tag t, tagxref tx, blob b"
-    " WHERE t.tagid=%d AND t.tagid=tx.tagid AND tx.srcid=b.rid "
+    " WHERE t.tagid=%d AND t.tagid=tx.tagid AND tx.rid=b.rid "
     TAGVIEW_DEFAULT_FILTER
     " ORDER BY tx.mtime DESC",
     tagid
   );
   db_generic_query_view(zSql, 1);
@@ -126,11 +126,11 @@
     "SELECT DISTINCT"
     "       linktagid(t.tagid) AS 'Tag ID',"
     "       DATETIME(tx.mtime) AS 'Timestamp',"
     "       linkuuid(b.uuid) AS 'Version'"
     "  FROM tag t, tagxref tx, blob b "
-    " WHERE t.tagname='%q' AND t.tagid=tx.tagid AND tx.srcid=b.rid "
+    " WHERE t.tagname='%q' AND t.tagid=tx.tagid AND tx.rid=b.rid "
     TAGVIEW_DEFAULT_FILTER
     " ORDER BY tx.mtime DESC",
     tagname);
   db_generic_query_view(zSql, 1);
   free(zSql);