01_DCCP_shutdown-unnecessary.diff
[paraslash.git] / dccp_recv.c
index eeb7c57a71a52ea26cdeb1ee8751939a6b2518f7..c0618602571975fbb6ab17b80f633eb8d33aaca0 100644 (file)
@@ -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));