Skip to content

Commit

Permalink
Bugfix in channel unsubscribe.
Browse files Browse the repository at this point in the history
  • Loading branch information
phlegx committed Jun 29, 2015
1 parent 7af4e25 commit d786016
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WebsocketRailsClient++ (v0.7.4-NB)
# WebsocketRailsClient++ (v0.7.5-NB)

WebsocketRailsClient++ is a C++ library that uses the implementation of RFC6455 (The WebSocket Protocol)
implemented in the WebSocket++ library, the Json++ light-weight JSON parser and the Boost library. It allows
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/channel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : channel.cpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : Channel Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/channel.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : channel.hpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : Channel Header Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/event.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : event.cpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : Event Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/event.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : event.hpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : Event Header Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/websocket.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : websocket.hpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : Websocket Header File in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/websocket_connection.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : websocket.cpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : WebsocketConnection Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/websocket_connection.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : websocket.hpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : WebsocketConnection Header Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down
14 changes: 7 additions & 7 deletions websocket-rails-client/websocket_rails.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : websocket_rails.cpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : WebsocketRails Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down Expand Up @@ -264,31 +264,31 @@ Channel * WebsocketRails::subscribePrivate(std::string channel_name, cb_func suc


void WebsocketRails::unsubscribe(std::string channel_name) {
Channel * channel;
Channel channel;
{
websocket_rails_lock guard(channel_queue_mutex);
if(this->channel_queue.find(channel_name) == this->channel_queue.end()) {
return;
}
channel = &this->channel_queue[channel_name];
channel = this->channel_queue[channel_name];
this->channel_queue.erase(channel_name);
}
cb_func success_callback, failure_callback;
channel->destroy(success_callback, failure_callback);
channel.destroy(success_callback, failure_callback);
}


void WebsocketRails::unsubscribe(std::string channel_name, cb_func success_callback, cb_func failure_callback) {
Channel * channel;
Channel channel;
{
websocket_rails_lock guard(channel_queue_mutex);
if(this->channel_queue.find(channel_name) == this->channel_queue.end()) {
return;
}
channel = &this->channel_queue[channel_name];
channel = this->channel_queue[channel_name];
this->channel_queue.erase(channel_name);
}
channel->destroy(success_callback, failure_callback);
channel.destroy(success_callback, failure_callback);
}


Expand Down
2 changes: 1 addition & 1 deletion websocket-rails-client/websocket_rails.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* Name : websocket_rails.hpp
* Version : v0.7.4-NB
* Version : v0.7.5-NB
* Description : WesocketRails Header Class in C++, Ansi-style
* Author : Egon Zemmer
* Company : Phlegx Systems
Expand Down

0 comments on commit d786016

Please sign in to comment.