On Mon, Apr 19, 2010 at 22:43, René Scharfe <rene.scharfe@xxxxxxxxxxxxxx> wrote: >> + if (written < 0 && errno == EINVAL) { >> + // There seems to be a bug in the Windows XP network stack that >> + // causes writes with sizes > 64 MB to fail, so we halve the size >> + // until we succeed or ultimately fail. > > C style comments (/*...*/) are preferred over C++ style comments (//...) > for git. Oh well, I've changed that. > Is there a known-good size, or at least a mostly-working one? Would it > make sense to start with that size instead of halving and trying until > that size is reached? As the comment says, the greatest size that worked in my experiments is 64 MB, and other posts on the Internert suggest the same limit, but it's still an unconfirmed / undocumented issue. Anyway, I'm now starting with 64 MB right away if a write failed. >> + size /= 2; >> + } else { >> + buf += written; >> + total += written; > > What about other errors? You need to break out of the loop instead of > adding -1 to buf and total, right? Right, I've fixed that, thanks. >> + if (total + size > count) >> + size = count - total; >> + } >> + } > > Shouldn't the loop be left in the successful case, too? write(2) is > allowed to write less than requested, so the caller already needs to > deal with that case anyway. I prefer to make the wrapper as transparent as possible. If a direct call to write would not write less than requested, the wrapper should not either. I've updated work/issue-409 in 4msysgit.git accordingly. -- Sebastian Schuberth -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html