Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
6e83d800
Commit
6e83d800
authored
May 22, 2010
by
Eli Zaretskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug #6237.
w32.c (sys_write): Break writes into chunks smaller than 32MB.
parent
9d5c6f0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
src/ChangeLog
src/ChangeLog
+5
-0
src/w32.c
src/w32.c
+28
-1
No files found.
src/ChangeLog
View file @
6e83d800
2010-05-22 Eli Zaretskii <eliz@gnu.org>
* w32.c (sys_write): Break writes into chunks smaller than 32MB.
(Bug#6237)
2010-05-22 Chong Yidong <cyd@stupidchicken.com>
* image.c (Fimage_flush): Rename from image-refresh.
...
...
src/w32.c
View file @
6e83d800
...
...
@@ -5700,7 +5700,34 @@ sys_write (int fd, const void * buffer, unsigned int count)
}
else
#endif
nchars = _write (fd, buffer, count);
{
/* Some networked filesystems don't like too large writes, so
break them into smaller chunks. See the Comments section of
the MSDN documentation of WriteFile for details behind the
choice of the value of CHUNK below. See also the thread
http://thread.gmane.org/gmane.comp.version-control.git/145294
in the git mailing list. */
const unsigned char *p = buffer;
const unsigned chunk = 30 * 1024 * 1024;
nchars = 0;
while (count > 0)
{
unsigned this_chunk = count < chunk ? count : chunk;
int n = _write (fd, p, this_chunk);
nchars += n;
if (n < 0)
{
nchars = n;
break;
}
else if (n < this_chunk)
break;
count -= n;
p += n;
}
}
return nchars;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment