Merge pull request 'Fix crash when trying to send data to a disconnected socket. Readme updates.' (#41) from more_fixups into master

Reviewed-on: #41
Reviewed-by: daniel_j <daniel@danieljon.es>
pull/55/head
daniel_j 5 years ago
commit 65b3d3cd2a
  1. 11
      CMakeLists.txt
  2. 12
      IRCClient/IRCBase.cpp
  3. 8
      README

@ -28,12 +28,15 @@ include_directories(${CMAKE_BINARY_DIR})
# #
# Additional paths # Additional paths
# #
option(IIRC_DEP_EXTRAS OFF) set(IIRC_DEP_INCLUDE "" CACHE PATH "Additional include path (single path only)")
option(IIRC_DEP_INCLUDE "") set(IIRC_DEP_LIBRARY "" CACHE PATH "Additional library path (single path only)")
option(IIRC_DEP_LIBRARY "") if (NOT IIRC_DEP_INCLUDE STREQUAL "")
if (${IIRC_DEP_EXTRAS})
include_directories(${IIRC_DEP_INCLUDE}) include_directories(${IIRC_DEP_INCLUDE})
message("Using additional include path: ${IIRC_DEP_INCLUDE}")
endif()
if (NOT IIRC_DEP_LIBRARY STREQUAL "")
link_directories(${IIRC_DEP_LIBRARY}) link_directories(${IIRC_DEP_LIBRARY})
message("Using additional library path: ${IIRC_DEP_LIBRARY}")
endif() endif()
# For GCC and Clang, basically. # For GCC and Clang, basically.

@ -601,6 +601,9 @@ void IRCBase::exceptSSL_Expired(bool except)
void IRCBase::command(const std::string& command, const std::vector<std::string>& args, const std::string& msg) void IRCBase::command(const std::string& command, const std::vector<std::string>& args, const std::string& msg)
{ {
if (!mp->isConnected)
return;
if (msg.empty()) if (msg.empty())
mp->writeNoMsg(command, args); mp->writeNoMsg(command, args);
else else
@ -609,16 +612,25 @@ void IRCBase::command(const std::string& command, const std::vector<std::string>
void IRCBase::command(const std::string& command, const std::string& msg) void IRCBase::command(const std::string& command, const std::string& msg)
{ {
if (!mp->isConnected)
return;
mp->write(command, msg); mp->write(command, msg);
} }
void IRCBase::raw(const std::string& data) void IRCBase::raw(const std::string& data)
{ {
if (!mp->isConnected)
return;
mp->writeNoMsg(data, {}); mp->writeNoMsg(data, {});
} }
void IRCBase::ctcp(const std::string& target, const std::string& command, const std::string& message) void IRCBase::ctcp(const std::string& target, const std::string& command, const std::string& message)
{ {
if (!mp->isConnected)
return;
std::string ctcpdata; std::string ctcpdata;
ctcpdata.push_back(CTCPflag); ctcpdata.push_back(CTCPflag);
ctcpdata.append(command); ctcpdata.append(command);

@ -5,6 +5,9 @@ http://www.idealirc.org/
Licensed under the GNU General Public License version 2. Licensed under the GNU General Public License version 2.
See LICENSE for more licensing information. See LICENSE for more licensing information.
Source code located at
https://git.idealirc.org/idealirc/idealirc
The goal for IdealIRC is to provide a modern compliance of the IRC protocol. It aims to be a simple IRC client The goal for IdealIRC is to provide a modern compliance of the IRC protocol. It aims to be a simple IRC client
with only the bare minimum for comfort implemented. The intent is to extend the client using scripts. with only the bare minimum for comfort implemented. The intent is to extend the client using scripts.
@ -15,11 +18,12 @@ There is also IRCv3 support which fixes some of the issues with the protocol, su
- Multiple prefixes - Mitigates a bug in the IRC protocol where users with with multiple privileges only listed - Multiple prefixes - Mitigates a bug in the IRC protocol where users with with multiple privileges only listed
the most significant privilege. the most significant privilege.
- Userhosts in /NAMES - Userhosts in /NAMES
For more info about IRCv3, visit https://ircv3.net/irc/
For more info about IRCv3, visit
https://ircv3.net/irc/
For general help with the client, visit For general help with the client, visit
http://www.idealirc.org/wiki http://www.idealirc.org/wiki
For building instructions and source code documentation, visit For building instructions and source code documentation, visit
https://git.idealirc.org:3000/idealirc/idealirc/wiki/Home https://git.idealirc.org/idealirc/idealirc/wiki/Home

Loading…
Cancel
Save