Skip to content

Commit

Permalink
lock all uses of ssl objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Mauchle committed Mar 22, 2018
1 parent 408151a commit 2246751
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 144 deletions.
4 changes: 3 additions & 1 deletion radsecproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ struct client *addclient(struct clsrvconf *conf, uint8_t lock) {
if (conf->pdef->addclient)
conf->pdef->addclient(new);
else
new->replyq = newqueue();
new->replyq = newqueue();
pthread_mutex_init(&new->lock, NULL);
list_push(conf->clients, new);
if (lock)
pthread_mutex_unlock(conf->lock);
Expand Down Expand Up @@ -261,6 +262,7 @@ void removelockedclient(struct client *client) {
removeclientrqs(client);
removequeue(client->replyq);
list_removedata(conf->clients, client);
pthread_mutex_destroy(&client->lock);
free(client->addr);
free(client);
}
Expand Down
1 change: 1 addition & 0 deletions radsecproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ struct client {
struct clsrvconf *conf;
int sock;
SSL *ssl;
pthread_mutex_t lock;
struct request *rqs[MAX_REQUESTS];
struct gqueue *replyq;
struct gqueue *rbios; /* for dtls */
Expand Down
Loading

0 comments on commit 2246751

Please sign in to comment.