Re: [PATCH] Minor Issue when alt-host is set on EMI/UCP
"Vincent CHAVANIS" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <135701c8af8f$156565d0$9600a8c0@VINCE> |
Oups,
wrong patch, this is it:
diff -rauw /gateway-cvs/gw/smsc/smsc_emi.c /gateway/gw/smsc/smsc_emi.c
--- /gateway-cvs/gw/smsc/smsc_emi.c 2008-01-09 21:06:52.000000000 +0100
+++ /gateway/gw/smsc/smsc_emi.c 2008-05-06 17:29:03.000000000 +0200
@@ -267,7 +274,7 @@
static Connection *open_send_connection(SMSCConn *conn)
{
PrivData *privdata = conn->data;
- int result, alt_host, do_alt_host;
+ int result, alt_host, do_alt_host, is_primary;
struct emimsg *emimsg;
Connection *server;
Msg *msg;
@@ -278,6 +285,7 @@
privdata->alt_port != 0;
alt_host = 0;
+ is_primary = 1;
mutex_lock(conn->flow_mutex);
conn->status = SMSCCONN_RECONNECTING;
@@ -307,6 +315,7 @@
alt_host=1;
else
alt_host=0;
+ is_primary=1;
} else {
info(0, "EMI2[%s]: connecting to Alternate SMSC",
octstr_get_cstr(privdata->name));
@@ -316,6 +325,7 @@
(privdata->alt_port ? privdata->alt_port : privdata->port),
privdata->our_port, conn->our_host);
alt_host=0;
+ is_primary=0;
}
if (privdata->shutdown) {
conn_destroy(server);
@@ -364,6 +374,12 @@
mutex_lock(conn->flow_mutex);
conn->status = SMSCCONN_ACTIVE;
conn->connect_time = time(NULL);
+ if (is_primary == 0)
+ conn->name = octstr_format("EMI2:%S:%d:%S", privdata->alt_host,
privdata->alt_port ? privdata->alt_port : privdata->port,
+ privdata->username ?
privdata->username : octstr_imm("null"));
+ else
+ conn->name = octstr_format("EMI2:%S:%d:%S", privdata->host,
privdata->port,
+ privdata->username ?
privdata->username : octstr_imm("null"));
mutex_unlock(conn->flow_mutex);
bb_smscconn_connected(conn);
return server;
----- Original Message -----
From: "Vincent CHAVANIS" <[email protected]>
To: <[email protected]>
Sent: Tuesday, May 06, 2008 4:33 PM
Subject: [PATCH] Minor Issue when alt-host is set on EMI/UCP
> Hi all,
>
> Here is a minor fix to get the real name of the connection
> when alt-host is set. (especially for the web status)
> Without this patch, we will get the primary hostname
> even if we are connected to the alt-host
>
> Vincent.
>
>
> diff -rauw /gateway-cvs/gw/smsc/smsc_emi.c /gateway/gw/smsc/smsc_emi.c
> --- /gateway-cvs/gw/smsc/smsc_emi.c 2008-01-09 21:06:52.000000000
> +0100
> +++ /gateway/gw/smsc/smsc_emi.c 2008-05-06 15:50:52.000000000 +0200
> @@ -364,6 +371,8 @@
> mutex_lock(conn->flow_mutex);
> conn->status = SMSCCONN_ACTIVE;
> conn->connect_time = time(NULL);
> + conn->name = octstr_format("EMI2:%S:%d:%S", privdata->host,
> privdata->port,
> + privdata->username ?
> privdata->username : octstr_imm("null"));
> mutex_unlock(conn->flow_mutex);
> bb_smscconn_connected(conn);
> return server;
>
> --
> Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
> Service Technique/Reseau - NOC
> Direction du Developpement xMS+
> http://www.telemaque.fr/
> [email protected]
>
>
>
>