<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/TC_Swiftiply/test_serve_normal_proxy/.placeholder</filename>
    </added>
    <added>
      <filename>test/TC_Swiftiply/test_serve_normal_proxy_with_authentication/.placeholder</filename>
    </added>
    <added>
      <filename>test/TC_Swiftiply/test_serve_static_file/.placeholder</filename>
    </added>
    <added>
      <filename>test/TC_Swiftiply/test_serve_static_file_from_cachedir/public/.placeholder</filename>
    </added>
    <added>
      <filename>test/TC_Swiftiply/test_serve_static_file_xsendfile/priv/.placeholder</filename>
    </added>
    <added>
      <filename>test/TC_Swiftiply/test_serve_static_file_xsendfile/pub/.placeholder</filename>
    </added>
    <added>
      <filename>test/TC_Swiftiply/test_ssl/pub/.placeholder</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -12,6 +12,7 @@ module Swiftcore
 	# 4) GZip compression
 	#   Can be toggled on or off.  Configure mime types to compress.  Implemented
 	#   via an extension.
+	# 5) Keepalive
 
 	# A little statemachine for loading requirements.  The intention is to
 	# only load rubygems if necessary, and to load the Deque and SplayTreeMap
@@ -173,6 +174,7 @@ module Swiftcore
 			@dynamic_request_map = {}
 			@etag_cache_map = {}
 			@x_forwarded_for = {}
+			@keepalive = {}
 			@static_mask = {}
 			@keys = {}
 			@filters = {}
@@ -340,6 +342,18 @@ module Swiftcore
 					@filters[name].clear if @filters[name]
 				end
 				
+				def add_keepalive(timeout, name)
+					@keepalive[name] = timeout == 0 ? false : timeout
+				end
+				
+				def keepalive(name)
+					@keepalive[name]
+				end
+				
+				def remove_keepalive(name)
+					@keepalive[name] = false
+				end
+	
 				# Sets the default proxy destination, if requests are received
 				# which do not match a defined destination.
 				
@@ -423,6 +437,17 @@ module Swiftcore
 						client_name = clnt.name
 						dr ||= @docroot_map[client_name]
 						fc = @file_cache_map[client_name]
+						
+						# To support keepalive, there needs to be a way to detect whether
+						#
+						# Connection: close
+						#
+						# or
+						#
+						# Connection: Keep-Alive
+						#
+						# should be sent.  This should probably be a param on the client.
+						
 						if data = fc[path_info]
 							none_match = clnt.none_match
 							same_response = case
@@ -826,6 +851,32 @@ module Swiftcore
 							@none_match = $1
 						end
 
+						# Keep-Alive works differently on HTTP 1.0 versus HTTP 1.1
+						# HTTP 1.0 was not written to support Keep-Alive initially; it was
+						# bolted on.  Thus, for an HTTP 1.0 client to indicate that it
+						# wants to initiate a Keep-Alive session, it must send a header:
+						#
+						# Connection: Keep-Alive
+						#
+						# Then, when the server sends the response, it must likewise add:
+						#
+						# Connection: Keep-Alive
+						#
+						# to the response.
+						#
+						# For HTTP 1.1, Keep-Alive is assumed.  If a client does not want
+						# Keep-Alive, then it must send the following header:
+						#
+						# Connection: close
+						#
+						# Likewise, if the server does not want to keep the connection
+						# alive, it must send the same header:
+						#
+						# Connection: close
+						#
+						# to the client.
+						
+						
 						if @name
 							ProxyBag.add_frontend_client(self,@data,data)
 						else</diff>
      <filename>src/swiftcore/Swiftiply.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,4 +22,4 @@ end
 httpserver = Mongrel::HttpServer.new(&quot;127.0.0.1&quot;, 29998)
 httpserver.register(&quot;/hello&quot;, SimpleHandler.new)
 httpserver.register(&quot;/dir&quot;, Mongrel::DirHandler.new(&quot;.&quot;))
-httpserver.run.join
\ No newline at end of file
+httpserver.run.join</diff>
      <filename>test/TC_Swiftiply/mongrel/evented_hello.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,4 +22,4 @@ end
 httpserver = Mongrel::HttpServer.new(&quot;127.0.0.1&quot;, 29999)
 httpserver.register(&quot;/hello&quot;, SimpleHandler.new)
 httpserver.register(&quot;/dir&quot;, Mongrel::DirHandler.new(&quot;.&quot;))
-httpserver.run.join
\ No newline at end of file
+httpserver.run.join</diff>
      <filename>test/TC_Swiftiply/mongrel/swiftiplied_hello.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>ext/fastfilereader/Makefile</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>a1aaac244a06d969a1f7cf7523713dc745b10100</id>
    </parent>
  </parents>
  <author>
    <name>Kirk Haines</name>
    <email>wyhaines@gmail.com</email>
  </author>
  <url>http://github.com/wyhaines/swiftiply/commit/14ffbd2a32c03c092ac05f3b3f068d92d7fe4b1c</url>
  <id>14ffbd2a32c03c092ac05f3b3f068d92d7fe4b1c</id>
  <committed-date>2008-09-12T01:03:54-07:00</committed-date>
  <authored-date>2008-09-12T01:03:54-07:00</authored-date>
  <message>Added some directories that are needed for the tests to run.
Started adding keepalive support.</message>
  <tree>68d801f073c30bed0b5dcfff5ea03bd34661083c</tree>
  <committer>
    <name>Kirk Haines</name>
    <email>wyhaines@gmail.com</email>
  </committer>
</commit>
