Permalink
Browse files

Update some shit

  • Loading branch information...
1 parent e444b27 commit 7944a423980f8cba5910f7f0d653d3d602ba1193 @meh committed Feb 24, 2012
Showing with 151 additions and 184 deletions.
  1. +5 −11 README.md
  2. +9 −5 lib/failirc/server/dispatcher.rb
  3. +5 −17 lib/failirc/server/dispatcher/client.rb
  4. +132 −151 utils/stress.rb
View
@@ -8,17 +8,6 @@ do pretty much anything, in fact the standard protocols are implemented as modul
There's still no documentation about the API and the events, but I will add it sooner or later. For the moment
just read the sources, they're pretty easy to understand (dispatcher excluded).
-Installation
-------
-Installation after cloning or downloading the source tree.
-
- $ gem build *.gemspec
- # gem install *.gem
-
-Installation from rubygems.org (not yet uploaded)
-
- # gem install failirc
-
Server
------
- Automatic encoding conversions, defaults to UTF-8. Choose the used encoding with the ENCODING command.
@@ -27,6 +16,11 @@ Server
- Supports SSL and creates automatically certificate and key if not given.
- Easy to understand and edit YAML configuration.
+This server is not suitable for big networks, it obviously can't compare to the speed IRC daemons written in C,
+but ease of scripting of failirc is also uncomparable to any of them.
+
+If your network is small and you want to easily custom the server, this is for you.
+
Client
------
- Support for multiple servers and channels.
@@ -68,13 +68,17 @@ def data_available
@working = true
EM.next_tick {
- if clients.any? { |c| c.handle }
- EM.next_tick {
- data_available
- }
- end
+ more = false
+
+ clients.each {|client|
+ if client.handle
+ more = true
+ end
+ }
@working = false
+
+ data_available if more
}
end
@@ -19,7 +19,7 @@
module IRC; class Server
-class Client < EM::Connection
+class Client < EventMachine::Protocols::LineAndTextProtocol
extend Forwardable
attr_reader :server, :ip, :port, :hostname
@@ -39,22 +39,10 @@ def post_init
@data = ''
end
- def receive_data (data)
- @data << data
-
- return unless @data.include? "\n"
-
- @data.lines.each {|line|
- @data = line and break unless line.include? "\n"
-
- @input.push(line.strip)
- }
-
- @data.clear if @data.include? "\n"
-
- unless @input.empty?
- server.data_available
- end
+ def receive_line (line)
+ @input.push(line.strip)
+
+ server.data_available
end
def send_message (message)
Oops, something went wrong.

0 comments on commit 7944a42

Please sign in to comment.