Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with Apache Traffic Server 5.0.0

*) [TS-2589] Don't hold up the response until the server starts sending
content

*) [TS-2563] Always set the SSL default verify paths.
Author: Wei Sun <sunwei@yahoo-inc.com>

Expand Down
59 changes: 59 additions & 0 deletions plugins/experimental/metalink/test/headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python

print '''1..1 headers
# The response isn't held up until the server starts sending content'''

from twisted.internet import error, protocol, reactor, tcp
from twisted.web import http

def callback():
print 'not ok 1 - No response yet'

reactor.stop()

reactor.callLater(1, callback)

class factory(http.HTTPFactory):
class protocol(http.HTTPChannel):
class requestFactory(http.Request):
def requestReceived(ctx, method, target, version):

ctx.client = None
ctx.clientproto = version

ctx.write('')

server = tcp.Port(0, factory())
server.startListening()

print '# Listening on {0}:{1}'.format(*server.socket.getsockname())

class factory(protocol.ClientFactory):
def clientConnectionFailed(ctx, connector, reason):

print 'Bail out!'
reason.printTraceback()

reactor.stop()

class protocol(http.HTTPClient):
def connectionLost(ctx, reason):
try:
reactor.stop()

except error.ReactorNotRunning:
pass

else:
print 'not ok 1 - Did the proxy crash? (The client connection closed.)'

connectionMade = lambda ctx: ctx.transport.write('GET {0}:{1} HTTP/1.1\r\n\r\n'.format(*server.socket.getsockname()))

def handleStatus(ctx, version, status, message):
print 'ok 1 - Got the response status'

reactor.stop()

tcp.Connector('localhost', 8080, factory(), 30, None, reactor).connect()

reactor.run()
8 changes: 3 additions & 5 deletions proxy/http/HttpTunnel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,7 @@ HttpTunnel::producer_run(HttpTunnelProducer * p)
p->chunked_handler.dechunked_reader->consume(p->chunked_handler.skip_bytes);

// If there is data to process in the buffer, do it now
if (p->chunked_handler.dechunked_reader->read_avail())
producer_handler(VC_EVENT_READ_READY, p);
producer_handler(VC_EVENT_READ_READY, p);
} else if (p->do_dechunking || p->do_chunked_passthru) {
// remove the dechunked reader marker so that it doesn't act like a buffer guard
if (p->do_dechunking)
Expand All @@ -912,9 +911,8 @@ HttpTunnel::producer_run(HttpTunnelProducer * p)
//p->chunked_handler.chunked_reader->consume(
//p->chunked_handler.skip_bytes);

if (p->chunked_handler.chunked_reader->read_avail()) {
producer_handler(VC_EVENT_READ_READY, p);
} else if (sm->redirection_tries > 0 && p->vc_type == HT_HTTP_CLIENT) { // read_avail() == 0
producer_handler(VC_EVENT_READ_READY, p);
if (!p->chunked_handler.chunked_reader->read_avail() && sm->redirection_tries > 0 && p->vc_type == HT_HTTP_CLIENT) { // read_avail() == 0
// [bug 2579251]
// Ugh, this is horrible but in the redirect case they are running a the tunnel again with the
// now closed/empty producer to trigger PRECOMPLETE. If the POST was chunked, producer_n is set
Expand Down