{"thread":{"id":"40455","subject":"[PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches","startedAt":"2015-09-30T07:26:09Z","lastAt":"2015-11-24T00:38:41Z","messageCount":5,"participants":["Lars Wendler","Johannes Schindelin","Junio C Hamano","Stefan Agner"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"270927","messageId":"1443597969-3962-1-git-send-email-polynomial-c@gentoo.org","threadId":"40455","inReplyTo":null,"subject":"[PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches","fromName":"Lars Wendler","fromEmail":"polynomial-c@gentoo.org","sentAt":"2015-09-30T07:26:09Z","receivedAt":"2015-09-30T07:26:09Z","isPatch":true,"sender":{"key":"polynomial-c@gentoo.org","avatar":null},"body":"From: Stefan Agner <stefan@agner.ch>\n\nSometimes sending huge patches/commits fail with\n\n[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\nline 1320.\n\nRunning the command with --smtp-debug=1 yields to\n\nNet::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel:\nat /usr/lib/git-core/git-send-email line 1320.\n[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\nline 1320.\n\nStefan described it in his mail like this:\n\nIt seems to me that there is a size limit, after cutting down the patch\nto ~16K, sending started to work. I cut it twice, once by removing lines\nfrom the head and once from the bottom, in both cases at the size of\naround 16K I could send the patch.\n\nSee also original report:\nhttp://permalink.gmane.org/gmane.comp.version-control.git/274569\n\nReported-by: Juston Li <juston.h.li@gmail.com>\nTested-by: Markos Chandras <hwoarang@gentoo.org>\nSigned-off-by: Lars Wendler <polynomial-c@gentoo.org>\n---\n git-send-email.perl | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e3ff44b..e907e0ea 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1365,7 +1365,11 @@ Message-Id: $message_id\n \t\t$smtp->mail( $raw_from ) or die $smtp->message;\n \t\t$smtp->to( @recipients ) or die $smtp->message;\n \t\t$smtp->data or die $smtp->message;\n-\t\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n+\t\t$smtp->datasend(\"$header\\n\") or die $smtp->message;\n+\t\tmy @lines = split /^/, $message;\n+\t\tforeach my $line (@lines) {\n+\t\t\t$smtp->datasend(\"$line\") or die $smtp->message;\n+\t\t}\n \t\t$smtp->dataend() or die $smtp->message;\n \t\t$smtp->code =~ /250|200/ or die \"Failed to send $subject\\n\".$smtp->message;\n \t}\n-- \n2.6.0\n"},{"id":"270929","messageId":"ffd8558da6af0b84d09808f00c979aaa@dscho.org","threadId":"40455","inReplyTo":"1443597969-3962-1-git-send-email-polynomial-c@gentoo.org","subject":"Re: [PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-09-30T08:32:15Z","receivedAt":"2015-09-30T08:32:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Lars,\n\nOn 2015-09-30 09:26, Lars Wendler wrote:\n> From: Stefan Agner <stefan@agner.ch>\n> \n> Sometimes sending huge patches/commits fail with\n> \n> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n> line 1320.\n> \n> Running the command with --smtp-debug=1 yields to\n> \n> Net::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel:\n> at /usr/lib/git-core/git-send-email line 1320.\n> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n> line 1320.\n> \n> Stefan described it in his mail like this:\n> \n> It seems to me that there is a size limit, after cutting down the patch\n> to ~16K, sending started to work. I cut it twice, once by removing lines\n> from the head and once from the bottom, in both cases at the size of\n> around 16K I could send the patch.\n> \n> See also original report:\n> http://permalink.gmane.org/gmane.comp.version-control.git/274569\n> \n> Reported-by: Juston Li <juston.h.li@gmail.com>\n> Tested-by: Markos Chandras <hwoarang@gentoo.org>\n> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>\n> ---\n\nVery nice! Thank you,\nDscho\n"},{"id":"270935","messageId":"xmqqr3lf94o2.fsf@gitster.mtv.corp.google.com","threadId":"40455","inReplyTo":"1443597969-3962-1-git-send-email-polynomial-c@gentoo.org","subject":"Re: [PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-30T17:51:25Z","receivedAt":"2015-09-30T17:51:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lars Wendler <polynomial-c@gentoo.org> writes:\n\n> It seems to me that there is a size limit, after cutting down the patch\n> to ~16K, sending started to work. I cut it twice, once by removing lines\n> from the head and once from the bottom, in both cases at the size of\n> around 16K I could send the patch.\n>\n> See also original report:\n> http://permalink.gmane.org/gmane.comp.version-control.git/274569\n>\n> Reported-by: Juston Li <juston.h.li@gmail.com>\n> Tested-by: Markos Chandras <hwoarang@gentoo.org>\n> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>\n> ---\n>  git-send-email.perl | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index e3ff44b..e907e0ea 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1365,7 +1365,11 @@ Message-Id: $message_id\n>  \t\t$smtp->mail( $raw_from ) or die $smtp->message;\n>  \t\t$smtp->to( @recipients ) or die $smtp->message;\n>  \t\t$smtp->data or die $smtp->message;\n> -\t\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n> +\t\t$smtp->datasend(\"$header\\n\") or die $smtp->message;\n> +\t\tmy @lines = split /^/, $message;\n> +\t\tforeach my $line (@lines) {\n> +\t\t\t$smtp->datasend(\"$line\") or die $smtp->message;\n> +\t\t}\n\nThanks.  One and a half comments.\n\n * If 16k is the limit, and smtp payload line limit is much much\n   shorter than that, is it sensible to send data line by line?\n\n * Has this been reported to Net::Cmd::datasend() upstream?\n\n>  \t\t$smtp->dataend() or die $smtp->message;\n>  \t\t$smtp->code =~ /250|200/ or die \"Failed to send $subject\\n\".$smtp->message;\n>  \t}\n"},{"id":"270992","messageId":"ddfab710e6ee78f6890b92d5b8af3bee@agner.ch","threadId":"40455","inReplyTo":"xmqqr3lf94o2.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches","fromName":"Stefan Agner","fromEmail":"stefan@agner.ch","sentAt":"2015-10-01T23:43:56Z","receivedAt":"2015-10-01T23:43:56Z","isPatch":true,"sender":{"key":"stefan@agner.ch","avatar":"https://avatars.githubusercontent.com/u/34061?v=4"},"body":"On 2015-09-30 10:51, Junio C Hamano wrote:\n> Lars Wendler <polynomial-c@gentoo.org> writes:\n> \n>> It seems to me that there is a size limit, after cutting down the patch\n>> to ~16K, sending started to work. I cut it twice, once by removing lines\n>> from the head and once from the bottom, in both cases at the size of\n>> around 16K I could send the patch.\n>>\n>> See also original report:\n>> http://permalink.gmane.org/gmane.comp.version-control.git/274569\n>>\n>> Reported-by: Juston Li <juston.h.li@gmail.com>\n>> Tested-by: Markos Chandras <hwoarang@gentoo.org>\n>> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>\n>> ---\n>>  git-send-email.perl | 6 +++++-\n>>  1 file changed, 5 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index e3ff44b..e907e0ea 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1365,7 +1365,11 @@ Message-Id: $message_id\n>>  \t\t$smtp->mail( $raw_from ) or die $smtp->message;\n>>  \t\t$smtp->to( @recipients ) or die $smtp->message;\n>>  \t\t$smtp->data or die $smtp->message;\n>> -\t\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n>> +\t\t$smtp->datasend(\"$header\\n\") or die $smtp->message;\n>> +\t\tmy @lines = split /^/, $message;\n>> +\t\tforeach my $line (@lines) {\n>> +\t\t\t$smtp->datasend(\"$line\") or die $smtp->message;\n>> +\t\t}\n> \n\nHi,\n\n> Thanks.  One and a half comments.\n> \n>  * If 16k is the limit, and smtp payload line limit is much much\n>    shorter than that, is it sensible to send data line by line?\n\nIt was a easy and quick way which popped into my mind. The 16k limit has\nbeen evaluated just by trying out some patch sizes, not sure whether\nthat is really right and where that really comes from. I guess before\nusing this as split size one would need to understand what causes that\nlimit actually...\n\n>  * Has this been reported to Net::Cmd::datasend() upstream?\n\nNot by me. I also have to admit that I am not a perl hacker at all...\n\n--\nStefan\n\n> \n>>  \t\t$smtp->dataend() or die $smtp->message;\n>>  \t\t$smtp->code =~ /250|200/ or die \"Failed to send $subject\\n\".$smtp->message;\n>>  \t}\n"},{"id":"273627","messageId":"17df1d26b8508437dccf7d7a6a4a8139@agner.ch","threadId":"40455","inReplyTo":"xmqqr3lf94o2.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] git-send-email.perl: Fixed sending of many/huge changes/patches","fromName":"Stefan Agner","fromEmail":"stefan@agner.ch","sentAt":"2015-11-24T00:38:41Z","receivedAt":"2015-11-24T00:38:41Z","isPatch":true,"sender":{"key":"stefan@agner.ch","avatar":"https://avatars.githubusercontent.com/u/34061?v=4"},"body":"On 2015-09-30 10:51, Junio C Hamano wrote:\n> Lars Wendler <polynomial-c@gentoo.org> writes:\n> \n>> It seems to me that there is a size limit, after cutting down the patch\n>> to ~16K, sending started to work. I cut it twice, once by removing lines\n>> from the head and once from the bottom, in both cases at the size of\n>> around 16K I could send the patch.\n>>\n>> See also original report:\n>> http://permalink.gmane.org/gmane.comp.version-control.git/274569\n>>\n>> Reported-by: Juston Li <juston.h.li@gmail.com>\n>> Tested-by: Markos Chandras <hwoarang@gentoo.org>\n>> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>\n>> ---\n>>  git-send-email.perl | 6 +++++-\n>>  1 file changed, 5 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index e3ff44b..e907e0ea 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1365,7 +1365,11 @@ Message-Id: $message_id\n>>  \t\t$smtp->mail( $raw_from ) or die $smtp->message;\n>>  \t\t$smtp->to( @recipients ) or die $smtp->message;\n>>  \t\t$smtp->data or die $smtp->message;\n>> -\t\t$smtp->datasend(\"$header\\n$message\") or die $smtp->message;\n>> +\t\t$smtp->datasend(\"$header\\n\") or die $smtp->message;\n>> +\t\tmy @lines = split /^/, $message;\n>> +\t\tforeach my $line (@lines) {\n>> +\t\t\t$smtp->datasend(\"$line\") or die $smtp->message;\n>> +\t\t}\n> \n> Thanks.  One and a half comments.\n> \n>  * If 16k is the limit, and smtp payload line limit is much much\n>    shorter than that, is it sensible to send data line by line?\n> \n>  * Has this been reported to Net::Cmd::datasend() upstream?\n\nI still constantly run in to this issue. Fixing it locally, and next\ntime git gets updated and I send a larger patch, it happens again.\n\nJust dig a bit more into that, it seems that this is a documented Perl\nlimitation:\nhttp://search.cpan.org/~sullr/IO-Socket-SSL-2.020/lib/IO/Socket/SSL.pod#syswrite\n\nAll examples use datasend line wise, so I guess it is not a all to bad\nchoice...\n\n--\nStefan\n\n\n> \n>>  \t\t$smtp->dataend() or die $smtp->message;\n>>  \t\t$smtp->code =~ /250|200/ or die \"Failed to send $subject\\n\".$smtp->message;\n>>  \t}\n"}]}