﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
833	neuromorpho and 9ML-toolkit's http-fetch tries to close output ports using close-input-port	sjamaan	Ivan Raikov	"Neuromorpho uses {{{close-input-port}}} twice in the {{{http-fetch}}} procedure, once for an input port and once for an output port. It looks like this means the network connection will never be closed (in Unit tcp both ports need to be closed before the underlying FD is closed).

9ML-toolkit seems to have an exact copy of that code, which shows the same problem: http://parenteses.org/mario/misc/specialize-report/install/9ML-toolkit.html

Simple fix:

{{{
Index: neuromorpho.scm
===================================================================
--- neuromorpho.scm	(revision 26685)
+++ neuromorpho.scm	(working copy)
@@ -251,7 +251,7 @@
 				    (d ""reading chunks ...~%"")
 				    (let ([data (read-chunks in)])
 				      (close-input-port in)
-				      (close-input-port out)
+				      (close-output-port out)
 				      (if (not (file-exists? dest)) (mkdir dest))
 				      (d ""writing to ~s~%"" filepath)
 				      (with-output-to-file filepath (cut display data) )
@@ -261,7 +261,7 @@
 				    (d ""reading data ...~%"")
 				    (let ([data (read-string #f in)])
 				      (close-input-port in)
-				      (close-input-port out)
+				      (close-output-port out)
 				      (if (not (file-exists? dest)) (mkdir dest))
 				      (d ""writing to ~s~%"" filepath)
 				      (with-output-to-file filepath (cut display data) binary:)
}}}

By the way, neuromorpho has no documentation on the wiki. This means it also won't show up on api.call-cc.org. Since this egg has an official release it would be nice if there was at least some documentation.

This bug was found by the scrutinizer, see http://tests.call-cc.org/master/linux/x86/2012/05/12/salmonella-report/install/neuromorpho.html"	defect	closed	minor		extensions	4.7.x	fixed			
