summarylogtreecommitdiffstats
path: root/279f184bc9972778ce9c1eb1c46ae67d5705f66b.patch
blob: f806345be39dbb3bd2dfbe145dbb0ad92f052f68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 279f184bc9972778ce9c1eb1c46ae67d5705f66b Mon Sep 17 00:00:00 2001
From: Simon Morlat <simon.morlat@linphone.org>
Date: Tue, 24 Apr 2018 16:18:53 +0200
Subject: [PATCH] Add accessor to know if a tport is server.

---
 configure.ac                            | 2 +-
 libsofia-sip-ua/tport/sofia-sip/tport.h | 3 +++
 libsofia-sip-ua/tport/tport.c           | 4 ++++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 47a2d615..8ad82e04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,7 +11,7 @@ dnl information on the package
 dnl ---------------------------
 
 dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.13.24bc])
+AC_INIT([sofia-sip], [1.13.25bc])
 AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.13])
diff --git a/libsofia-sip-ua/tport/sofia-sip/tport.h b/libsofia-sip-ua/tport/sofia-sip/tport.h
index 9b92a6fd..3b76a99b 100644
--- a/libsofia-sip-ua/tport/sofia-sip/tport.h
+++ b/libsofia-sip-ua/tport/sofia-sip/tport.h
@@ -380,6 +380,9 @@ TPORT_DLL void tport_set_user_data(tport_t *self, void* data);
 /** Get Data from tport */
 TPORT_DLL void* tport_get_user_data(tport_t *self);
 
+/** Return TRUE if underlying connection was server (created by accept()), FALSE otherwise*/
+TPORT_DLL int tport_is_server(tport_t *self);
+
 /* ---------------------------------------------------------------------- */
 /* SigComp-related functions */
 
diff --git a/libsofia-sip-ua/tport/tport.c b/libsofia-sip-ua/tport/tport.c
index 84ccfafe..05ca1209 100644
--- a/libsofia-sip-ua/tport/tport.c
+++ b/libsofia-sip-ua/tport/tport.c
@@ -943,6 +943,10 @@ tport_t *tport_alloc_secondary(tport_primary_t *pri,
   return self;
 }
 
+int tport_is_server(tport_t *self){
+	return self->tp_accepted;
+}
+
 
 /** Create a connected transport object with socket.
  *