Skip to content

Commit

Permalink
Config file parsing fixed (Issue 28)
Browse files Browse the repository at this point in the history
  • Loading branch information
mom040267 committed May 26, 2013
1 parent 88a3582 commit 8f3322c
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 11 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,3 +1,6 @@
05/26/2013 Oleg Moskalenko <mom040267@gmail.com>
Version 1.8.5.1 'Black Dow':
- Config file parsing fixed (Issue 28)

05/20/2013 Oleg Moskalenko <mom040267@gmail.com>,
Erik Johnston <erikj@openmarket.com>
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -564,7 +564,7 @@ If the TURN server was compiled with MySQL support, then we can use the TURN ser
database parameter --mysql-userdb. The value of this parameter is a connection string
for the MySQL database. As "native" MySQL does not have such a feature as
"connection string", the TURN server parses the connection string and converts it into
MySQL database access parameter. The format of the MySQL connection string is:
MySQL database connection parameter. The format of the MySQL connection string is:

"host=<host> dbname=<database-name> user=<database-user> password=<database-user-password> port=<port> connect_timeout=<seconds>"

Expand Down
10 changes: 10 additions & 0 deletions README.turnadmin
Expand Up @@ -142,6 +142,16 @@ FILES

/usr/local/etc/turnuserdb.conf

=================================

DIRECTORIES

/usr/local/share/turnserver

/usr/local/share/doc/turnserver

/usr/local/share/examples/turnserver

======================================

SEE ALSO
Expand Down
10 changes: 10 additions & 0 deletions README.turnserver
Expand Up @@ -538,6 +538,16 @@ FILES

=================================

DIRECTORIES

/usr/local/share/turnserver

/usr/local/share/doc/turnserver

/usr/local/share/examples/turnserver

=================================

STANDARDS

new STUN RFC 5389
Expand Down
22 changes: 22 additions & 0 deletions README.turnutils
Expand Up @@ -205,6 +205,28 @@ $ man -M man turnutils

to see the man page.

=====================================

FILES

/etc/turnserver.conf

/etc/turnuserdb.conf

/usr/local/etc/turnserver.conf

/usr/local/etc/turnuserdb.conf

=================================

DIRECTORIES

/usr/local/share/turnserver

/usr/local/share/doc/turnserver

/usr/local/share/examples/turnserver

===================================

STANDARDS
Expand Down
2 changes: 1 addition & 1 deletion examples/etc/turnserver.conf
Expand Up @@ -233,7 +233,7 @@
# The connection string has the same parameters as redis-userdb connection string.
# Use string format as below (space separated parameters, all optional):
#
#redis-statsdb="ip=<ip-address> dbname=<database-number> password=<database-user-password> port=<port>"
#redis-statsdb="ip=<ip-address> dbname=<database-number> password=<database-user-password> port=<port> connect_timeout=<seconds>"

# Realm for long-term credentials mechanism
#
Expand Down
11 changes: 10 additions & 1 deletion man/man1/turnadmin.1
@@ -1,5 +1,5 @@
.\" Text automatically generated by txt2man
.TH TURN 1 "23 May 2013" "" ""
.TH TURN 1 "25 May 2013" "" ""
.SH GENERAL INFORMATION

\fIturnadmin\fP is a TURN administration tool. This tool can be used to manage
Expand Down Expand Up @@ -202,6 +202,15 @@ to see the man page.
.PP
/usr/local/etc/turnuserdb.conf
.PP
=================================
.SH DIRECTORIES

/usr/local/share/\fIturnserver\fP
.PP
/usr/local/share/doc/\fIturnserver\fP
.PP
/usr/local/share/examples/\fIturnserver\fP
.PP
======================================
.SH SEE ALSO

Expand Down
11 changes: 10 additions & 1 deletion man/man1/turnserver.1
@@ -1,5 +1,5 @@
.\" Text automatically generated by txt2man
.TH TURN 1 "23 May 2013" "" ""
.TH TURN 1 "25 May 2013" "" ""
.SH GENERAL INFORMATION

The \fBTURN Server\fP project contains the source code of a TURN server and TURN client
Expand Down Expand Up @@ -706,6 +706,15 @@ it would affect the performance.
/usr/local/etc/turnuserdb.conf
.PP
=================================
.SH DIRECTORIES

/usr/local/share/\fIturnserver\fP
.PP
/usr/local/share/doc/\fIturnserver\fP
.PP
/usr/local/share/examples/\fIturnserver\fP
.PP
=================================
.SH STANDARDS

new STUN RFC 5389
Expand Down
22 changes: 21 additions & 1 deletion man/man1/turnutils.1
@@ -1,5 +1,5 @@
.\" Text automatically generated by txt2man
.TH TURN 1 "23 May 2013" "" ""
.TH TURN 1 "25 May 2013" "" ""
.SH GENERAL INFORMATION

A set of turnutils_* programs provides some utility functionality to be used
Expand Down Expand Up @@ -291,6 +291,26 @@ $ man \fB\-M\fP man \fIturnutils\fP
.PP
to see the man page.
.PP
=====================================
.SH FILES

/etc/turnserver.conf
.PP
/etc/turnuserdb.conf
.PP
/usr/local/etc/turnserver.conf
.PP
/usr/local/etc/turnuserdb.conf
.PP
=================================
.SH DIRECTORIES

/usr/local/share/\fIturnserver\fP
.PP
/usr/local/share/doc/\fIturnserver\fP
.PP
/usr/local/share/examples/\fIturnserver\fP
.PP
===================================
.SH STANDARDS

Expand Down
7 changes: 4 additions & 3 deletions postinstall.txt
Expand Up @@ -4,13 +4,14 @@
the, to enable the turnserver as an automatically started system
service, you have to:

a) Create and edit /etc/turnserver.conf file.
Use /etc/turnserver.conf.default as an example.
a) Create and edit /etc/turnserver.conf or
/usr/local/etc/turnserver.conf .
Use /usr/local/etc/turnserver.conf.default as an example.

b) For user accounts settings, if using the turnserver
with authentication: create and edit /etc/turnuserdb.conf
file, or set up PostgreSQL or MySQL or Redis database for user accounts.
Use /etc/turnuserdb.conf.default as example for flat file DB,
Use /usr/local/etc/turnuserdb.conf.default as example for flat file DB,
or use /usr/local/share/turnserver/schema.sql as SQL database schema,
or use /usr/local/share/turnserver/schema.userdb.redis as Redis
database schema description and/or /usr/local/share/turnserver/schema.stats.redis
Expand Down
20 changes: 18 additions & 2 deletions src/apps/relay/mainrelay.c
Expand Up @@ -1815,18 +1815,34 @@ static int parse_arg_string(char *sarg, int *c, char **value)
int i = 0;
char *name = sarg;
while(*sarg) {
if((*sarg==' ') || (*sarg=='=')) {
if((*sarg==' ') || (*sarg=='=') || (*sarg=='\t')) {
*sarg=0;
do {
++sarg;
} while((*sarg==' ') || (*sarg=='='));
} while((*sarg==' ') || (*sarg=='=') || (*sarg=='\t'));
*value = sarg;
break;
}
++sarg;
*value=sarg;
}

if(value && *value && **value=='\"') {
*value += 1;
size_t len = strlen(*value);
while(len>0 && (
(*value[len-1]=='\n') ||
(*value[len-1]=='\r') ||
(*value[len-1]==' ') ||
(*value[len-1]=='\t')
) ) {
*value[--len]=0;
}
if(**value && *value[len-1]=='\"') {
*value[--len]=0;
}
}

while(long_options[i].name) {
if(strcmp(long_options[i].name,name)) {
++i;
Expand Down
2 changes: 1 addition & 1 deletion src/ns_turn_defs.h
Expand Up @@ -31,7 +31,7 @@
#ifndef __IOADEFS__
#define __IOADEFS__

#define TURN_SERVER_VERSION "1.8.5.0"
#define TURN_SERVER_VERSION "1.8.5.1"
#define TURN_SERVER_VERSION_NAME "Black Dow"
#define TURN_SOFTWARE "Citrix-"TURN_SERVER_VERSION" '"TURN_SERVER_VERSION_NAME"'"

Expand Down

0 comments on commit 8f3322c

Please sign in to comment.