
New patches:

[Provisional code for creating request-uris that conform with RFC2616.
'Daniel McAllansmith <dm.maillists@gmail.com>'**20080331202400
 Currently only abs_path request-uris are used.  This means that you can't get
 resources via a proxy, which requires the use of absoluteURI request-uris.
 This provisional code adds a RequestURI datatype that allows you to
 discriminate between requests to an origin server, a proxy and requesting
 server info.  Further changes to actually use this code are required, at
 the least replacing the URI in Request with RequestURI and removing the use
 of fixReq in simpleHTTP.
] {
hunk ./Network/HTTP.hs 236
+-- | The request-uri that we will send to the server, conforming to
+-- RFC2616, Section 5.1.2.  Note that we don't have a CONNECT
+-- RequestMethod so the authority form is not currently implemented.
+--
+-- A RequestURI consists of a URI representing a resource on a server
+-- and the type of request we will be making to that resource.
+-- Depending upon the requestType parts of the resource URI may be
+-- ignored, eg HostingServer will only use the host and port from the
+-- resource URI.
+data RequestURI = ReqURI { resource :: URI
+                         , requestType :: RequestType
+                         }
+
+instance Show RequestURI where
+    show (ReqURI r HostingServer) = "*"
+    show (ReqURI r FromOrigin)    = (show . clearURIScheme . clearURIAuth . normaliseURIPath) r
+    show (ReqURI r ViaProxy)      = (show . clearURIUserInfo . normaliseURIPath) r
+
+normaliseURIPath u = if null (uriPath u) || head (uriPath u) /= '/'
+                       then u { uriPath = '/' : uriPath u }
+                       else u
+
+clearURIAuth u = u { uriAuthority = Nothing }
+
+clearURIScheme u = u { uriScheme = "" }
+
+clearURIUserInfo u = u { uriAuthority = (fmap (\ua -> ua { uriUserInfo = "" }) . uriAuthority) u }
+
+-- | Discriminate between making a request of the hosting server of a
+-- resource, requesting a resource from an origin/gateway server and
+-- requesting a resource via a proxy.
+data RequestType = HostingServer | FromOrigin | ViaProxy
+
}

Context:

[Bump version number to 3001.1.0. Incremented minor number since the patch from Eric Mertens extends the API.
bjorn@bringert.net**20080305202825] 
[Export getRequestHead and processRequest, add support for custom RequestMethods
Eric Mertens <emertens@galois.com>**20080305190759] 
[Include uriQuery in request line.
bjorn@bringert.net**20080128094645] 
[Send abs_path as Request-URI to comply with HTTP 1.1 spec.
'Daniel McAllansmith <dm.maillists@gmail.com>'**20080128053024
 RFC2616 Section 5.1.2 specifies that abs_path MUST be used to identify a resource on a origin server or gateway, not absoluteURI which is for use with proxies.
 
 Change Request's Show instance to use /path/to/resource rather than
 http://server/path/to/resource.
] 
[Bump version to 3001.0.4
bjorn@bringert.net**20071213122237] 
[Expose Network.HTTP.Headers in cabal file
Eric Mertens <emertens@galois.com>**20071212220235
 
 Failure to do this breaks :browse functionality in GHCi
 as well as makes these useful functions unavailable
] 
[Resolved conflicts in Network.Stream.
robin@shorestreet.com**20071203042948] 
[Resolve conflict in HTTP.cabal.
robin@shorestreet.com**20071029195007] 
[Split Header functionality into Network.HTTP.Headers module.
robin@shorestreet.com**20070725192851] 
[Added files to .cabal file, made deps explicit in Network.TCP module.
robin@shorestreet.com**20070725184005] 
[Refactored Network.Stream.
robin@shorestreet.com**20070725061114] 
[Made more deps explicit.
robin@shorestreet.com**20070724054038] 
[Made dependencies explicit in import statements.
robin@shorestreet.com**20070724043419] 
[Bumped version number to 3001.0.3.
bjorn@bringert.net**20071130225017] 
[Change myrecv to allow a 0 length. Suggested by Eric Mertens.
bjorn@bringert.net**20071130224542
 On Wed, 2007-08-15 at 23:25 +0200, Bjorn Bringert wrote:
 Why doesn't the existing code work? Does recv fail when given 0?
 
 On Nov 30, 2007, at 23:36 , Eric Mertens wrote:
 Yes, recv can not cope with an argument of 0
 
 http://darcs.haskell.org/packages/network/Network/Socket.hsc
 
 recv :: Socket -> Int -> IO String
 recv sock l = recvLen sock l >>= \ (s,_) -> return s
 
 recvLen :: Socket -> Int -> IO (String, Int)
 recvLen sock@(MkSocket s _family _stype _protocol status) nbytes 
  | nbytes <= 0 = ioError (mkInvalidRecvArgError "Network.Socket.recv")
 
] 
[Set version number to 3001.0.2.
bjorn@bringert.net**20071118211601] 
[Change version to 3001.0.1.
bjorn@bringert.net**20071117212431] 
[Don't treat any chunk size starting with '0' as a 0 chunk size.
bjorn@bringert.net**20071117212214
 Radosław Grzanka reported that Network.HTTP can't get http://www.podshow.com/feeds/gbtv.xml, see http://article.gmane.org/gmane.comp.lang.haskell.cafe/31783
 
 This turned out to be a bug in how Network.HTTP handled Chunked Transfer Encoding. The web server sent the chunk size as "00004000" (according to RFC 2616 this can be non-empty sequence of hex digits). However, Network.HTTP treated any chunk size starting with '0' as a chunk size of 0, which indicates the end of the chunked encoding. 
] 
[TAG 3001.0.0
Duncan Coutts <duncan@haskell.org>**20071021133823] 
Patch bundle hash:
5dffd60d10f6d961a7d02b7d66f1db8e8162b329
