Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
7ce5b04d
Commit
7ce5b04d
authored
Oct 16, 2014
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1082557: Use a persistent connection to the SMTP server for improved performance
r=dylan a=glob
parent
b1bdb0ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Bugzilla.pm
Bugzilla.pm
+5
-2
Mailer.pm
Bugzilla/Mailer.pm
+3
-2
No files found.
Bugzilla.pm
View file @
7ce5b04d
...
@@ -659,13 +659,16 @@ sub memcached {
...
@@ -659,13 +659,16 @@ sub memcached {
# Per-process cleanup. Note that this is a plain subroutine, not a method,
# Per-process cleanup. Note that this is a plain subroutine, not a method,
# so we don't have $class available.
# so we don't have $class available.
sub
_cleanup
{
sub
_cleanup
{
my
$main
=
Bugzilla
->
request_cache
->
{
dbh_main
};
my
$cache
=
Bugzilla
->
request_cache
;
my
$shadow
=
Bugzilla
->
request_cache
->
{
dbh_shadow
};
my
$main
=
$cache
->
{
dbh_main
};
my
$shadow
=
$cache
->
{
dbh_shadow
};
foreach
my
$dbh
(
$main
,
$shadow
)
{
foreach
my
$dbh
(
$main
,
$shadow
)
{
next
if
!
$dbh
;
next
if
!
$dbh
;
$dbh
->
bz_rollback_transaction
()
if
$dbh
->
bz_in_transaction
;
$dbh
->
bz_rollback_transaction
()
if
$dbh
->
bz_in_transaction
;
$dbh
->
disconnect
;
$dbh
->
disconnect
;
}
}
my
$smtp
=
$cache
->
{
smtp
};
$smtp
->
disconnect
if
$smtp
;
clear_request_cache
();
clear_request_cache
();
# These are both set by CGI.pm but need to be undone so that
# These are both set by CGI.pm but need to be undone so that
...
...
Bugzilla/Mailer.pm
View file @
7ce5b04d
...
@@ -25,7 +25,7 @@ use Encode qw(encode);
...
@@ -25,7 +25,7 @@ use Encode qw(encode);
use
Encode::MIME::
Header
;
use
Encode::MIME::
Header
;
use
Email::
MIME
;
use
Email::
MIME
;
use
Email::Sender::
Simple
qw(sendmail)
;
use
Email::Sender::
Simple
qw(sendmail)
;
use
Email::Sender::Transport::
SMTP
;
use
Email::Sender::Transport::SMTP
::
Persistent
;
use
Bugzilla::Sender::Transport::
Sendmail
;
use
Bugzilla::Sender::Transport::
Sendmail
;
sub
MessageToMTA
{
sub
MessageToMTA
{
...
@@ -127,7 +127,8 @@ sub MessageToMTA {
...
@@ -127,7 +127,8 @@ sub MessageToMTA {
}
}
if
(
$method
eq
"SMTP"
)
{
if
(
$method
eq
"SMTP"
)
{
$transport
=
Email::Sender::Transport::
SMTP
->
new
({
$transport
=
Bugzilla
->
request_cache
->
{
smtp
}
//
=
Email::Sender::Transport::SMTP::
Persistent
->
new
({
host
=>
Bugzilla
->
params
->
{
'smtpserver'
},
host
=>
Bugzilla
->
params
->
{
'smtpserver'
},
sasl_username
=>
Bugzilla
->
params
->
{
'smtp_username'
},
sasl_username
=>
Bugzilla
->
params
->
{
'smtp_username'
},
sasl_password
=>
Bugzilla
->
params
->
{
'smtp_password'
},
sasl_password
=>
Bugzilla
->
params
->
{
'smtp_password'
},
...
...
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