mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	config_transport: Enable TCP_NODELAY on TLS transports
We did this for TCP transports already but I'm not sure why we didn't do it for TLS transports. ASTERISK_27474 #not_final_fix Change-Id: I5b1ef4b882f7b859e718236686b7898751dbb262
This commit is contained in:
		| @@ -618,6 +618,8 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj) | ||||
| 				&temp_state->state->factory); | ||||
| 		} | ||||
| 	} else if (transport->type == AST_TRANSPORT_TLS) { | ||||
| 		static int option = 1; | ||||
|  | ||||
| 		if (transport->async_operations > 1 && ast_compare_versions(pj_get_version(), "2.5.0") < 0) { | ||||
| 			ast_log(LOG_ERROR, "Transport: %s: When protocol=tls and pjproject version < 2.5.0, async_operations can't be > 1\n", | ||||
| 					ast_sorcery_object_get_id(obj)); | ||||
| @@ -627,6 +629,13 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj) | ||||
| 		temp_state->state->tls.password = pj_str((char*)transport->password); | ||||
| 		set_qos(transport, &temp_state->state->tls.qos_params); | ||||
|  | ||||
| 		/* sockopt_params.options is copied to each newly connected socket */ | ||||
| 		temp_state->state->tls.sockopt_params.options[0].level = pj_SOL_TCP(); | ||||
| 		temp_state->state->tls.sockopt_params.options[0].optname = pj_TCP_NODELAY(); | ||||
| 		temp_state->state->tls.sockopt_params.options[0].optval = &option; | ||||
| 		temp_state->state->tls.sockopt_params.options[0].optlen = sizeof(option); | ||||
| 		temp_state->state->tls.sockopt_params.cnt = 1; | ||||
|  | ||||
| 		for (i = 0; i < BIND_TRIES && res != PJ_SUCCESS; i++) { | ||||
| 			if (perm_state && perm_state->state && perm_state->state->factory | ||||
| 				&& perm_state->state->factory->destroy) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user