]> granicus.if.org Git - python/commitdiff
Merged revisions 68459 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Sun, 18 Jan 2009 00:08:45 +0000 (00:08 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 18 Jan 2009 00:08:45 +0000 (00:08 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68459 | kristjan.jonsson | 2009-01-09 14:27:16 -0600 (Fri, 09 Jan 2009) | 1 line

  Issue 4336:  Let users of HTTPConnection.endheaders() submit a message body to the function if required.
........

Lib/logging/handlers.py

index 19fb959fb26ae31a4fccb751cb877a387dceba01..5930f49c3ab2f13899dbf622579057fb1e835004 100644 (file)
@@ -1024,9 +1024,7 @@ class HTTPHandler(logging.Handler):
                 h.putheader("Content-type",
                             "application/x-www-form-urlencoded")
                 h.putheader("Content-length", str(len(data)))
-            h.endheaders()
-            if self.method == "POST":
-                h.send(data)
+            h.endheaders(data if self.method == "POST" else None)
             h.getreply()    #can't do anything with the result
         except (KeyboardInterrupt, SystemExit):
             raise