/[smeserver]/rpms/qpsmtpd/sme8/0029-Run-hook_reset_transaction-after-all-connections.patch
ViewVC logotype

Contents of /rpms/qpsmtpd/sme8/0029-Run-hook_reset_transaction-after-all-connections.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sun Nov 14 20:50:20 2010 UTC (13 years, 11 months ago) by slords
Branch: MAIN
CVS Tags: qpsmtpd-0_84-3_el5_sme, qpsmtpd-0_84-6_el5_sme, qpsmtpd-0_84-2_el5_sme, qpsmtpd-0_84-5_el5_sme, qpsmtpd-0_84-8_el5_sme, qpsmtpd-0_84-9_el5_sme, qpsmtpd-0_84-4_el5_sme, qpsmtpd-0_84-7_el5_sme, HEAD
* Sun Nov 14 2010 <slords@mail.com> 0.84-2.sme
- Sync with upstream git repo.
- Fix require_resolvable_fromhost doesn't work [SME: 6369]
- Fix TLS security defaults [SME: 6366]
- Fix fatal errors when mail has no headers [SME: 6345]

1 From 5c3bd220aaccd49ebbcbfb4324ac4c789d116273 Mon Sep 17 00:00:00 2001
2 From: jaredj <jaredj@nmgi.com>
3 Date: Sat, 28 Feb 2009 15:13:46 +0800
4 Subject: Run hook_reset_transaction after all connections
5
6 This makes hook_reset_transaction a bit more useful by running it on
7 disconnections. It also ensures that hook_disconnect runs when the
8 client disconnects without QUITing.
9 ---
10 lib/Qpsmtpd/SMTP.pm | 1 +
11 lib/Qpsmtpd/TcpServer.pm | 4 ++++
12 lib/Qpsmtpd/TcpServer/Prefork.pm | 5 +++++
13 3 files changed, 10 insertions(+), 0 deletions(-)
14
15 diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm
16 index f669055..0735f0c 100644
17 --- a/lib/Qpsmtpd/SMTP.pm
18 +++ b/lib/Qpsmtpd/SMTP.pm
19 @@ -576,6 +576,7 @@ sub quit_respond {
20 sub disconnect {
21 my $self = shift;
22 $self->run_hooks("disconnect");
23 + $self->connection->notes(disconnected => 1);
24 $self->reset_transaction;
25 }
26
27 diff --git a/lib/Qpsmtpd/TcpServer.pm b/lib/Qpsmtpd/TcpServer.pm
28 index 07d8d16..de3504f 100644
29 --- a/lib/Qpsmtpd/TcpServer.pm
30 +++ b/lib/Qpsmtpd/TcpServer.pm
31 @@ -115,6 +115,10 @@ sub read_input {
32 alarm $timeout;
33 }
34 alarm(0);
35 + return if $self->connection->notes('disconnected');
36 + $self->reset_transaction;
37 + $self->run_hooks('disconnect');
38 + $self->connection->notes(disconnected => 1);
39 }
40
41 sub respond {
42 diff --git a/lib/Qpsmtpd/TcpServer/Prefork.pm b/lib/Qpsmtpd/TcpServer/Prefork.pm
43 index 28f60dc..2728cea 100644
44 --- a/lib/Qpsmtpd/TcpServer/Prefork.pm
45 +++ b/lib/Qpsmtpd/TcpServer/Prefork.pm
46 @@ -35,6 +35,11 @@ sub read_input {
47 or $self->respond(502, "command unrecognized: '$_'");
48 alarm $timeout;
49 }
50 + unless ($self->connection->notes('disconnected')) {
51 + $self->reset_transaction;
52 + $self->run_hooks('disconnect');
53 + $self->connection->notes(disconnected => 1);
54 + }
55 };
56 if ($@ =~ /^disconnect_tcpserver/) {
57 die "disconnect_tcpserver";
58 --
59 1.7.2.2
60

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed