Commit f54a0e37 authored by François Grisez's avatar François Grisez

Merge branch 'master' of git.linphone.org:belle-sip

parents 637d7506 8bd61ce3
......@@ -213,12 +213,17 @@ if(APPLE)
endif()
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(WIN32)
add_definitions(
-DBELLESIP_EXPORTS
-DBELLESIP_INTERNAL_EXPORTS
)
set(BELLESIP_CPPFLAGS ${BCTOOLBOX_CPPFLAGS})
if(ENABLE_STATIC)
list(APPEND BELLESIP_CPPFLAGS "-DBELLESIP_STATIC")
endif()
if(BELLESIP_CPPFLAGS)
list(REMOVE_DUPLICATES BELLESIP_CPPFLAGS)
add_definitions(${BELLESIP_CPPFLAGS})
endif()
add_definitions("-DBELLESIP_EXPORTS")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_definitions(
-DHAVE_COMPILER_TLS
......
......@@ -26,6 +26,7 @@
# BELLESIP_FOUND - system has belle-sip
# BELLESIP_INCLUDE_DIRS - the belle-sip include directory
# BELLESIP_LIBRARIES - The libraries needed to use belle-sip
# BELLESIP_CPPFLAGS - The compilation flags needed to use belle-sip
# BELLESIP_LDFLAGS - The linking flags needed to use belle-sip
if(NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
......@@ -58,6 +59,7 @@ else()
endif()
list(APPEND BELLESIP_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS})
list(APPEND BELLESIP_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES})
set(BELLESIP_CPPFLAGS @BELLESIP_CPPFLAGS@)
set(BELLESIP_LDFLAGS "@LINK_FLAGS_STR@")
if(TUNNEL_FOUND)
list(APPEND BELLESIP_INCLUDE_DIRS ${TUNNEL_INCLUDE_DIRS})
......
......@@ -42,17 +42,18 @@ typedef unsigned __int64 uint64_t;
#define BELLESIP_INLINE inline
#endif
#ifdef _WIN32
#ifdef BELLESIP_EXPORTS
#define BELLESIP_EXPORT __declspec(dllexport)
#define BELLESIP_VAR_EXPORT __declspec(dllexport)
#else
#define BELLESIP_EXPORT
#define BELLESIP_VAR_EXPORT extern __declspec(dllimport)
#endif
#ifdef _MSC_VER
#ifdef BELLESIP_STATIC
#define BELLESIP_EXPORT
#else
#ifdef BELLESIP_EXPORTS
#define BELLESIP_EXPORT __declspec(dllexport)
#else
#define BELLESIP_EXPORT __declspec(dllimport)
#endif
#endif
#else
#define BELLESIP_VAR_EXPORT extern
#define BELLESIP_EXPORT extern
#define BELLESIP_EXPORT
#endif
#define BELLESIP_UNUSED(a) (void)a;
......
......@@ -731,7 +731,7 @@ belle_sip_list_t *belle_sip_parse_directory(const char *path, const char *file_t
}
/* loop on all directory files */
errno = 0;
errno = 0;
ent = readdir(dir);
while (ent != NULL) {
/* filter on file type if given */
......
......@@ -1012,6 +1012,12 @@ static void belle_sip_channel_handle_error(belle_sip_channel_t *obj){
int belle_sip_channel_notify_timeout(belle_sip_channel_t *obj){
const int too_long=60;
if (obj->state != BELLE_SIP_CHANNEL_READY){
/*no need to notify the timeout if the channel is already in error or retry state*/
return FALSE;
}
if ((int)(belle_sip_time_ms() - obj->last_recv_time) >= (too_long * 1000)){
belle_sip_message("A timeout related to this channel occured and no message received during last %i seconds. This channel is suspect, moving to error state",too_long);
channel_set_state(obj,BELLE_SIP_CHANNEL_ERROR);
......
......@@ -277,7 +277,7 @@ void belle_sip_transaction_notify_timeout(belle_sip_transaction_t *t){
belle_sip_object_ref(t); /*take a ref in the case where the app calls belle_sip_transaction_terminate() within the timeout listener*/
if (strcmp(belle_sip_request_get_method(t->request),"REGISTER")==0){
if ( belle_sip_channel_notify_timeout(t->channel)==TRUE){
belle_sip_warning("Transaction [%p] reporting timeout, reporting to channel.",t);
belle_sip_warning("Transaction [%p] has timeout, reported to channel.",t);
t->timed_out=TRUE;
}
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment