Opened 12 years ago

Last modified 11 years ago

#833 closed defect

neuromorpho's http-fetch tries to close output ports using close-input-port — at Initial Version

Reported by: sjamaan Owned by: Ivan Raikov
Priority: minor Milestone:
Component: extensions Version: 4.7.x
Keywords: Cc:
Estimated difficulty:

Description

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).

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

Change History (0)

Note: See TracTickets for help on using tickets.