Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTLS threaded read-write with same SSL object #448

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

SparkiDev
Copy link
Contributor

Add server and client DTLS example that have read and write threads that use the same SSL objects.
Server also has encryption threads when wolfSSL is compiled for that.

@SparkiDev SparkiDev self-assigned this Jul 29, 2024
@SparkiDev
Copy link
Contributor Author

wolfSSL/wolfssl#7796

Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encountered several benign warnings during build.

int main (int argc, char** argv)
{
/* standard variables used in a dtls client*/
int n = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client-dtls-rw-threads.c:158:21: warning: unused variable ‘readErr’ [-Wunused-variable]
  158 |     int             readErr;
      |                     ^~~~~~~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

int n = 0;
int sockfd = 0;
int err1;
int readErr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client-dtls-rw-threads.c:158:21: warning: unused variable ‘readErr’ [-Wunused-variable]
  158 |     int             readErr;
      |                     ^~~~~~~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

int on = 1;
int res = 1;
int connfd = 0;
int recvLen = 0; /* length of message */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server-dtls-rw-threads.c:232:19: warning: unused variable ‘recvLen’ [-Wunused-variable]
  232 |     int           recvLen = 0;    /* length of message */
      |                   ^~~~~~~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

threadArgs args;
pthread_t threadidReader;
pthread_t threadidWriter;
pthread_t threadidEnc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server-dtls-rw-threads.c:242:19: warning: unused variable ‘threadidEnc’ [-Wunused-variable]
  242 |     pthread_t     threadidEnc;
      |                   ^~~~~~~~~~~

(note this var is indeed used when building with -DWOLFSSL_THREADED_CRYPT, but only then.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@douzzer douzzer assigned SparkiDev and unassigned wolfSSL-Bot Oct 22, 2024
Add server and client DTLS example that have read and write threads that
use the same SSL objects.
Server also has encryption threads when wolfSSL is compiled for that.
@douzzer douzzer merged commit 6c5b5f4 into wolfSSL:master Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants