git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] send-email: don't call methods on undefined values

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Sep 9, 2013, 22:49 UTC
Message-ID
<20130909224950.GA101065@vauxhall.crustytoothpaste.net>
In-Reply-To
<xmqqli363pwp.fsf@gitster.dls.corp.google.com>
On Mon, Sep 09, 2013 at 09:45:10AM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> > --- a/git-send-email.perl
> > +++ b/git-send-email.perl
> > @@ -1234,7 +1234,7 @@ X-Mailer: git-send-email $gitversion
> >  				if ($smtp->code == 220) {
> >  					$smtp = Net::SMTP::SSL->start_SSL($smtp,
> >  									  ssl_verify_params())
> > -						or die "STARTTLS failed! ".$smtp->message;
> > +						or die "STARTTLS failed! ".IO::Socket::SSL::errstr();
> 
> I agree that $smtp->message may be bogus at this point, but could
> "require IO::Socket::SSL" have failed on us in ssl_verify_params?
> In that degraded mode, we do not do SSL peer verification, but
> otherwise we would still attempt to talk with the peer, and in such
> a case, IO::Socket::SSL would not be available to us at this point,
> no?

Since Net::SMTP::SSL uses IO::Socket::SSL (in fact, it is an IO::Socket::SSL), we can be guaranteed that it is, in fact, available at this point. I guess strictly we don't need that require in IO::Socket::SSL since we'll already be guaranteed that it exists by the require of Net::SMTP::SSL.

I tried using Net::SMTP::SSL::errstr() instead, but that didn't seem to produce useful output.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “send-email: don't call methods on undefined values”
  1. send-email: don't call methods on undefined valuesbrian m. carlson, Sep 8, 2013
  2. Junio C HamanoSep 9, 2013
  3. brian m. carlsonSep 9, 2013
  4. Junio C HamanoSep 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.