[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] with-input-from-request does not close SSL socket
From: |
obscuroloconato |
Subject: |
[Chicken-users] with-input-from-request does not close SSL socket |
Date: |
Wed, 14 Dec 2011 15:16:57 +0100 |
I use the http-client egg to send queries to a HTTPS server:
(with-input-from-request
"https://server/some/url"
search
(lambda ()
(ssax:xml->sxml (current-input-port) '()))))
For every connection I get an CLOSE_WAIT with 38 bytes in the receive queue:
Proto Recv-Q Send-Q Local Address Foreign Address
State
tcp 38 0 2.11.152.42:45237 10.100.26.82:443
CLOSE_WAIT
This looks to me as if with-input-from-request fails to close the
socket, which is probably a bug.
As a work around I need a way to close the socket. How can I access
the socket to force closing it?
I tried to use close-connection! this way:
(let ((result (with-input-from-request
uri search
(lambda ()
(ssax:xml->sxml (current-input-port) '())))))
(close-connection! uri)
result))
But this does not have any effect.
I can see the sockets leeking in the proc filesystem. After start I
have two sockets:
$ ls -nl /proc/23236/fd
total 0
lrwx------ 1 31338 91 64 Dec 14 15:10 0 -> socket:[3185978]
lr-x------ 1 31338 91 64 Dec 14 15:10 3 -> /myprogram.scm
lrwx------ 1 31338 91 64 Dec 14 15:10 4 -> socket:[3185977]
And during each client request I get a new socket. After 3 connections
I have 5 sockets:
$ ls -nl /proc/23236/fd
total 0
lrwx------ 1 31338 91 64 Dec 14 15:10 0 -> socket:[3185978]
lr-x------ 1 31338 91 64 Dec 14 15:10 3 -> /myprogram.scm
lrwx------ 1 31338 91 64 Dec 14 15:10 4 -> socket:[3185977]
lrwx------ 1 31338 91 64 Dec 14 15:11 5 -> socket:[3186523]
lrwx------ 1 31338 91 64 Dec 14 15:11 7 -> socket:[3186528]
lrwx------ 1 31338 91 64 Dec 14 15:11 8 -> socket:[3186530]
How can I stop this?
I have the following versions:
4.7.0.3-st
openssl ....................................................... version: 1.6.1
http-client ..................................................... version: 0.5
intarweb ........................................................ version: 0.7
- [Chicken-users] with-input-from-request does not close SSL socket,
obscuroloconato <=