]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - dccp_recv.c
dccp_send: Fix a fd leak.
[paraslash.git] / dccp_recv.c
index eeb7c57a71a52ea26cdeb1ee8751939a6b2518f7..13c34b125d7b8009310dc0c44d6adbba7949aea6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2008 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -61,6 +61,13 @@ static int dccp_recv_open(struct receiver_node *rn)
 
        if (ret < 0)
                return ret;
+       /*
+        * Disable unused CCIDs: the receiver does not send any application data to the
+        * server. By shutting down this unused path we reduce internal processing costs,
+        * as the unused CCIDs (in the kernel) are then bypassed.
+        */
+       if (shutdown(ret, SHUT_WR) < 0)
+               return -ERRNO_TO_PARA_ERROR(errno);
 
        rn->buf = para_calloc(DCCP_BUFSIZE);
        rn->private_data = pdd = para_calloc(sizeof(struct private_dccp_recv_data));