Skip to content

Commit f60c483

Browse files
agnersgitster
authored andcommitted
git-send-email.perl: Fixed sending of many/huge changes/patches
Sometimes sending huge patches/commits fail with [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email line 1320. Running the command with --smtp-debug=1 yields to Net::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel: at /usr/lib/git-core/git-send-email line 1320. [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email line 1320. Stefan described it in his mail like this: It seems to me that there is a size limit, after cutting down the patch to ~16K, sending started to work. I cut it twice, once by removing lines from the head and once from the bottom, in both cases at the size of around 16K I could send the patch. See also original report: http://permalink.gmane.org/gmane.comp.version-control.git/274569 Reported-by: Juston Li <[email protected]> Tested-by: Markos Chandras <[email protected]> Signed-off-by: Lars Wendler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 441c4a4 commit f60c483

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-send-email.perl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,11 @@ sub send_message {
12821282
$smtp->mail( $raw_from ) or die $smtp->message;
12831283
$smtp->to( @recipients ) or die $smtp->message;
12841284
$smtp->data or die $smtp->message;
1285-
$smtp->datasend("$header\n$message") or die $smtp->message;
1285+
$smtp->datasend("$header\n") or die $smtp->message;
1286+
my @lines = split /^/, $message;
1287+
foreach my $line (@lines) {
1288+
$smtp->datasend("$line") or die $smtp->message;
1289+
}
12861290
$smtp->dataend() or die $smtp->message;
12871291
$smtp->code =~ /250|200/ or die "Failed to send $subject\n".$smtp->message;
12881292
}

0 commit comments

Comments
 (0)