corecode's projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
69a73ae
)
dma: properly close and free SSL connection state
author
Simon Schubert <corecode@dragonflybsd.org>
Thu, 16 Jul 2009 11:40:12 +0000 (13:40 +0200)
committer
Simon Schubert <corecode@dragonflybsd.org>
Thu, 16 Jul 2009 14:13:08 +0000 (16:13 +0200)
libexec/dma/net.c
patch
|
blob
|
blame
|
history
diff --git
a/libexec/dma/net.c
b/libexec/dma/net.c
index
bcd3ce5
..
4a5ded5
100644
(file)
--- a/
libexec/dma/net.c
+++ b/
libexec/dma/net.c
@@
-309,6
+309,19
@@
open_connection(struct qitem *it, const char *host)
return (fd);
}
+static void
+close_connection(int fd)
+{
+ if (((config->features & SECURETRANS) != 0) &&
+ ((config->features & NOSSL) == 0))
+ SSL_shutdown(config->ssl);
+
+ if (config->ssl != NULL)
+ SSL_free(config->ssl);
+
+ close(fd);
+}
+
int
deliver_remote(struct qitem *it, const char **errmsg)
{
@@
-469,7
+482,7
@@
deliver_remote(struct qitem *it, const char **errmsg)
"QUIT failed: %s", it->queueid, neterr);
out:
- close(fd);
+ close_connection(fd);
return (error);
}