Commit 0d18598f authored by Pekka Pessi's avatar Pekka Pessi

tport.c: add TPTAG_LOG() and TPTAG_DUMP() to tport_get_params()

Ignore-this: 463ce3a08bd78c8603f1c345e91f440c

Fixed return value from tport_set_params(), too.

darcs-hash:20090303135630-db55f-1f6f116757fd71c8f0427d012feebdf2b0a5203e.gz
parent 70eb364b
......@@ -472,6 +472,7 @@ static int init_test(tp_test_t *tt)
tp_name_t const *tpn;
tport_t *tp;
unsigned idle;
int logging = -1;
BEGIN();
......@@ -552,6 +553,15 @@ static int init_test(tp_test_t *tt)
TPTAG_IDLE_REF(idle),
TAG_END()), 1);
/* Check that logging tag works */
TEST(tport_get_params(tt->tt_srv_tports,
TPTAG_LOG_REF(logging),
TAG_END()), 1);
TEST(tport_set_params(tt->tt_srv_tports,
TPTAG_LOG(logging),
TAG_END()), 1);
for (tp = tport_primaries(tt->tt_srv_tports); tp; tp = tport_next(tp))
TEST_S(tport_name(tp)->tpn_ident, "server");
......@@ -1298,6 +1308,7 @@ static int tls_test(tp_test_t *tt)
TEST_1(pending_client_close > 0);
tp = tt->tt_rtport;
pending_server_close = tport_pend(tp, NULL, server_closed_callback, NULL);
TEST_1(pending_server_close > 0);
/* Send a largish message */
......
......@@ -1196,6 +1196,7 @@ int tport_get_params(tport_t const *self,
int n;
tport_params_t const *tpp;
int connect;
tport_master_t *mr = self->tp_master;
if (self == NULL)
return su_seterrno(EINVAL);
......@@ -1227,6 +1228,10 @@ int tport_get_params(tport_t const *self,
TPTAG_PUBLIC(self->tp_pri ?
self->tp_pri->pri_public : 0)),
TPTAG_TOS(tpp->tpp_tos),
TAG_IF((void *)self == (void *)mr,
TPTAG_LOG(mr->mr_log != 0)),
TAG_IF((void *)self == (void *)mr,
TPTAG_DUMP(mr->mr_dump)),
TAG_END());
ta_end(ta);
......@@ -1321,7 +1326,7 @@ int tport_set_params(tport_t *self,
tpp->tpp_pong2ping = pong2ping;
if (memcmp(tpp0, tpp, sizeof tpp) == 0)
return n;
return n + m;
if (tport_is_secondary(self) &&
self->tp_params == self->tp_pri->pri_primary->tp_params) {
......
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