[#3907] Obtaining mode information on an IO object — Jos Backus <jos@...>

The attached patch implements IO#mode. This method returns the mode the IO

17 messages 2004/12/06
[#3909] Re: [patch] Obtaining mode information on an IO object — nobu.nokada@... 2004/12/07

Hi,

[#3910] Re: [patch] Obtaining mode information on an IO object — Jos Backus <jos@...> 2004/12/07

On Tue, Dec 07, 2004 at 09:25:13AM +0900, nobu.nokada@softhome.net wrote:

[#3925] Re: [patch] Obtaining mode information on an IO object — James Britt <ruby@...> 2004/12/09

Jos Backus wrote:

[#4009] cgi.rb -- more GET/POST stuff — mde@...26.com

First of all, I think it would be great, as Eustaquio suggests, to

17 messages 2004/12/23
[#4016] Re: [PATCH] cgi.rb -- more GET/POST stuff — Francis Hwang <sera@...> 2004/12/24

GETs and POSTs are defined to be fairly different actions. I'd read

[#4027] Allowing custom number literal suffixes? — Florian Gro<florgro@...>

Moin!

35 messages 2004/12/27
[#4070] Re: Allowing custom number literal suffixes? — nobu.nokada@... 2005/01/02

Hi,

[#4072] Re: Allowing custom number literal suffixes? — Mathieu Bouchard <matju@...> 2005/01/02

[#4079] Re: Allowing custom number literal suffixes? — Florian Gro<florgro@...> 2005/01/03

Mathieu Bouchard wrote:

[#4081] Re: Allowing custom number literal suffixes? — Mathieu Bouchard <matju@...> 2005/01/03

[#4082] Re: Allowing custom number literal suffixes? — Florian Gro<florgro@...> 2005/01/03

Mathieu Bouchard wrote:

[#4084] Re: Allowing custom number literal suffixes? — Brent Roman <brent@...> 2005/01/04

I'm not sure I would advocate making Ruby's grammar even more

[#4086] Re: Allowing custom number literal suffixes? — Mathieu Bouchard <matju@...> 2005/01/04

[#4033] Garbage collection trouble — Christian Neukirchen <chneukirchen@...>

Hello,

13 messages 2004/12/27

[BUG] webrick

From: Charles Mills <cmills@...>
Date: 2004-12-14 06:03:14 UTC
List: ruby-core #3962
Webricks logging may cause it to fail on a valid http requests (on Mac 
OS X).

$ hostname
rodin
$ ping rodin.local.
PING rodin.local (192.168.240.121): 56 data bytes
64 bytes from 192.168.240.121: icmp_seq=0 ttl=64 time=0.121 ms
64 bytes from 192.168.240.121: icmp_seq=1 ttl=64 time=0.137 ms
...

I wanted to show off ruby, dnssd, and webrick using Safari with this 
script
##########
require 'dnssd'
require 'webrick'
include WEBrick

s = HTTPServer.new(
   :Port           => 8080,
   :DocumentRoot   => Dir::pwd
)

dnssd_s = DNSSD.register("RACC\032Presentation", "_http._tcp", nil, 
8080) do |r|
   warn("DNSSD Successfully Registered: #{r.inspect}")
end

trap("INT"){ dnssd_s.stop; s.shutdown }
s.start
###########

Webrick doesn't respond to the request 'http://rodin.local.:8080/' as 
it should.

$ ruby -rubygems webserver.rb
[2004-12-13 20:26:59] INFO  WEBrick 1.3.1
[2004-12-13 20:26:59] INFO  ruby 1.8.1 (2003-12-25) [powerpc-darwin]
[2004-12-13 20:26:59] INFO  WEBrick::HTTPServer#start: pid=5716 
port=8080
DNSSD Successfully Registered: #<DNSSD::RegisterReply 
RACC\026Presentation._http._tcp.local.>
[2004-12-13 20:27:40] ERROR SocketError: getnameinfo: nodename nor 
servname provided, or not known
         /usr/local/lib/ruby/1.8/webrick/server.rb:147:in `peeraddr'
         /usr/local/lib/ruby/1.8/webrick/server.rb:147:in `start_thread'
         /usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start'
         /usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
         /usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start'
         /usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each'
         /usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start'
         /usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'
         /usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'
         webserver.rb:17

------------------------------------------------------------
Here is a patch against the 1.8.1 source (problem exists with latest 
source too):

server.rb
147,155c147,150
<           begin
<             addr = sock.peeraddr
<             @logger.debug "accept: #{addr[3]}:#{addr[1]}"
<           rescue SocketError
<             @logger.debug "accept: <address unknown>"
<           ensure
<             call_callback(:AcceptCallback, sock)
<             block ? block.call(sock) : run(sock)
<           end
---
 >           addr = sock.peeraddr
 >           @logger.debug "accept: #{addr[3]}:#{addr[1]}"
 >           call_callback(:AcceptCallback, sock)
 >           block ? block.call(sock) : run(sock)

httprequest.rb
76,78d75
<       rescue SocketError
<         @peeraddr ||= []
<         @addr ||= []

Is this patch ok?

-Charlie


In This Thread

Prev Next