[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16051 - gnunet/src/datacache
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16051 - gnunet/src/datacache |
Date: |
Sat, 16 Jul 2011 22:50:16 +0200 |
Author: grothoff
Date: 2011-07-16 22:50:15 +0200 (Sat, 16 Jul 2011)
New Revision: 16051
Modified:
gnunet/src/datacache/plugin_datacache_sqlite.c
Log:
checkret
Modified: gnunet/src/datacache/plugin_datacache_sqlite.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_sqlite.c 2011-07-16 20:44:07 UTC
(rev 16050)
+++ gnunet/src/datacache/plugin_datacache_sqlite.c 2011-07-16 20:50:15 UTC
(rev 16051)
@@ -203,9 +203,15 @@
sqlite3_errmsg (plugin->dbh));
return 0;
}
- if (GNUNET_OK !=
- sqlite3_bind_blob (stmt, 1, key, sizeof (GNUNET_HashCode),
- SQLITE_TRANSIENT))
+ ntime = (int64_t) now.abs_value;
+ GNUNET_assert (ntime >= 0);
+ if ( (SQLITE_OK !=
+ sqlite3_bind_blob (stmt, 1, key, sizeof (GNUNET_HashCode),
+ SQLITE_TRANSIENT)) ||
+ (SQLITE_OK !=
+ sqlite3_bind_int (stmt, 2, type)) ||
+ (SQLITE_OK !=
+ sqlite3_bind_int64 (stmt, 3, now.abs_value)) )
{
LOG_SQLITE (plugin->dbh,
GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
@@ -213,10 +219,7 @@
sqlite3_finalize (stmt);
return 0;
}
- sqlite3_bind_int (stmt, 2, type);
- ntime = (int64_t) now.abs_value;
- GNUNET_assert (ntime >= 0);
- sqlite3_bind_int64 (stmt, 3, now.abs_value);
+
if (SQLITE_ROW != sqlite3_step (stmt))
{
LOG_SQLITE (plugin->dbh,
@@ -247,10 +250,20 @@
sqlite3_errmsg (plugin->dbh));
return cnt;
}
- sqlite3_bind_blob (stmt, 1, key, sizeof (GNUNET_HashCode),
- SQLITE_TRANSIENT);
- sqlite3_bind_int (stmt, 2, type);
- sqlite3_bind_int64 (stmt, 3, now.abs_value);
+ if ( (SQLITE_OK !=
+ sqlite3_bind_blob (stmt, 1, key, sizeof (GNUNET_HashCode),
+ SQLITE_TRANSIENT)) ||
+ (SQLITE_OK !=
+ sqlite3_bind_int (stmt, 2, type)) ||
+ (SQLITE_OK !=
+ sqlite3_bind_int64 (stmt, 3, now.abs_value)) )
+ {
+ LOG_SQLITE (plugin->dbh,
+ GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+ "sqlite3_bind_xxx");
+ sqlite3_finalize (stmt);
+ return cnt;
+ }
if (sqlite3_step (stmt) != SQLITE_ROW)
break;
size = sqlite3_column_bytes (stmt, 0);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16051 - gnunet/src/datacache,
gnunet <=