1
0
mirror of https://github.com/payden/libwsclient synced 2024-10-27 17:54:01 +00:00

Do not allow libwsclient_send after close frame.

This commit is contained in:
Payden Sutherland 2012-10-06 17:10:22 -04:00
parent a10c910559
commit b28c123b01

View File

@ -497,6 +497,11 @@ int stricmp(const char *s1, const char *s2) {
int libwsclient_send(wsclient *client, char *strdata) {
pthread_mutex_lock(&client->lock);
if(client->flags & CLIENT_SENT_CLOSE_FRAME) {
fprintf(stderr, "Trying to send data after sending close frame. Not sending.\n");
pthread_mutex_unlock(&client->lock);
return 0;
}
if(client->flags & CLIENT_CONNECTING) {
pthread_mutex_unlock(&client->lock);
pthread_join(client->handshake_thread, NULL);