aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-07 01:54:19 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-07 01:54:19 +0800
commit43d9eec14b9ec59f19a95b864ace7fb798724e2e (patch)
treeeb79cbe2c38cab890556cab9f74d8677491d47e0 /src
parentd5918ff9e40b4443d4490ba18d785f5e55591a2c (diff)
msc: Make close_msc public, call it from main..
We would have not stopped the timer, fix that by only having one function to close the connection to the msc.
Diffstat (limited to 'src')
-rw-r--r--src/main.c5
-rw-r--r--src/msc_conn.c8
2 files changed, 5 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 8ce1330..a632a7c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -748,10 +748,7 @@ out:
static void sigusr2()
{
printf("Closing the MSC connection on demand.\n");
- close(bsc.msc_connection.bfd.fd);
- bsc_unregister_fd(&bsc.msc_connection.bfd);
- bsc.msc_connection.bfd.fd = -1;
- release_bsc_resources(&bsc);
+ msc_close_connection(&bsc);
}
static void print_help()
diff --git a/src/msc_conn.c b/src/msc_conn.c
index b569bf1..ad48490 100644
--- a/src/msc_conn.c
+++ b/src/msc_conn.c
@@ -72,7 +72,7 @@ void msc_clear_queue(struct bsc_data *data)
}
}
-static void close_msc(struct bsc_data *bsc)
+void msc_close_connection(struct bsc_data *bsc)
{
struct bsc_fd *bfd = &bsc->msc_connection.bfd;
@@ -89,14 +89,14 @@ static void msc_connect_timeout(void *_bsc_data)
struct bsc_data *bsc_data = _bsc_data;
LOGP(DMSC, LOGL_ERROR, "Timeout on the MSC connection.\n");
- close_msc(bsc_data);
+ msc_close_connection(bsc_data);
}
static void msc_pong_timeout(void *_bsc_data)
{
struct bsc_data *bsc_data = _bsc_data;
LOGP(DMSC, LOGL_ERROR, "MSC didn't respond to ping. Closing.\n");
- close_msc(bsc_data);
+ msc_close_connection(bsc_data);
}
static void send_ping(struct bsc_data *bsc)
@@ -152,7 +152,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd)
else
fprintf(stderr, "Error in the IPA stream.\n");
- close_msc(bsc);
+ msc_close_connection(bsc);
return -1;
}