[mapserver-commits] r12442 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:26:25 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:26:25 -0700 (Fri, 26 Aug 2011)
New Revision: 12442

Modified:
   trunk/mapserver/mapcache/src/cache_sqlite.c
Log:
add support for configurable http connection timeout
thomas.bonfort | 2011-08-25 19:31:35 +0200 (Thu, 25 Aug 2011)

Modified: trunk/mapserver/mapcache/src/cache_sqlite.c
===================================================================
--- trunk/mapserver/mapcache/src/cache_sqlite.c	2011-08-26 11:26:20 UTC (rev 12441)
+++ trunk/mapserver/mapcache/src/cache_sqlite.c	2011-08-26 11:26:25 UTC (rev 12442)
@@ -147,9 +147,9 @@
    sqlite3_stmt *stmt;
    char *sql;
    if(tile->dimensions) {
-      sql = "SELECT data from tiles where x=? and y=? and z=? and dim=?";
+      sql = "SELECT data,strftime(\"%s\",ctime) from tiles where x=? and y=? and z=? and dim=?";
    } else {
-      sql = "SELECT data from tiles where x=? and y=? and z=?";
+      sql = "SELECT data,strftime(\"%s\",ctime) from tiles where x=? and y=? and z=?";
    }
    sqlite3_prepare(handle,sql,-1,&stmt,NULL);
    sqlite3_bind_int(stmt,1,tile->x);
@@ -176,6 +176,8 @@
       tile->data = geocache_buffer_create(size,ctx->pool);
       memcpy(tile->data->buf, blob,size);
       tile->data->size = size;
+      time_t mtime = sqlite3_column_int64(stmt, 1);
+      apr_time_ansi_put(&(tile->mtime),mtime);
       sqlite3_finalize(stmt);
       sqlite3_close(handle);
       return GEOCACHE_SUCCESS;



More information about the mapserver-commits mailing list