Commit graph

440 commits

Author SHA1 Message Date
Aaron Weiss
e7440d9b23
Made some small assorted changes. 2017-06-20 11:48:13 -04:00
Aaron Weiss
1c1e4af311
Updated tests to compile. 2017-06-19 14:42:27 -04:00
Aaron Weiss
cf3ee671ed
Merge branch 'master' into async 2017-06-19 14:33:02 -04:00
Aaron Weiss
e5e33e9069
Fixed bug when compiling with no-default-features. 2017-06-19 14:19:57 -04:00
Manish Goregaokar
02f9968b0c
Update OpenSSL to 0.9. 2017-06-19 14:11:57 -04:00
Aaron Weiss
f0f0b95038
Ran rustfmt on all the code. 2017-06-19 13:59:26 -04:00
Aaron Weiss
388628d62a
Applied a bunch of clippy lints. 2017-06-19 13:46:01 -04:00
Torbjörn Lönnemark
1c84b699d4 Add support for RPL_TOPICWHOTIME (numeric 333) 2017-06-15 21:20:17 +02:00
Torbjörn Lönnemark
e33248f043 Replace rustc-serialize with serde
rustc-serialize is deprecated.

Fixes #84.
2017-06-14 22:20:31 +02:00
TheMightyBuzzard
c6efd4d9f0 Properly remove users from channels on quit 2017-06-06 04:37:25 -05:00
Aaron Weiss
9a2222d802
Updated Tokio protocol code. 2017-05-26 14:09:09 +02:00
Aaron Weiss
38c7ed2c71
Changed Server API to provide channel lists, and fixed channel tracking
to work with user PARTs.
2017-05-25 17:27:00 +02:00
Aaron Weiss
f3fb23d755
Added input sanitization to prevent newline injection (fixes #80). 2017-05-02 19:47:16 -04:00
TheMightyBuzzard
9706d93968 track nick changes
Client did not track nick changes. This solves that, although admittedly in a rather inefficient way.
2017-04-11 07:29:33 -05:00
Perl I. Weird
2da5f4defc Allow all of SSL2, SSL3 and TLS1 connections 2017-04-01 13:22:25 -07:00
Dominik Miedziński
fcb0c1da64 Use CTCP VERSION and SOURCE replies from Config 2017-03-22 22:06:43 +01:00
Aaron Weiss
6a0f2a184f
Merge branch 'master' into async 2017-03-15 12:44:46 -04:00
Aaron Weiss
fbeeaed874
Changed implementation of socket_addr on Config. 2017-03-15 12:42:15 -04:00
Aaron Weiss
c402371450 Merge pull request #75 from miedzinski/fix-warnings
Remove unused imports and fix broken test
2017-03-15 12:35:27 -04:00
Dominik Miedziński
59b79c06cc Remove unused imports and fix broken test 2017-03-15 17:28:07 +01:00
Dominik Miedziński
f4f49c6dd3 Ignore CTCP PINGs without timestamps 2017-03-15 17:11:19 +01:00
Aaron Weiss
342a11aba4
Added dependency on futures. 2017-01-15 18:10:35 -05:00
Aaron Weiss
abf981c4ad
Added dependency for native-tls. 2017-01-15 18:08:03 -05:00
Aaron Weiss
db140baf9e
Added dependence on tokio-tls. 2017-01-15 17:50:56 -05:00
Aaron Weiss
d9fc586b8c
Added socket_addr() helper to Config. 2017-01-15 17:32:41 -05:00
Aaron Weiss
1f3b3d64b5
IrcCodec is no longer paramterized by inner codec type. 2017-01-15 17:06:43 -05:00
Aaron Weiss
a6303d4858
Removed dependence on tokio-proto. 2017-01-15 17:02:37 -05:00
Aaron Weiss
843b7ba3c0
Implemented IrcCodec and IrcProto using LineCodec. 2017-01-15 16:34:59 -05:00
Aaron Weiss
7003270834
Removed parameterization of LineCodec on encoding. 2017-01-15 16:34:37 -05:00
Aaron Weiss
59e219f466
Implemented a line-delimited codec. 2017-01-15 14:28:12 -05:00
Aaron Weiss
880870770e
Moved protocol-related stuff to new proto module. 2017-01-15 13:41:16 -05:00
Aaron Weiss
1fd5668def
Removed optional encoding feature, forcing encoding always. Temporarily
purged SSL support.
2017-01-15 13:31:50 -05:00
Aaron Weiss
d13a28ff98
Added send_part to ServerExt. 2016-12-18 16:25:24 -05:00
Dominik Miedziński
e13f94e0c2 Rejoin all channels on reconnect (fixes #55) 2016-09-24 23:22:20 +02:00
Aaron Weiss
5b8f320050
Implemented channel keys for autojoined channels (fixes #51). 2016-07-05 16:21:21 -04:00
ChanMin Kim
bba8648252 Changed ping timeout logic in ping thread
Previously, ping thread might enter infinite reconnect loop.
Consider the following scenario.

1. If at least one ping is sent, last_ping_data is updated.
2. Then there are many activities, so should_ping() becomes false.
3. After some seconds, now().to_timespec() - time > strong.ping_timeout_duration() is satisfied.
4. reconnect()
5. But should_ping() is still false.
6. The condition is still satisfied, so reconnect() again and again.

I made several changes.

Followings are the changes in the code
- Handle PONG message from server.
- Add `waiting_pong_reply' flag in the state. The flag is set if ping is
sent but the corresponding pong did not arrive yet.
- Ping thread checks ping timeout in correct way.
- Sleeping duration for ping is now based on idle time.
- Initialize ping related fields when `reconnect()' is called.

Hopefully, this commit may be related to issue #50.
2016-07-05 06:55:30 +09:00
Geordon Worley
baef34f947 make tag members public 2016-06-19 00:37:58 -04:00
Aaron Weiss
e450621a57
Removed unnecessary parentheses. 2016-04-11 23:00:50 -04:00
Aaron Weiss
85e30e6f9f
Added a bounds check on handle_ctcp. 2016-04-11 22:59:20 -04:00
Aaron Weiss
fcc5c64826 Command parsing now parses into raw, rather than producing an error. 2016-04-02 13:50:27 -04:00
Aaron Weiss
863946ecb8 Implemented Display for Message. 2016-03-17 21:39:58 -04:00
Aaron Weiss
e4495940fc Made a whole lot of linting changes to improve code.
Small API changes:
  1. Message::into_string -> Message:to_string
  2. NetStream::UnsecuredTcpStream -> NetStream::Unsecured
  3. NetStream::SslTcpStream -> NetStream::Ssl
2016-03-17 21:35:35 -04:00
angelsl
46f9136c93 Write directly from threads (through a mutex) instead of using a writing thread
The writing thread now becomes a simple pinging thread. The pinging
thread will exit when the weak reference to the ServerState can no
longer be upgraded i.e. when the ServerState has been dropped i.e. when
the IrcServer has been dropped.

This fixes #43 as well.

This is the first in a series of changes that will reduce allocations by
the library.
2016-02-17 23:25:01 -05:00
Aaron Weiss
7d7e09fa8e Removed incomplete doc comment. 2016-02-12 11:30:55 -05:00
Aaron Weiss
e7b5d5e9d1 Made some formatting changes for readability. 2016-02-12 11:21:00 -05:00
Aaron Weiss
33123f4695 Fixed bug that caused user modes to be sent incorrectly when an
alternate nickname was in use.
2016-02-10 15:46:42 -05:00
Aaron Weiss
6d5b534628 Fixed bug in MODE parsing. 2016-02-10 12:31:52 -05:00
Aaron Weiss
52027f7834 Fixed compilation of test cases and made API changes for testing where
necessary.
2016-02-10 12:00:25 -05:00
Aaron Weiss
75bcc42af5 Added written to Connection interface and eliminated code duplication in Connection implementations. 2016-02-10 00:32:00 -05:00
Aaron Weiss
3314c93c3e Implemented a major redesign to simplify API and eliminate
overly-complicated generics usage.
2016-02-10 00:15:08 -05:00
angelsl
5f20e715fd Add NickServ GHOST functionality 2016-02-09 18:41:52 +08:00
Aaron Weiss
2cf0b26dca Cleaned up new comments on source_nickname. 2016-02-07 11:33:45 -05:00
angelsl
022b4af86c Fix Message::source_nickname 2016-02-07 16:01:05 +08:00
angelsl
54cb41a616 User idents and hostnames actually can have dots 2016-02-07 16:00:35 +08:00
Aaron Weiss
20338f881f Renamed getter functions to not include get as is common practice. 2016-01-30 12:00:25 -05:00
Aaron Weiss
b6ce088693 Updated examples after Command redesign. 2016-01-30 05:00:16 -05:00
Aaron Weiss
2eb0e63d59 Performed the great Command redesign (fixes #16). 2016-01-30 04:56:32 -05:00
Aaron Weiss
81a807f0a1 Rewrote From<Message> implementation in preparation of Command/Message
redesign.
2016-01-29 15:39:22 -05:00
Aaron Weiss
667a3dade3 Added RAW command. 2016-01-29 13:15:38 -05:00
Aaron Weiss
e7e83c3ab8 Added regression test for nochanlists. 2016-01-19 15:27:58 -05:00
Aaron Weiss
bf9bd3ecb8 Fixed bug in nochanlists from handle_message rewrite. 2016-01-19 15:23:09 -05:00
Aaron Weiss
81518bf244 Rewrote internal message handling in more modern Rust. 2016-01-18 00:18:28 -05:00
Aaron Weiss
8a2ce65e71 Added extract_writer function for use in unit tests. 2016-01-16 12:51:44 -05:00
Aaron Weiss
8113c47842 Fixed test execution. 2016-01-16 11:47:25 -05:00
Aaron Weiss
506fa3d78f Made time a required library dependency. 2016-01-16 11:18:11 -05:00
Aaron Weiss
f34a6ba5cf Fixed implementation of auto-reconnection by updating message sending to
use the write queue.
2016-01-16 11:15:10 -05:00
Aaron Weiss
3dc15449a8 Implemented ping-sending on inactivity. 2016-01-15 12:37:16 -05:00
Aaron Weiss
9ac625c091 Implemented internal auto-reconnection for servers. 2016-01-13 17:02:39 -05:00
Aaron Weiss
33004abc12 Fixed a bug with the drop behavior for IrcServer. 2016-01-03 08:32:45 -05:00
Aaron Weiss
6ece3e25fe Moved to using an internal sending channel for messages. 2016-01-03 07:51:10 -05:00
Aaron Weiss
ea0577bbaf Implemented Clone for IrcServer and updated multithreaded examples
accordingly.
2016-01-03 05:39:44 -05:00
Aaron Weiss
a6cd761e51 Moved Arc abstraction internally for IrcServer. 2016-01-03 05:35:00 -05:00
Aaron Weiss
8104894c28 Updated get_source_nickname behavior to match spec (fixes #40). 2015-11-26 13:11:02 -05:00
Aaron Weiss
11a54445b7 Removed deprecated code. 2015-11-22 16:26:43 -05:00
Aaron Weiss
6e160f561f Fixed typo in value for ERR_KEYNOPERMISSION. 2015-11-04 12:17:23 -05:00
Peter Atashian
ca7233fe1b Fix #36
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-10-14 21:56:13 -04:00
Aaron Weiss
c372403ed5 Made iterator types well-formed to respond to RFC 1214 changes. 2015-10-09 13:21:11 -04:00
Aaron Weiss
b866785c89 Added a function to save a Config. 2015-09-16 12:21:58 -04:00
Zetok Zalbavar
ee2deea79c
Allow to encode Config 2015-09-13 13:49:15 +01:00
E. Dunham
0194298aed Document state of server module 2015-07-18 20:34:49 -07:00
Aaron Weiss
f23160d493 Added utility functions to help with SASL. 2015-07-16 15:45:09 -04:00
Aaron Weiss
41428c499d Added support for SASL IRCv3 extension. 2015-07-16 15:45:09 -04:00
Aaron Weiss
2f7c7b116c Added support for IRCv3 batch extension. 2015-07-16 15:16:55 -04:00
Aaron Weiss
613b1c85ae Added support for metadata-notify. 2015-07-13 11:56:24 -04:00
Aaron Weiss
c4ca0dbeed Replaced Response enum with a macro thanks to @sfackler. 2015-07-03 16:56:50 -04:00
Aaron Weiss
edc770e22e Implemented IRCv3 metadata (without metadata-notify). 2015-07-01 18:44:09 -04:00
Aaron Weiss
3afef46198 Fixed bug causing crashes on wide unicode characters (fixes #29). 2015-07-01 17:14:28 -04:00
Steve Klabnik
1d8c64ef37 Remove unneeded crate attributes
These are overridden by Cargo anyway.
2015-07-01 15:49:03 -04:00
Aaron Weiss
05186cf670 Removed trailing whitespace. 2015-06-22 12:03:57 -04:00
Aaron Weiss
a5306f8391 Added custom capability for requesting additional extensions. 2015-06-20 22:25:18 -04:00
Aaron Weiss
b4f0727794 Fixed test compilation. 2015-06-16 16:09:10 -04:00
Aaron Weiss
f2e8f37877 Added a Message-consuming Into<Result<Command>> for ergonomics. 2015-06-16 16:05:28 -04:00
Aaron Weiss
83c38931bf Added Sized bounds on Self to make Server and ServerExt object-safe. 2015-06-16 16:04:37 -04:00
Aaron Weiss
595e75f1e0 Added unit tests for new username/hostname parsing. 2015-06-05 22:25:49 -04:00
Aaron Weiss
a03e09264e Added username and hostname parsing to User to better support
userhost-in-name extension.
2015-06-05 22:19:37 -04:00
Aaron Weiss
f3a2417f6a Simplified config loading API with AsRef<Path>. 2015-06-05 21:37:21 -04:00
Aaron Weiss
81b3e58d52 Replaced Command::from_message with a From<&Message> implementation. 2015-06-05 21:27:15 -04:00
Aaron Weiss
f46f877605 Added support for userhost-in-names capability. 2015-06-05 21:05:39 -04:00
Aaron Weiss
279a690de6 Added support for server-time capability. 2015-06-05 20:56:46 -04:00
Aaron Weiss
489c6c1a2d Added support for invite-notify capability. 2015-06-05 20:54:44 -04:00
Aaron Weiss
288b4cf70e Added support for echo-message extension. 2015-06-05 20:45:23 -04:00
Aaron Weiss
e6593f4335 Implemented support for chghost extension. 2015-06-05 20:42:48 -04:00
Aaron Weiss
d773dafb22 Added support for cap-notify extension. 2015-06-05 20:36:22 -04:00
Aaron Weiss
5d6fd1031d Added account-tag to capabilities request API. 2015-06-04 15:23:48 -04:00
Aaron Weiss
6a7786b92a Added monitor to capability request API. 2015-06-04 15:21:21 -04:00
Aaron Weiss
c9b22f08ff Added response codes for monitor extension. 2015-06-04 15:19:54 -04:00
Aaron Weiss
e9066e3cba Added MONITOR command for IRCv3.2 monitor extension. 2015-06-04 15:14:28 -04:00
Aaron Weiss
7d39a12142 Added parsing support for IRCv3.2 message tags. 2015-06-04 12:35:43 -04:00
Aaron Weiss
e1abb935b1 Added CAP LS with negotiation version API for IRCv3.2. 2015-05-22 23:55:20 -04:00
Aaron Weiss
3805c7c914 Added support for IRCv3.1 extended-join. 2015-05-21 22:55:49 -04:00
Aaron Weiss
fc175bb68a Added support for IRCv3.1 away-notify. 2015-05-21 22:40:08 -04:00
Aaron Weiss
be7b7d3233 Added Capability for a type-safe IRCv3 CAP REQ API. 2015-05-21 22:33:14 -04:00
Aaron Weiss
066960838e Fixed identify tests after IRCv3 changes. 2015-05-21 22:33:14 -04:00
Aaron Weiss
b6526465dd Added IRCv3 ACCOUNT command for account-notify support. 2015-05-21 22:33:14 -04:00
Aaron Weiss
7bf6bf48e1 Enhanced documentation for user tracking API. 2015-05-21 22:33:14 -04:00
Aaron Weiss
624873fc85 Removed default multi-prefix request in identify(...). 2015-05-21 22:33:14 -04:00
Aaron Weiss
f270a9d323 Added a function to send capabilities requests. 2015-05-21 22:33:14 -04:00
Aaron Weiss
3a8aa7b738 Removed CAP CLEAR subcommand. 2015-05-21 22:33:14 -04:00
Aaron Weiss
fcca39a98d Fixed test compilation. 2015-04-26 00:11:51 -04:00
Aaron Weiss
87f3b65649 Replaced ToMessage with Into<Message>. 2015-04-26 00:01:33 -04:00
Aaron Weiss
d3ac72d513 Removed unnecessary copies in Command's ToMessage impl. 2015-04-25 23:43:16 -04:00
Aaron Weiss
83243ffec3 ToMessage now consumes the struct in the conversion. 2015-04-25 23:13:56 -04:00
Aaron Weiss
42454939d7 Servers now send any ToMessage type. 2015-04-25 23:13:33 -04:00
Aaron Weiss
2505cc5784 Removed stability attributes. 2015-04-24 02:10:05 -04:00
Aaron Weiss
1740a2e669 Removed FromPrimitive derivation. 2015-04-24 01:53:37 -04:00
Aaron Weiss
c26d297e62 Eliminated feature use for beta. 2015-04-04 23:06:13 -04:00
Aaron Weiss
23fa48d41e Updated for Rust master. 2015-04-03 00:56:42 -04:00
Aaron Weiss
0e6018c85f Updated to Rust master. 2015-03-29 13:26:22 -04:00
Aaron Weiss
a23fcd6ba2 Updated for latest Rust. 2015-03-26 21:50:38 -04:00
Aaron Weiss
b7912ee592 Fixed warnings on Rust master. 2015-03-21 23:08:41 -04:00
Aaron Weiss
aaf5013407 Updated parsing to support colons within arguments. 2015-03-09 22:06:43 -04:00
Aaron Weiss
c5d2cdb891 Config tests now use std::path. 2015-03-07 15:01:34 -05:00
Aaron Weiss
1425bc1327 Migrated to new std::path. 2015-03-07 12:15:22 -05:00
Aaron Weiss
8bc8b946f7 Migrated to new std::io. 2015-03-02 17:12:16 -05:00
Aaron Weiss
3274cf1107 Changed from split_str to split. 2015-02-26 21:52:42 -05:00
Aaron Weiss
758bcfa784 Added a private function to help reduce line-wrapping. 2015-02-24 17:34:25 -05:00
Aaron Weiss
cfe9d756a6 Cleaned up line-wrapping in Command::to_message. 2015-02-24 16:58:50 -05:00
Aaron Weiss
5f8b09cf57 Updated docs. 2015-02-24 10:55:08 -05:00
Aaron Weiss
e1ab26a4bd Fixes #18 by expanding the CAP command. 2015-02-24 10:45:42 -05:00
Aaron Weiss
27839902ad Converted Wrapper to ServerExt as per #19. Fixes #5, too. 2015-02-24 10:10:22 -05:00
Aaron Weiss
6fdea7302a Improved docs on from_message_io. 2015-02-24 01:21:41 -05:00
Aaron Weiss
5a801df82f Added ToMessage to Prelude. 2015-02-23 23:11:11 -05:00
Aaron Weiss
54aaec9c76 Merge pull request #17 from filipegoncalves/master
Implemented command iterator.
2015-02-23 23:07:02 -05:00
Aaron Weiss
fca193732d Cleaned up line-wrapping in command.rs. 2015-02-23 23:06:35 -05:00
Filipe Gonçalves
04dccf5ce2 Added Command iterator. Added a test and a use case example. 2015-02-23 23:57:13 +00:00
Filipe Gonçalves
a43db2b5da Refactored Command to own its data. Updated tests and examples. 2015-02-23 20:02:52 +00:00
Aaron Weiss
1828c16766 Added a client prelude. 2015-02-22 21:18:57 -05:00
Aaron Weiss
c997556501 Removed warning when no-default-features is used. 2015-02-22 12:12:18 -05:00
Aaron Weiss
6404bef80a More clean-up, and warning fixes. 2015-02-21 10:31:46 -05:00
Aaron Weiss
76e7aea8e7 Cleaned up code, and more warning fixes. 2015-02-21 10:18:53 -05:00