Lines Matching refs:ret
99 int ret, len;
114 if ((ret = mbedtls_ssl_setup(&ssl, thread_info->config)) != 0) {
116 thread_id, (unsigned int) -ret);
127 while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) {
128 if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
130 thread_id, (unsigned int) -ret);
145 ret = mbedtls_ssl_read(&ssl, buf, len);
147 if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
151 if (ret <= 0) {
152 switch (ret) {
165 thread_id, (unsigned int) -ret);
170 len = ret;
174 if (ret > 0) {
187 while ((ret = mbedtls_ssl_write(&ssl, buf, len)) <= 0) {
188 if (ret == MBEDTLS_ERR_NET_CONN_RESET) {
194 if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
196 thread_id, (unsigned int) ret);
201 len = ret;
207 while ((ret = mbedtls_ssl_close_notify(&ssl)) < 0) {
208 if (ret != MBEDTLS_ERR_SSL_WANT_READ &&
209 ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
211 thread_id, (unsigned int) ret);
218 ret = 0;
223 if (ret != 0) {
225 mbedtls_strerror(ret, error_buf, 100);
227 thread_id, (unsigned int) -ret, error_buf);
241 int ret, i;
270 if ((ret = pthread_create(&threads[i].thread, NULL, handle_ssl_connection,
272 return ret;
280 int ret;
328 ret = MBEDTLS_ERR_SSL_HW_ACCEL_FAILED;
338 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
342 (unsigned int) -ret);
359 ret = mbedtls_x509_crt_parse(&srvcert, (const unsigned char *) mbedtls_test_srv_crt,
361 if (ret != 0) {
362 mbedtls_printf(" failed\n ! mbedtls_x509_crt_parse returned %d\n\n", ret);
366 ret = mbedtls_x509_crt_parse(&cachain, (const unsigned char *) mbedtls_test_cas_pem,
368 if (ret != 0) {
369 mbedtls_printf(" failed\n ! mbedtls_x509_crt_parse returned %d\n\n", ret);
374 ret = mbedtls_pk_parse_key(&pkey, (const unsigned char *) mbedtls_test_srv_key,
377 if (ret != 0) {
378 mbedtls_printf(" failed\n ! mbedtls_pk_parse_key returned %d\n\n", ret);
389 if ((ret = mbedtls_ssl_config_defaults(&conf,
394 (unsigned int) -ret);
411 if ((ret = mbedtls_ssl_conf_own_cert(&conf, &srvcert, &pkey)) != 0) {
412 mbedtls_printf(" failed\n ! mbedtls_ssl_conf_own_cert returned %d\n\n", ret);
424 if ((ret = mbedtls_net_bind(&listen_fd, NULL, "4433", MBEDTLS_NET_PROTO_TCP)) != 0) {
425 mbedtls_printf(" failed\n ! mbedtls_net_bind returned %d\n\n", ret);
433 if (ret != 0) {
435 mbedtls_strerror(ret, error_buf, 100);
436 mbedtls_printf(" [ main ] Last error was: -0x%04x - %s\n", (unsigned int) -ret,
446 if ((ret = mbedtls_net_accept(&listen_fd, &client_fd,
449 (unsigned int) ret);
456 if ((ret = thread_create(&client_fd)) != 0) {
457 mbedtls_printf(" [ main ] failed: thread_create returned %d\n", ret);
462 ret = 0;
483 mbedtls_exit(ret);