#56 ✓invalid

keep-alive problems

Reported by ry | March 23rd, 2008 @ 08:20 PM | in 0.8.0

hi marc,

I can't get keep-alive to work in either 0.7 or HEAD. I'm doing something simple like this:
app = SimpleApp.new server = Thin::Server.new('', 4001, app) server.start!

Perhaps I'm missing some config option?

When I put 'return true' into Request#persistent and Response#persistent, I get responses with
Connection: Keep-Alive
but without Content-Length headers (required for persistent requests - otherwise the client doesn't know when the last response ended).


Comments and changes to this ticket

  • macournoyer

    macournoyer March 23rd, 2008 @ 08:55 PM

    • Milestone set to 0.8.0
    • State changed from “new” to “open”

    Hey Ry,

    Keep alive is the default behaviour in HTTP 1.1 unless Connection: close is specified. Your application must set Content-Length 'cause some browsers were hanging w/ keep-alive and NO content-length.

    Here's a quick piece of code that use a persistent connection to make 2 requests:

    require 'socket'
    socket = TCPSocket.new('', 3000)
    2.times do
      socket.write "GET / HTTP/1.1\r\n\r\n"
      puts socket.readpartial(1024)

    You can check the specs for persistent connections @ http://github.com/macournoyer/th...

    If you think there's a bug, are you able to reproduce w/ some code?

  • macournoyer

    macournoyer March 23rd, 2008 @ 09:50 PM

    • State changed from “open” to “invalid”
  • John

    John June 13th, 2024 @ 09:51 AM

    • Tag set to keep-alive

    Per quanto ne so, i casinò online possono essere sia positivi che negativi per il tuo portafoglio. Se non vuoi sprecare il tuo tempo in ricerche inutili, visita il casinò Ice Casino e prendi i tuoi bonus. Se vuoi lasciare il tuo lavoro e guadagnarti da vivere giocando a un casinò, è la scelta https://ice-casino-play.com/lt/ migliore!

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket