1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-26 20:41:07 +01:00

48 Commits

Author SHA1 Message Date
Mészáros Mihály
a19bc7c464 Revert by hand merge PR825 in favor PR755 more simple solution 2021-09-22 13:32:34 +02:00
Mészáros Mihály
b5a597836b Merge branch 'master' into fix_sqlite_shutdown_race 2021-09-22 11:12:41 +02:00
Arne Georg Gisnås Gleditsch
8d66122d91 dbd_sqlite: Don't shutdown sqlite3 db during init
Ref https://www.sqlite.org/c3ref/initialize.html:

    The sqlite3_initialize() interface is threadsafe, but
    sqlite3_shutdown() is not.

We currently call `sqlite3_shutdown` from all threads as part of
`sqlite_init_multithreaded`, and this has been observed to have
adversarial effects during startup if many threads receive their first
inbound request at the same time. The apparent motivation behind
calling shutdown is to make the subsequent calls to `sqlite3_config`
succeed, since these ordinarily return SQLITE_MISUSE if called
multiple times. However, this function is also documented to not be
thread safe, so introduce a barrier that ensures we only initialize
once over all threads.
2021-09-20 16:33:25 +02:00
Serhii Charykov
0f7ff3ec4a Change sqlite_init_multithreaded return type to void
to satisfy pthread_once() interface because
previously return from sqlite_init_multithreaded
was not used
2021-04-26 23:47:11 +03:00
Serhii Charykov
2d12ad4f29 Refactor code 2021-04-26 23:34:24 +03:00
Serhii Charykov
34e18533cf Fix sqlite3_config call only once before using any other sqlite utilities 2021-04-26 22:19:16 +03:00
Serhii Charykov
0b709a05b7 Remove sqlite3_shutdown()
Because:
1. According to sqlite3 docs sqlite3_initialize() and sqlite3_shutdown() are not must to be invoked
2. sqlite3_initialize() is never called explicilty
3. sqlite3_shutdown() is not threadsafe and sqlite_init_multithreaded is not called holding a lock
4. According to docs all connections must be closed before invoking sqlite3_shutdown() but they are not (from the different threads).

Possible issue:
sqlite3_config must be called before sqlite3_initialize() or after sqlite3_shutdown() (and only once?)
2021-04-26 21:36:28 +03:00
Mészáros Mihály
50ebef7a3f Fix g++ 2 errors and many warnings
Resolves #661 #654
2021-01-05 21:47:50 +00:00
Mészáros Mihály
a409588eda Fix: sqlite disconnect function 2019-05-21 12:23:59 +02:00
Shu Muto
dac67ea046 Disconnect database gracefully
Coturn does not disconnect database properly when shutdown.
This behavior causes accumulation of sockets for database with TIME_WAIT.
Especially, `turnadmin` is recommended to manage userdb,
but use of `turnadmin` from other application or scripts
can run out of socket resource due to above problem.

This patch adds database disconnection when shutdown
for both of `turnserver` and `turnadmin`.

Fixes #366
2019-03-18 15:33:21 +09:00
Bradley T. Hughes
d2ee3ac291 Remove [su]{08,16,32,64}bits type defines
Do not overload the standard types with #defines, just use them
directly.
2019-03-08 09:08:30 +01:00
Bradley T. Hughes
043b102e38 Remove turn_strdup()
Do not overload strdup() from string.h
2019-03-07 08:00:08 +01:00
Bradley T. Hughes
b50fc77124 Remote turn_free()
Do not overload free() with a different API.
2019-03-07 07:58:12 +01:00
Bradley T. Hughes
fef016901e Remove turn_malloc()
Do not overload malloc() from stdlib.h
2019-03-06 23:38:20 +01:00
Bradley T. Hughes
ed91d4bc17 Remove turn_free_simple
Do not overload free() from stdlib.h
2019-03-06 23:34:25 +01:00
Oleg Moskalenko
dbc9dee42b working on multi-tenant server based upon oauth 2015-09-14 00:16:13 -07:00
mom040267
153b2d1d41 fixing a security hole 2015-06-28 05:37:28 +00:00
mom040267
6c2604620b SQLite support for CentOS/RedHat 5 2015-05-28 04:51:30 +00:00
mom040267
31b25414b4 working on oauth 2015-04-19 08:14:29 +00:00
mom040267
6dbee00b74 working on new third-party auth draft 2015-04-19 07:37:12 +00:00
mom040267
86f40b4bd9 working on third-party auth 2015-04-19 06:18:28 +00:00
mom040267
4424b3c92a --sha256, --sha384, --sha512 parameters retired. 2015-04-11 07:26:55 +00:00
mom040267
61239f9aa8 bandwidth limit is 64 bits now 2015-03-02 01:44:29 +00:00
mom040267
6a633fadc9 default sqlite database schema fixed 2015-02-22 07:14:00 +00:00
mom040267
11becb068c warnings fixed 2015-01-24 18:43:52 +00:00
mom040267
da0f380b18 cosmetics 2015-01-24 10:43:56 +00:00
mom040267
4e8b95bbb0 c++ compilation errors fixed 2015-01-24 08:21:32 +00:00
mom040267
7c2fc1b1b6 oauth timestamps added 2015-01-23 07:12:04 +00:00
mom040267
aefe2608d0 oauth keys page 2015-01-22 10:03:40 +00:00
mom040267
49c88a5576 start working on oauth 2015-01-21 18:43:47 +00:00
mom040267
01e1316c49 black/white lists page 2015-01-20 08:55:28 +00:00
mom040267
55d116f7fe origins admin page 2015-01-19 08:00:47 +00:00
mom040267
9bd8f29ac8 shared secrets admin page and fixes 2015-01-19 06:15:06 +00:00
mom040267
e3d9f5484c list users 2015-01-18 05:48:34 +00:00
mom040267
237b3baaa7 short-term credentials removed in the TURN server 2015-01-11 06:28:58 +00:00
mom040267
5cd0d33c31 1) working on https; 2) SSLv2 support removed. 2015-01-10 08:25:29 +00:00
mom040267
f17ce4fe83 new turn_admin table 2015-01-07 07:57:56 +00:00
mom040267
626a6b69d7 minor fixes 2014-12-21 10:48:53 +00:00
mom040267
ae71f2b7fd sqlite multithreading 2014-12-21 07:21:46 +00:00
mom040267
c3da54c292 multiple auth threads 2014-12-21 03:16:02 +00:00
mom040267
6b291a8238 multi-threaded DB connections. 2014-12-20 08:51:44 +00:00
mom040267
df7b770ebb minor fixes 2014-12-01 17:54:38 +00:00
mom040267
a549c8b36f minor fixes 2014-11-22 23:46:48 +00:00
mom040267
924fa29c5e make SQLite optional 2014-11-19 18:41:24 +00:00
mom040267
cf93f38218 a log message removed 2014-11-18 06:25:16 +00:00
mom040267
b25a32f10c sqlite support, draft implementation 2014-11-17 09:38:53 +00:00
mom040267
ef149fb30d default turndb changed to ~/turndb 2014-11-17 01:33:31 +00:00
mom040267
b9ef9f4c61 working on sqlite support 2014-11-16 07:52:46 +00:00