]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
simplify dccp_set_socket() (Gerrit Renker)
authorAndre Noll <maan@congo.fml.local>
Fri, 9 Mar 2007 12:41:43 +0000 (13:41 +0100)
committerAndre Noll <maan@congo.fml.local>
Fri, 9 Mar 2007 12:41:43 +0000 (13:41 +0100)
This patch kills two unneccessary setsocketopt calls
and cleans up the resulting fallout.

dccp.c
error.h

diff --git a/dccp.c b/dccp.c
index fa48976e72f44f0cc8b0bdac7d93bcf6368075ec..94cd7957bf9bbbb98685ee0f6338354f2a8fad45 100644 (file)
--- a/dccp.c
+++ b/dccp.c
 #include "fd.h"
 
 /** \cond some magic dccp constants */
-#define SOL_DCCP 269
 #define SOCK_DCCP 6
 #define IPPROTO_DCCP 33
-#define DCCP_SOCKOPT_PACKET_SIZE 1
-#define DCCP_SOCKOPT_SERVICE 2
 /** \endcond */
 
 /**
@@ -58,18 +55,7 @@ int dccp_get_socket(void)
  *
  * \returns positive on success, negative on errors.
  */
-int dccp_set_socket(int fd)
+int dccp_set_socket(__a_unused int fd)
 {
-       int pkt_size = 256, ret;
-
-       /* hack to get a service code */
-       ret = setsockopt(fd, SOL_DCCP, DCCP_SOCKOPT_PACKET_SIZE,
-               (char*)&pkt_size, sizeof(pkt_size));
-       if (ret < 0)
-               return -E_DCCP_PACKET_SIZE;
-       ret = setsockopt(fd, SOL_DCCP, DCCP_SOCKOPT_SERVICE,
-               (char*)&pkt_size, sizeof(pkt_size));
-       if (ret < 0)
-               return -E_DCCP_SERVICE;
-       return 1;
+       return 1;       /* nothing to do at the moment */
 }
diff --git a/error.h b/error.h
index 45485e1df68e65a67a7d3d622ccb124ea311b706..e1007fd31f64a9f47b1aa33055dadadff5f589fc 100644 (file)
--- a/error.h
+++ b/error.h
@@ -379,8 +379,6 @@ extern const char **para_errlist[];
 
 #define DCCP_ERRORS \
        PARA_ERROR(DCCP_SOCKET, "can not create dccp socket"), \
-       PARA_ERROR(DCCP_PACKET_SIZE, "failed to set dccp packet size"), \
-       PARA_ERROR(DCCP_SERVICE, "could not get service code"), \
        PARA_ERROR(DCCP_RECV_EOF, "dccp_recv: end of file"), \