fleaz / CptHook

Receive webhooks from different applications and post them to IRC channels
MIT License
17 stars 8 forks source link

Track state of IRC client #40

Closed fleaz closed 5 years ago

fleaz commented 5 years ago

I added a RWMutex to track if the IRC client object is currently connected. On connect and disconnect a write-lock is set which forbids any access to the client for the other parts of CptHook. The parts which access the client just use read-locks so they don't interfere which each other, but get blocked if a write-lock is currently in place.

This should fix #20 and #36 which are both resulting from the fact that CptHook tries to do stuff with the client while it is disconnected.