mirror of
				https://github.com/open5gs/open5gs.git
				synced 2025-11-04 05:53:18 +00:00 
			
		
		
		
	Option for NODELAY
This commit is contained in:
		@@ -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_num_of_istreams = 65535,
 | 
				
			||||||
        .sctp.max_attempts = 4,
 | 
					        .sctp.max_attempts = 4,
 | 
				
			||||||
        .sctp.max_initial_timeout = 8000,   /* 8 seconds */
 | 
					        .sctp.max_initial_timeout = 8000,   /* 8 seconds */
 | 
				
			||||||
        .nodelay = true                     /* Turn-on NODELAY */
 | 
					 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ogs_sctp_set_option(&option, node);
 | 
					    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);
 | 
					    rv = subscribe_to_events(new);
 | 
				
			||||||
    ogs_assert(rv == OGS_OK);
 | 
					    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);
 | 
					    rv = set_paddrparams(new, &option);
 | 
				
			||||||
    ogs_assert(rv == OGS_OK);
 | 
					    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);
 | 
					    rv = set_initmsg(new, &option);
 | 
				
			||||||
    ogs_assert(rv == OGS_OK);
 | 
					    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;
 | 
					    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_num_of_istreams = 65535,
 | 
				
			||||||
        .sctp.max_attempts = 4,
 | 
					        .sctp.max_attempts = 4,
 | 
				
			||||||
        .sctp.max_initial_timeout = 8000,   /* 8 seconds */
 | 
					        .sctp.max_initial_timeout = 8000,   /* 8 seconds */
 | 
				
			||||||
        .nodelay = true                     /* Turn-on NODELAY */
 | 
					 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ogs_sctp_set_option(&option, node);
 | 
					    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;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (option.nodelay) {
 | 
					    if (node) {
 | 
				
			||||||
        if (usrsctp_setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY,
 | 
					        if (node->option.nodelay) {
 | 
				
			||||||
                    &on, sizeof(int)) < 0) {
 | 
					            if (usrsctp_setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY,
 | 
				
			||||||
            ogs_error("usrsctp_setsockopt SCTP_NODELAY failed");
 | 
					                        &on, sizeof(int)) < 0) {
 | 
				
			||||||
            return NULL;
 | 
					                ogs_error("usrsctp_setsockopt SCTP_NODELAY failed");
 | 
				
			||||||
 | 
					                return NULL;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user