我正在尝试使用Polarssl创建SSL服务器。程序编译并运行,但是在从浏览器连接到服务器时遇到段错误。它出现在以下函数的循环中。谢谢!
int db_read(SSL_STRUCT* ssl, size_t len, unsigned char* buffer){
int r;
memset(buffer, 0, len);
printf("memset successful\n");
do {
r = ssl_read(&((ssl)->ssl), buffer, len-1);
}while(r == POLARSSL_ERR_NET_WANT_READ);
if(r < 0){
printf("server forgot his reading glasses at home-- %d\n", r);
}
return r;
}