Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,73 +0,0 @@
1
-/* 
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- * Copyright (C) 2006-2007 iptelorg GmbH
4
- *
5
- * This file is part of Kamailio, a free SIP server.
6
- *
7
- * Kamailio is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version
11
- *
12
- * Kamailio is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License 
18
- * along with this program; if not, write to the Free Software 
19
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20
- */
21
-
22
-#include "my_res.h"
23
-
24
-#include "my_cmd.h"
25
-
26
-#include "../../mem/mem.h"
27
-#include "../../dprint.h"
28
-#include "../../lib/srdb2/db_gen.h"
29
-
30
-#include <mysql.h>
31
-
32
-
33
-void my_res_free(db_res_t* res, struct my_res* payload)
34
-{
35
-	struct my_cmd* mcmd;
36
-
37
-	mcmd = DB_GET_PAYLOAD(res->cmd);
38
-
39
-	if (mcmd->st && mysql_stmt_free_result(mcmd->st)) {
40
-		ERR("mysql: Error while freeing MySQL result: %d, %s\n", 
41
-			mysql_stmt_errno(mcmd->st), mysql_stmt_error(mcmd->st));
42
-	}
43
-
44
-	db_drv_free(&payload->gen);
45
-	pkg_free(payload);
46
-}
47
-
48
-
49
-/*
50
- * Attach a mysql specific structure to db_res, this structure contains a pointer
51
- * to my_res_free which releases the mysql result stored in the mysql statement
52
- * and if there is a cursor open in the statement then it will be closed as well
53
- */
54
-int my_res(db_res_t* res)
55
-{
56
-	struct my_res* mr;
57
-
58
-	mr = (struct my_res*)pkg_malloc(sizeof(struct my_res));
59
-	if (mr == NULL) {
60
-		ERR("mysql: No memory left\n");
61
-		return -1;
62
-	}
63
-	if (db_drv_init(&mr->gen, my_res_free) < 0) goto error;
64
-	DB_SET_PAYLOAD(res, mr);
65
-	return 0;
66
-	
67
- error:
68
-	if (mr) {
69
-		db_drv_free(&mr->gen);
70
-		pkg_free(mr);
71
-	}
72
-	return -1;
73
-}
Browse code

db_mysql: updated include paths for libmysqlclient

- direct use of mysql_config, the old substitution done in module
Makefile can break the includes of libmysqlclient files
- reported by Ian Yu-Hsun Lin, GH#419

Daniel-Constantin Mierla authored on 26/11/2015 23:03:26
Showing 1 changed files
... ...
@@ -27,7 +27,7 @@
27 27
 #include "../../dprint.h"
28 28
 #include "../../lib/srdb2/db_gen.h"
29 29
 
30
-#include <mysql/mysql.h>
30
+#include <mysql.h>
31 31
 
32 32
 
33 33
 void my_res_free(db_res_t* res, struct my_res* payload)
Browse code

db_mysql: Remove SVN ID's, remove history sections

Olle E. Johansson authored on 11/03/2015 15:26:21
Showing 1 changed files
... ...
@@ -1,22 +1,15 @@
1 1
 /* 
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  * Copyright (C) 2006-2007 iptelorg GmbH
6 4
  *
7
- * This file is part of ser, a free SIP server.
5
+ * This file is part of Kamailio, a free SIP server.
8 6
  *
9
- * ser is free software; you can redistribute it and/or modify
7
+ * Kamailio is free software; you can redistribute it and/or modify
10 8
  * it under the terms of the GNU General Public License as published by
11 9
  * the Free Software Foundation; either version 2 of the License, or
12 10
  * (at your option) any later version
13 11
  *
14
- * For a license to use the ser software under conditions
15
- * other than those described here, or to purchase support for this
16
- * software, please contact iptel.org by e-mail at the following addresses:
17
- *    info@iptel.org
18
- *
19
- * ser is distributed in the hope that it will be useful,
12
+ * Kamailio is distributed in the hope that it will be useful,
20 13
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 14
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 15
  * GNU General Public License for more details.
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -23,7 +23,7 @@
23 23
  *
24 24
  * You should have received a copy of the GNU General Public License 
25 25
  * along with this program; if not, write to the Free Software 
26
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
27 27
  */
28 28
 
29 29
 #include "my_res.h"
Browse code

Changes necessary to make the module compile in the sip-router tree.

This is a set of changes necessary to make the LDAP module compile in the
sip-router tree. This includes:
* Extra stuff in the Makefile to link with libsrdb2
* Defined SER_MOD_INTERFACE in the makefile
* Updated relative paths to srdb2 header files

Jan Janak authored on 13/02/2009 00:51:33
Showing 1 changed files
... ...
@@ -32,7 +32,7 @@
32 32
 
33 33
 #include "../../mem/mem.h"
34 34
 #include "../../dprint.h"
35
-#include "../../db/db_gen.h"
35
+#include "../../lib/srdb2/db_gen.h"
36 36
 
37 37
 #include <mysql/mysql.h>
38 38
 
Browse code

- reordered included header files for better detection of missing headers - disable automatic database reconnects, they do not work with pre-compiled statements - error/info/log message cleanup - auto_reconnect module parameter removed - introduced new module parameter retries which controls the number of times queries are tried to execute on server on failures

Jan Janak authored on 16/01/2008 14:17:28
Showing 1 changed files
... ...
@@ -26,12 +26,15 @@
26 26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27 27
  */
28 28
 
29
-#include <mysql/mysql.h>
29
+#include "my_res.h"
30
+
31
+#include "my_cmd.h"
32
+
30 33
 #include "../../mem/mem.h"
31 34
 #include "../../dprint.h"
32 35
 #include "../../db/db_gen.h"
33
-#include "my_cmd.h"
34
-#include "my_res.h"
36
+
37
+#include <mysql/mysql.h>
35 38
 
36 39
 
37 40
 void my_res_free(db_res_t* res, struct my_res* payload)
... ...
@@ -41,7 +44,8 @@ void my_res_free(db_res_t* res, struct my_res* payload)
41 44
 	mcmd = DB_GET_PAYLOAD(res->cmd);
42 45
 
43 46
 	if (mcmd->st && mysql_stmt_free_result(mcmd->st)) {
44
-		ERR("Error while freeing MySQL result: %s\n", mysql_stmt_error(mcmd->st));
47
+		ERR("mysql: Error while freeing MySQL result: %d, %s\n", 
48
+			mysql_stmt_errno(mcmd->st), mysql_stmt_error(mcmd->st));
45 49
 	}
46 50
 
47 51
 	db_drv_free(&payload->gen);
... ...
@@ -60,7 +64,7 @@ int my_res(db_res_t* res)
60 64
 
61 65
 	mr = (struct my_res*)pkg_malloc(sizeof(struct my_res));
62 66
 	if (mr == NULL) {
63
-		ERR("No memory left\n");
67
+		ERR("mysql: No memory left\n");
64 68
 		return -1;
65 69
 	}
66 70
 	if (db_drv_init(&mr->gen, my_res_free) < 0) goto error;
Browse code

- re-submit compiled queries to the server upon reconnect - removed superfluous INFO statements - removed C++ style comments

Jan Janak authored on 13/07/2007 08:52:29
Showing 1 changed files
... ...
@@ -40,7 +40,7 @@ void my_res_free(db_res_t* res, struct my_res* payload)
40 40
 
41 41
 	mcmd = DB_GET_PAYLOAD(res->cmd);
42 42
 
43
-	if (mysql_stmt_free_result(mcmd->st)) {
43
+	if (mcmd->st && mysql_stmt_free_result(mcmd->st)) {
44 44
 		ERR("Error while freeing MySQL result: %s\n", mysql_stmt_error(mcmd->st));
45 45
 	}
46 46
 
Browse code

- mysql module updated to new db api

Jan Janak authored on 04/04/2007 11:48:20
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,76 @@
1
+/* 
2
+ * $Id$
3
+ *
4
+ * Copyright (C) 2001-2003 FhG Fokus
5
+ * Copyright (C) 2006-2007 iptelorg GmbH
6
+ *
7
+ * This file is part of ser, a free SIP server.
8
+ *
9
+ * ser is free software; you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation; either version 2 of the License, or
12
+ * (at your option) any later version
13
+ *
14
+ * For a license to use the ser software under conditions
15
+ * other than those described here, or to purchase support for this
16
+ * software, please contact iptel.org by e-mail at the following addresses:
17
+ *    info@iptel.org
18
+ *
19
+ * ser is distributed in the hope that it will be useful,
20
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
+ * GNU General Public License for more details.
23
+ *
24
+ * You should have received a copy of the GNU General Public License 
25
+ * along with this program; if not, write to the Free Software 
26
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
+ */
28
+
29
+#include <mysql/mysql.h>
30
+#include "../../mem/mem.h"
31
+#include "../../dprint.h"
32
+#include "../../db/db_gen.h"
33
+#include "my_cmd.h"
34
+#include "my_res.h"
35
+
36
+
37
+void my_res_free(db_res_t* res, struct my_res* payload)
38
+{
39
+	struct my_cmd* mcmd;
40
+
41
+	mcmd = DB_GET_PAYLOAD(res->cmd);
42
+
43
+	if (mysql_stmt_free_result(mcmd->st)) {
44
+		ERR("Error while freeing MySQL result: %s\n", mysql_stmt_error(mcmd->st));
45
+	}
46
+
47
+	db_drv_free(&payload->gen);
48
+	pkg_free(payload);
49
+}
50
+
51
+
52
+/*
53
+ * Attach a mysql specific structure to db_res, this structure contains a pointer
54
+ * to my_res_free which releases the mysql result stored in the mysql statement
55
+ * and if there is a cursor open in the statement then it will be closed as well
56
+ */
57
+int my_res(db_res_t* res)
58
+{
59
+	struct my_res* mr;
60
+
61
+	mr = (struct my_res*)pkg_malloc(sizeof(struct my_res));
62
+	if (mr == NULL) {
63
+		ERR("No memory left\n");
64
+		return -1;
65
+	}
66
+	if (db_drv_init(&mr->gen, my_res_free) < 0) goto error;
67
+	DB_SET_PAYLOAD(res, mr);
68
+	return 0;
69
+	
70
+ error:
71
+	if (mr) {
72
+		db_drv_free(&mr->gen);
73
+		pkg_free(mr);
74
+	}
75
+	return -1;
76
+}