Option for NODELAY
This commit is contained in:
parent
bcd784b1f0
commit
343c72b288
|
@ -50,7 +50,6 @@ ogs_sock_t *ogs_sctp_socket(int family, int type, ogs_socknode_t *node)
|
|||
.sctp.max_num_of_istreams = 65535,
|
||||
.sctp.max_attempts = 4,
|
||||
.sctp.max_initial_timeout = 8000, /* 8 seconds */
|
||||
.nodelay = true /* Turn-on NODELAY */
|
||||
};
|
||||
|
||||
ogs_sctp_set_option(&option, node);
|
||||
|
@ -61,11 +60,6 @@ ogs_sock_t *ogs_sctp_socket(int family, int type, ogs_socknode_t *node)
|
|||
rv = subscribe_to_events(new);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
if (node->option.nodelay) {
|
||||
rv = set_nodelay(new, node->option.nodelay);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
|
||||
rv = set_paddrparams(new, &option);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
|
@ -75,6 +69,13 @@ ogs_sock_t *ogs_sctp_socket(int family, int type, ogs_socknode_t *node)
|
|||
rv = set_initmsg(new, &option);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
if (node) {
|
||||
if (node->option.nodelay) {
|
||||
rv = set_nodelay(new, node->option.nodelay);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ ogs_sock_t *ogs_sctp_socket(int family, int type, ogs_socknode_t *node)
|
|||
.sctp.max_num_of_istreams = 65535,
|
||||
.sctp.max_attempts = 4,
|
||||
.sctp.max_initial_timeout = 8000, /* 8 seconds */
|
||||
.nodelay = true /* Turn-on NODELAY */
|
||||
};
|
||||
|
||||
ogs_sctp_set_option(&option, node);
|
||||
|
@ -78,11 +77,13 @@ ogs_sock_t *ogs_sctp_socket(int family, int type, ogs_socknode_t *node)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (option.nodelay) {
|
||||
if (usrsctp_setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY,
|
||||
&on, sizeof(int)) < 0) {
|
||||
ogs_error("usrsctp_setsockopt SCTP_NODELAY failed");
|
||||
return NULL;
|
||||
if (node) {
|
||||
if (node->option.nodelay) {
|
||||
if (usrsctp_setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY,
|
||||
&on, sizeof(int)) < 0) {
|
||||
ogs_error("usrsctp_setsockopt SCTP_NODELAY failed");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue