Commit af0fa263 by James Cammarata

Merge pull request #12566 from cchurch/winrm_put_empty_file_19

Enable winrm put_file to upload an empty file.
parents 7fbaf3aa e62ca77a
...@@ -185,7 +185,7 @@ class Connection(object): ...@@ -185,7 +185,7 @@ class Connection(object):
# windows command length), divide by 2.67 (UTF16LE base64 command # windows command length), divide by 2.67 (UTF16LE base64 command
# encoding), then by 1.35 again (data base64 encoding). # encoding), then by 1.35 again (data base64 encoding).
buffer_size = int(((8190 - len(cmd)) / 2.67) / 1.35) buffer_size = int(((8190 - len(cmd)) / 2.67) / 1.35)
for offset in xrange(0, in_size, buffer_size): for offset in xrange(0, in_size or 1, buffer_size):
try: try:
out_data = in_file.read(buffer_size) out_data = in_file.read(buffer_size)
if offset == 0: if offset == 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment