Why 2 layers of loops inside mqtt3_socket_accept() when initializing SSL related resources?
Dear sir,
In mqtt3_socket_
#ifdef WITH_TLS
/* TLS init */
for(i=0; i<db->config-
for(j=0; j<db->config-
if(
if(
new_
if(
return -1;
}
SSL_
SSL_
new_
new_
bio = BIO_new_
SSL_
rc = SSL_accept(
if(rc != 1){
rc = SSL_get_
if(rc == SSL_ERROR_
}else if(rc == SSL_ERROR_
}else{
e = ERR_get_error();
while(e){
"Client connection from %s failed: %s.",
e = ERR_get_error();
}
|<---- Question 3): Why not return error here?
}
|<---- Question 2): Why no jump out of the 2 layers of loops here;?
}
}
}
}
}
#endif
I just think these codes are initializing SSL related resources.
So my question is:
1)
why 2 layers of loops are used here?
Is the purpose to find its listener structure?
But it is already found here:
for(i=0; i<db->config-
for(j=0; j<db->config-
if(
new_
new_
break;
}
}
}
if(!new_
mqtt3_
return -1;
}
2) Why no break to jump out of the 2 layers of loop after SSL related resource initialized?
3) Why not return error when error occurs?
4) Can we just pass pointer to struct listener instead of listensock to mqtt3_socket_
Thanks.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- mosquitto Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Yun Wu
- Solved:
- Last query:
- Last reply: