summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-16 02:33:01 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-16 02:33:01 +0000
commit4a0c26ecaafa4f817d120955bcec6fefde876f71 (patch)
treea73ac3397318ff3bed33d0f893620294c39c07af
parentf721e30c2429a6649c3e8462ab5c0fb62e873a9a (diff)
downloadpx4-nuttx-4a0c26ecaafa4f817d120955bcec6fefde876f71.tar.gz
px4-nuttx-4a0c26ecaafa4f817d120955bcec6fefde876f71.tar.bz2
px4-nuttx-4a0c26ecaafa4f817d120955bcec6fefde876f71.zip
Document recvfrom() bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4399 42af7a65-404d-4744-a932-0658087f49c3
-rwxr-xr-xapps/netutils/ftpd/ftpd.c12
-rw-r--r--nuttx/TODO14
2 files changed, 21 insertions, 5 deletions
diff --git a/apps/netutils/ftpd/ftpd.c b/apps/netutils/ftpd/ftpd.c
index d021205f7..f6ddf64b8 100755
--- a/apps/netutils/ftpd/ftpd.c
+++ b/apps/netutils/ftpd/ftpd.c
@@ -917,10 +917,14 @@ static ssize_t ftpd_recv(int sd, FAR void *data, size_t size, int timeout)
int errval = errno;
/* Special case some TCP read errors. The client side will break the
- * connection after the file has been sent. The NuttX socket layer
- * will return an error with errno == ENOTCONN. But perhaps that is
- * wrong, perhaps it should return 0 (end-of-file) in that case? In
- * that event, we will want to report end-of-file here.
+ * connection after the file has been sent.
+ */
+#warning FIXME
+ /* When the client breaks the connection, the NuttX socket layer will
+ * return an error with errno == ENOTCONN. This is wrong! It should
+ * return 0 (end-of-file) in that case! We work around the bug and
+ * report end-of-file for that case here. This needs to be fixed
+ * someday.
*/
if (errval == ENOTCONN)
diff --git a/nuttx/TODO b/nuttx/TODO
index 53eb7b02a..27701c2d0 100644
--- a/nuttx/TODO
+++ b/nuttx/TODO
@@ -13,7 +13,7 @@ nuttx/
(1) pthreads (sched/)
(2) C++ Support
(5) Binary loaders (binfmt/)
- (17) Network (net/, drivers/net)
+ (18) Network (net/, drivers/net)
(2) USB (drivers/usbdev, drivers/usbhost)
(8) Libraries (lib/)
(10) File system/Generic drivers (fs/, drivers/)
@@ -437,6 +437,18 @@ o Network (net/, drivers/net)
Status: Open
Priority: Low unless you need it.
+ Title: RECV/RECVFROM RETURN VALUE
+ Description: If the peer performs an orderly shutdown, then recvfrom currently returns
+ an error with errno set to ENOTCONN. This is wrong. There is a fine
+ distinction. The ENOTCONN errno is intended for the case where the socket
+ was never connected. In the case were the socket was connected then the
+ peer performs an order shutdown: "...If no messages are available to be
+ received and the peer has performed an orderly shutdown, recv() shall
+ return 0. ..."
+ Status: Open and there is a kludge in apps/netutils/ftpd/ftpdc.c work around this
+ bad return value.
+ Priority: Medium
+
o USB (drivers/usbdev, drivers/usbhost)
^^^^^^^^^^^^^^^^^^^^