mirror of
https://github.com/fairwaves/openbts-2.8.git
synced 2025-10-23 07:42:01 +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
|
||||
* The author disclaims copyright to this source code.
|
||||
* Copyright 2010 Kestrel Signal Processing, Inc.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
@@ -17,12 +17,18 @@
|
||||
|
||||
int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query)
|
||||
{
|
||||
int prc = sqlite3_prepare_v2(DB,query,strlen(query),stmt,NULL);
|
||||
if (prc) {
|
||||
fprintf(stderr,"sqlite3_prepare_v2 failed for \"%s\": %s\n",query,sqlite3_errmsg(DB));
|
||||
sqlite3_finalize(*stmt);
|
||||
}
|
||||
return prc;
|
||||
int src = SQLITE_BUSY;
|
||||
while (src==SQLITE_BUSY) {
|
||||
src = sqlite3_prepare_v2(DB,query,strlen(query),stmt,NULL);
|
||||
if (src==SQLITE_BUSY) {
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
||||
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)
|
||||
@@ -140,6 +146,7 @@ bool sqlite3_command(sqlite3* DB, const char* query)
|
||||
if (sqlite3_prepare_statement(DB,&stmt,query)) return false;
|
||||
// Run the query.
|
||||
int src = sqlite3_run_query(DB,stmt);
|
||||
sqlite3_finalize(stmt);
|
||||
return src==SQLITE_DONE;
|
||||
}
|
||||
|
||||
|
@@ -114,7 +114,7 @@ ostream& SIP::operator<<(ostream& os, SIPState s)
|
||||
{
|
||||
const char* str = SIPStateString(s);
|
||||
if (str) os << str;
|
||||
else os << "?" << s << "?";
|
||||
else os << "?" << ((int)s) << "?";
|
||||
return os;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user