search for: httpresponse

Displaying 20 results from an estimated 40 matches for "httpresponse".

2006 Mar 28
7
Is Ruby stable for production use?
...ows is a poor platform and that Webrick is a development, not production, server. However, we have started seeing this crop up when perfectly simple page to page links are invoked... [2006-03-28 08:32:21] ERROR Errno::ECONNABORTED: Software caused connection abort /usr/lib/ruby/1.8/webrick/httpresponse.rb:324:in `write'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:324:in `_write_data'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:296:in `send_body_string'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:187:in `send_body'' /usr/lib/ruby/1.8/web...
2006 Sep 13
1
Net::HTTPResponse
Hello :) I have a problem with the Net::HTTP library... The Net::HTTP library [1] uses a Net::HTTPResponse object for all it''s responses from web servers. This class has many subclasses, such as HTTPSuccess, HTTPRedirecttion, etc. When obtaining a response, the library suggests to check what it is by testing the class of the returned object - using case/when or kind_of? (which it does inter...
2006 Jul 25
6
Subtract a field from the current time in MySQL?
I have the following: Table Products: With a column called "purchased_at" of type "datetime". Products.find(:all, :conditions => ["? - purchased_at >= 120", Time.now]) Why doesn''t that work? What I''m trying to do is find records that were purchased less than or equal to 2 minutes ago. Thanks for your help. -- Posted via
2005 Aug 25
0
multiple refreshs clicks cause errors in WEBrick
...fetches some data from a ''users'' table and present it in a rhtml view. Now when I press the refresh button quickly a few times I get in the command line window errors such as this: [2005-08-25 17:08:55] ERROR Errno::EINVAL: Invalid argument c:/ruby/lib/ruby/1.8/webrick/httpresponse.rb:324:in `write'' c:/ruby/lib/ruby/1.8/webrick/httpresponse.rb:324:in `<<'' c:/ruby/lib/ruby/1.8/webrick/httpresponse.rb:324:in `_write_data'' c:/ruby/lib/ruby/1.8/webrick/httpresponse.rb:180:in `send_header'' c:/ruby/lib/ruby/1...
2006 Feb 10
2
Sudden Strange Webrick Error: Errno::ECONNABORTED
Hello, I''ve been developing an application (on Windows), and everything was going pretty well, but I suddenly began getting this weird error back from Webrick after submitting something through ajax, and only through ajax. I''m submitting a form through ajax, and it is being process properly - with all the interaction with the database happening without problem. The response
2007 Mar 26
1
Streaming content
...ream a response. At first I was doing this def process(request, response) response.start do |head,out| head[''Content-Type''] = ''text/html'' %w{o m g}.each { |c| out.puts c; sleep 5; } end response.done = true end But then I looked at HttpResponse and decided that this probably isn''t sending anything to the socket while I''m in the OMG loop: def start(status=200, finalize=false) @status = status.to_i yield @header, @body finished if finalize end So I thought using HttpResponse#write might work -...
2006 Apr 19
5
Mongrel 0.3.12.5 -- Pre-Release with File Upload whyness
...a Mongrel 0.3.12.5 pre-release in the releases directory I''d like people to try out: gem install mongrel --source=http://mongrel.rubyforge.org/releases/ This release incorporates why''s changes to allow for uploading files much more efficiently and for streaming out files via a HttpResponse.send_file call. I re-wrote the file upload part what why created to refactor that whole process. It now handles quite a few corner cases related to efficient file uploads: * Writes to a Tempfile if greater than 92k. * Deletes the Tempfile if the user aborts the upload (closed socket). * De...
2006 Aug 02
1
Modifying Mongrel Examples
Hi, I am tryinig to work on the Mongrel examples. I am trying to modify the HttpResponse. def process(request, response) response.start do |head,out| if request.params["REQUEST_METHOD"] == OPTIONS" else end end One can detect that the request is OPTIONS like this, but how does one generate the custom response by using HttpResponse. Please help. Shubham
2013 May 07
2
Net::HTTP
...-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html And I notice two uses of Net::HTTP. Both are using GET requests. But what''s the difference? When to use which? Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri response = http.request request # Net::HTTPResponse object end uri = URI(''http://example.com/index.html'') res = Net::HTTP.get_response(uri) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send a...
2011 Aug 15
3
- WEBrick server refuses to launch
...are when I shut down the server, so I can''t tell if they are relevant, but here''s what I receive: [2011-08-15 13:59:24] ERROR Errno::ECONNABORTED: An established connection was aborted by the software in your host machine. C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/ httpresponse.rb:324:in`write'' C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/ httpresponse.rb:324:in`<<'' C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/ httpresponse.rb:324:in`_write_data'' C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/ httpresponse...
2010 Jul 01
1
Interesting "Bad Certificate" Problem
...10-07-01 13:27:31] ERROR OpenSSL::SSL::SSLError: SSL_write:: internal error /usr/lib/ruby/1.8/openssl/buffering.rb:178:in `syswrite'' /usr/lib/ruby/1.8/openssl/buffering.rb:178:in `do_write'' /usr/lib/ruby/1.8/openssl/buffering.rb:197:in `<<'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:324:in `_write_data'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:296:in `send_body_string'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:187:in `send_body'' /usr/lib/ruby/1.8/webrick/httpresponse.rb:104:in `send_response'' /usr/lib/ruby/1.8/webrick/httpserver.rb:79:in...
2009 Jan 29
0
Net:HTTP.post returns an Array
I was wondering if anyone has run into this problem. I post using a Net::HTTP object and instead of getting Net::HTTPResponse object, the server returns an Array causing an error since an we typically attempt to read the body of the Net::HTTPResponse object. Does anyone know why this is occurring? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Goo...
2007 Sep 18
10
Routes
hi all, I want to move some routing tasks out of the router and into the controller. The goal is to make Merb feel less like mod_rewrite and give the user more control at the controller. The new Router is simple: it takes the path_info (not the whole request) then outputs a controller class and some parameters from the path matching. The rest of the routing would be done at the controller level.
2010 Jun 23
2
Purpose of "Status" header in HTTP responses?
...this error is caused by the "Status" header that is added to responses by unicorn. We don?t know of any other instances where this header is causing problems so we?re pretty confused about why it?s a problem for them. Does anyone remember why this "Status" header was added to HttpResponse? Which broken clients was the change trying to accommodate? Craig
2019 Nov 23
2
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...sad because on the C side we mempcpy the data again. So with this patch we avoid one copy of the two. To avoid all unneeded copies, we need to change pread() to: def pread(h, buf, offset): So the python side we can do: f.readinto(buf) Or: sock.recv_info(buf) It does not work for HTTPResponse, so in this case we have to do: buf[:] = r.read() Since we work on v2 now, I think we should consider this change. An uglier alternative is: def preadinto(h, buf, offset): Matching python read() and readinto() interface. > > test-python-plugin.py > > > > This text ca...
2010 Mar 18
13
ERROR NoMethodError: private method `gsub!' called
I have just upgraded to Ruby 1.8.7 and Rails 2.2.2. My previous project was at Ruby 1.8.6 and Rails 2.0.2. My platform is Windows and Webrick for development. When I run Webrick, the server starts without error, the application runs, database connections work and I can click through the pages and display data. But it does not serve any stylesheets or javascript files. What''s
2019 Nov 24
1
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...ll unneeded copies, we need to change pread() to: > > > > def pread(h, buf, offset): > > > > So the python side we can do: > > > > f.readinto(buf) > > > > Or: > > > > sock.recv_info(buf) > > > > It does not work for HTTPResponse, so in this case we have to do: > > > > buf[:] = r.read() > > > > Since we work on v2 now, I think we should consider this change. > > Right, we can consider this for v2, while leaving v1 callers alone. > > > An uglier alternative is: > > > >...
2007 Nov 23
5
Comet style requests with mongrel
Hi, I''ve been doing some experiments with php and if can use something like <?php for ($i = 0; $i < 100; $i++) { echo "hello world"; flush(); sleep(10); } ?> to keep a http link open for an arbitrary amount of time and routinely display "hello world" in the browser window. Is is possible to write a mongrel handler to do something similar? Thanks
2006 May 23
1
Mongrel 0.3.13 Pre-Release Update -- Yep, Again
...- no more PID files getting clobbered. * Applied user:group change patch from Bradley Taylor. * Updated the Pound documentation from Austin Godber, corrections from Rui Lopes. * Bug 4473 -- DirHandler escapes file paths correctly and will write directory listings with proper ending /. * Bug 4477 -- HttpResponse.send_file wasn''t indicating that the response body is complete. * Removal of some chatty error messages. * Lots of little build and test harness tweaks. TESTING IT There has been one report of someone on FreeBSD seeing 0.3.13 pre-release of Mongrel being slower that 0.3.12.4 by a huge m...
2006 Apr 11
0
Large file support (up and down) for Mongrel 0.13.3
...st checked in changes to improve handling of massive posts and massive downloads. Generally speaking, Mongrel has been keeping everything in memory. (Unless you''re using DirHandler and have the sendfile gem in place.) Now, downloads should be pretty swift even without the sendfile gem. HttpResponse#send_file rips out the file streaming support from DirHandler and encapsulates it. This method doesn''t set any of the headers or anything, it just streams the file. The idea here is to allow for support of the X-Sendfile header [1], also supported in lighttpd as of a few days ago. [2] I...