oversip 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/oversip CHANGED
@@ -178,6 +178,13 @@ module OverSIP
178
178
  ::OverSIP::Config.load options[:config_dir], options[:config_file]
179
179
  ::OverSIP::Config.print options[:colorize]
180
180
 
181
+ log_system_info "increasing rlimits for 'nofiles'"
182
+ begin
183
+ ::Process.setrlimit Process::RLIMIT_NOFILE, 65536, 65536
184
+ rescue => e
185
+ ::OverSIP::Launcher.fatal e
186
+ end
187
+
181
188
  log_system_info "creating Posix Message Queue for communicating master and syslogger processes"
182
189
  ::OverSIP.syslogger_mq_name = "/#{OverSIP.master_name}_syslogger"
183
190
  ::OverSIP::Logger.init_logger_mq options[:group]
data/ext/stun/stun_ruby.c CHANGED
@@ -114,7 +114,7 @@ VALUE Stun_parse_request(VALUE self, VALUE rb_stun_request, VALUE rb_source_ip,
114
114
  *
115
115
  * So let's check the second byte which must be 0x1.
116
116
  */
117
- if ( request[1] != 0b00000001 ) {
117
+ if ( request[1] != 0x1 ) {
118
118
  LOG("ERROR: not a valid STUN Binding Request, maybe an STUN Indication (so ignore it)\n");
119
119
  return Qfalse;
120
120
  }
@@ -56,15 +56,17 @@ module OverSIP
56
56
 
57
57
  # Set RLIMIT_MSGQUEUE (ulimit) in order to create the queue with required
58
58
  # ammount of memory.
59
- if ( current_rlimit = ::Process.getrlimit(12)[1] ) < mq_size
60
- log_system_info "incrementing rlimits for Posix Message Queues (currently #{current_rlimit} bytes) to #{mq_size} bytes (ulimit -q)"
59
+ if ( current_rlimit = ::Process.getrlimit(::Process::RLIMIT_MSGQUEUE)[1] ) < mq_size
60
+ log_system_info "incrementing rlimits for 'msgqueue' Posix Message Queues (currently #{current_rlimit} bytes) to #{mq_size} bytes (ulimit -q)"
61
61
  begin
62
- ::Process.setrlimit(12, mq_size)
62
+ ::Process.setrlimit(::Process::RLIMIT_MSGQUEUE, mq_size, mq_size)
63
63
  rescue ::Errno::EPERM
64
- ::OverSIP::Launcher.fatal "current user has no permissions to increase rlimits to #{mq_size} bytes (ulimit -q)"
64
+ ::OverSIP::Launcher.fatal "current user has no permissions to increase 'msgqueue' rlimits to #{mq_size} bytes"
65
+ rescue => e
66
+ ::OverSIP::Launcher.fatal e
65
67
  end
66
68
  else
67
- log_system_info "rlimits for Posix Message Queues is #{current_rlimit} bytes (>= #{mq_size}), no need to increase it"
69
+ log_system_info "rlimits for 'msgqueue' is #{current_rlimit} bytes (>= #{mq_size}), no need to increase it"
68
70
  end
69
71
 
70
72
  # Create the Posix message queue to write into it.
@@ -79,7 +81,7 @@ module OverSIP
79
81
 
80
82
  # Kernel has no support for posix message queues.
81
83
  rescue ::Errno::ENOSYS => e
82
- ::OverSIP::Launcher.fatal "the kernel has no support for posix messages queues, enable it (#{e.class}: #{e.message})"
84
+ ::OverSIP::Launcher.fatal "the kernel has no support for Posix Messages Queues, enable it (#{e.class}: #{e.message})"
83
85
 
84
86
  # http://linux.die.net/man/3/mq_open
85
87
  #
@@ -99,7 +101,7 @@ module OverSIP
99
101
  rescue Errno::ENFILE => e
100
102
  ::OverSIP::Launcher.fatal "the system limit on the total number of open files and message queues has been reached (#{e.class}: #{e.message})"
101
103
  rescue ::Errno::ENOSPC => e
102
- ::OverSIP::Launcher.fatal "insufficient space for the creation of a new message queue, probably occurred because the queues_max limit was encountered (#{e.class}: #{e.message})"
104
+ ::OverSIP::Launcher.fatal "insufficient space for the creation of a new message queue, probably occurred because the 'queues_max' limit was encountered (#{e.class}: #{e.message})"
103
105
 
104
106
  end
105
107
 
@@ -0,0 +1,9 @@
1
+ module Process
2
+
3
+ # Ruby 1.9.2 has not defined the constant Process::RLIMIT_MSGQUEUE (Ruby 1.9.3 has it).
4
+ # Gives it value 12 if not defined.
5
+ unless defined? ::Process::RLIMIT_MSGQUEUE
6
+ Process.const_set :RLIMIT_MSGQUEUE, 12
7
+ end
8
+
9
+ end
@@ -5,7 +5,7 @@ module OverSIP
5
5
  module Version
6
6
  MAJOR = 1
7
7
  MINOR = 3
8
- TINY = 2
8
+ TINY = 3
9
9
  DEVEL = nil # Set to nil for stable releases.
10
10
  end
11
11
 
data/lib/oversip.rb CHANGED
@@ -34,7 +34,7 @@ require "oversip/utils.rb"
34
34
  require "oversip/posix_mq.rb"
35
35
  require "oversip/default_server.rb"
36
36
  require "oversip/system_callbacks.rb"
37
-
37
+ require "oversip/ruby_ext/process.rb" # Required here as the Posix message queue is created before loading master_process.rb.
38
38
 
39
39
 
40
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oversip
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-03 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine-le
@@ -208,6 +208,7 @@ files:
208
208
  - lib/oversip/config.rb
209
209
  - lib/oversip/launcher.rb
210
210
  - lib/oversip/ruby_ext/eventmachine.rb
211
+ - lib/oversip/ruby_ext/process.rb
211
212
  - lib/oversip/sip/rfc3263.rb
212
213
  - lib/oversip/sip/uac.rb
213
214
  - lib/oversip/sip/uri.rb