Skip to content

Commit

Permalink
Removed unneeded ready flag in the SCTP stack management (issue meete…
Browse files Browse the repository at this point in the history
  • Loading branch information
meetecho committed Apr 15, 2015
1 parent cb1ca70 commit 5f030f2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ janus_sctp_association *janus_sctp_association_create(void *dtls, uint64_t handl
}
sctp->dtls = dtls;
sctp->handle_id = handle_id;
sctp->ready = FALSE; /* We wait for the association setup, for this */
sctp->local_port = 5000; /* FIXME We always use this one */
sctp->remote_port = udp_port;
sctp->sock = NULL;
Expand Down Expand Up @@ -273,7 +272,6 @@ int janus_sctp_association_setup(janus_sctp_association *sctp) {
#ifdef HAVE_SCONN_LEN
sconn.sconn_len = sizeof(struct sockaddr_conn);
#endif
sctp->ready = TRUE;
if(usrsctp_connect(sock, (struct sockaddr *)&sconn, sizeof(struct sockaddr_conn)) < 0) {
JANUS_LOG(LOG_ERR, "[%"SCNu64"] Error connecting to SCTP server at port %"SCNu16"\n", sctp->handle_id, sctp->remote_port);
return -1;
Expand Down Expand Up @@ -1247,7 +1245,7 @@ void *janus_sctp_thread(void *data) {
while(sctp->dtls != NULL && sctp_running) {
/* Anything to do at all? */
janus_mutex_lock(&sctp->mutex);
if(!sctp->ready || (g_queue_is_empty(sctp->in_messages) && g_queue_is_empty(sctp->out_messages))) {
if(g_queue_is_empty(sctp->in_messages) && g_queue_is_empty(sctp->out_messages)) {
janus_mutex_unlock(&sctp->mutex);
g_usleep (10000);
continue;
Expand Down
2 changes: 0 additions & 2 deletions sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ typedef struct janus_sctp_association {
void *dtls;
/*! \brief Identifier of the handle owning this SCTP association (for debugging purposes only) */
uint64_t handle_id;
/*! \brief Whether this SCTP association is ready to be used or not */
gboolean ready;
/*! \brief Array of SCTP channels */
struct janus_sctp_channel channels[NUMBER_OF_CHANNELS];
/*! \brief Array of streams (both inbound and outbound) */
Expand Down

0 comments on commit 5f030f2

Please sign in to comment.