mirror of
https://github.com/RangeNetworks/openbts.git
synced 2025-11-04 13:53:15 +00:00
Synced sqlite3utils with private and fixed a small recursive bug in SIPEngine that was already fixed in private
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4912 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Written by David A. Burgess, Kestrel Signal Processing, Inc., 2010
|
* Copyright 2010 Kestrel Signal Processing, Inc.
|
||||||
* The author disclaims copyright to this source code.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -17,12 +17,18 @@
|
|||||||
|
|
||||||
int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query)
|
int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query)
|
||||||
{
|
{
|
||||||
int prc = sqlite3_prepare_v2(DB,query,strlen(query),stmt,NULL);
|
int src = SQLITE_BUSY;
|
||||||
if (prc) {
|
while (src==SQLITE_BUSY) {
|
||||||
fprintf(stderr,"sqlite3_prepare_v2 failed for \"%s\": %s\n",query,sqlite3_errmsg(DB));
|
src = sqlite3_prepare_v2(DB,query,strlen(query),stmt,NULL);
|
||||||
sqlite3_finalize(*stmt);
|
if (src==SQLITE_BUSY) {
|
||||||
}
|
usleep(100000);
|
||||||
return prc;
|
}
|
||||||
|
}
|
||||||
|
if (src) {
|
||||||
|
fprintf(stderr,"sqlite3_prepare_v2 failed for \"%s\": %s\n",query,sqlite3_errmsg(DB));
|
||||||
|
sqlite3_finalize(*stmt);
|
||||||
|
}
|
||||||
|
return src;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sqlite3_run_query(sqlite3* DB, sqlite3_stmt *stmt)
|
int sqlite3_run_query(sqlite3* DB, sqlite3_stmt *stmt)
|
||||||
@@ -140,6 +146,7 @@ bool sqlite3_command(sqlite3* DB, const char* query)
|
|||||||
if (sqlite3_prepare_statement(DB,&stmt,query)) return false;
|
if (sqlite3_prepare_statement(DB,&stmt,query)) return false;
|
||||||
// Run the query.
|
// Run the query.
|
||||||
int src = sqlite3_run_query(DB,stmt);
|
int src = sqlite3_run_query(DB,stmt);
|
||||||
|
sqlite3_finalize(stmt);
|
||||||
return src==SQLITE_DONE;
|
return src==SQLITE_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ ostream& SIP::operator<<(ostream& os, SIPState s)
|
|||||||
{
|
{
|
||||||
const char* str = SIPStateString(s);
|
const char* str = SIPStateString(s);
|
||||||
if (str) os << str;
|
if (str) os << str;
|
||||||
else os << "?" << s << "?";
|
else os << "?" << ((int)s) << "?";
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user