cleaning up code
parent
f62c74ae8b
commit
8ff903281f
|
@ -100,7 +100,8 @@ static int dtls_select(socklen_t sockfd, int to_sec)
|
||||||
return TEST_SELECT_FAIL;
|
return TEST_SELECT_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Accept(){
|
int Accept()
|
||||||
|
{
|
||||||
|
|
||||||
while (cleanup != 1) {
|
while (cleanup != 1) {
|
||||||
socklen_t clilen; /* length of address' */
|
socklen_t clilen; /* length of address' */
|
||||||
|
@ -162,6 +163,7 @@ int Accept(){
|
||||||
|
|
||||||
printf("Connection being re-routed to Thread Control.\n");
|
printf("Connection being re-routed to Thread Control.\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,12 +289,6 @@ void* ThreadControl(void* openSock)
|
||||||
printf("SSL_accept failed\n");
|
printf("SSL_accept failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_t threadID;
|
|
||||||
|
|
||||||
if (pthread_create(&threadID, NULL, ThreadControl, (void *)&ret) < 0) {
|
|
||||||
printf("pthread_create failed.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Connected with a client!\n");
|
printf("Connected with a client!\n");
|
||||||
|
|
||||||
if (( recvlen = CyaSSL_read(ssl, buff, sizeof(buff)-1)) > 0){
|
if (( recvlen = CyaSSL_read(ssl, buff, sizeof(buff)-1)) > 0){
|
||||||
|
|
Loading…
Reference in New Issue