[FIX][Comanche] persistent connections
Ian Piumarta
ian.piumarta at inria.fr
Thu Feb 27 18:42:11 UTC 2003
Comanche was not sending the correct 'Connection: {Keep-Alive,Close}' in
the response header. The attached fix cures the problem allowing browsers
that aggressively use persistent connections (e.g., Safari) to work
without endless annoying "connection reset" errors.
Ian
-------------- next part --------------
'From Squeak3.4gamma of ''7 January 2003'' [latest update: #5169] on 27 February 2003 at 7:34:48 pm'!
"Change Set: KeepAliveFix-ikp
Date: 27 February 2003
Author: Ian Piumarta
Fix handling of keep-alive connections in GET requests. Prevents newer browsers (such as Safari) from getting horribly confused when a persistent connection is closed by the server without warning."!
!HttpAdaptor methodsFor: 'processing' stamp: 'ikp 2/27/2003 19:32'!
pvtWriteResponse
[
(self isPersistentConnection and: [Preferences keepAliveConnections])
ifTrue: [response fieldAt: 'Connection' put: 'Keep-Alive']
ifFalse: [response fieldAt: 'Connection' put: 'close'].
response writeOn: self writeStream
]
on: Error do: [ :ex |
"If we're here, it's likely because something on the other
end of the socket it hosed. Do nothing, a log entry will
be written and the socket and response will be destroyed"
]! !
More information about the Squeak-dev
mailing list
|