Skip to content

Commit 0b37f9d

Browse files
authored
Merge pull request #27 from icgood/cancelled
Fix exception when dnsbl is cancelled
2 parents 64be924 + 1d87591 commit 0b37f9d

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## The MIT License (MIT)
22

3-
Copyright (c) 2020 Ian Good
3+
Copyright (c) 2021 Ian Good
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# -- Project information -----------------------------------------------------
2323

2424
project = 'proxy-protocol'
25-
copyright = '2020, Ian Good'
25+
copyright = '2021, Ian Good'
2626
author = 'Ian Good'
2727

2828
# The short X.Y version

proxyprotocol/server/protocol.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ def connection_made(self, transport: BaseTransport) -> None:
193193
self.dnsbl_task.add_done_callback(self._write_header)
194194

195195
def _write_header(self, task: Task[Any]) -> None:
196-
header = self.build_pp_header()
197-
self.write(memoryview(header))
196+
if not task.cancelled():
197+
header = self.build_pp_header()
198+
self.write(memoryview(header))
198199

199200
def proxy_data(self, data: memoryview) -> None:
200201
self.downstream.write(data)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 Ian C. Good
1+
# Copyright (c) 2021 Ian C. Good
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to deal
@@ -28,7 +28,7 @@
2828
license = f.read()
2929

3030
setup(name='proxy-protocol',
31-
version='0.7.1',
31+
version='0.7.2',
3232
author='Ian Good',
3333
author_email='ian@icgood.net',
3434
description='PROXY protocol library with asyncio server implementation',

0 commit comments

Comments
 (0)