| 1913 | | int fd = socket->socket; |
|---|
| 1914 | | |
|---|
| 1915 | | cherokee_fd_set_nodelay (fd, ! enable); |
|---|
| 1916 | | |
|---|
| 1917 | | re = setsockopt (fd, IPPROTO_TCP, TCP_CORK, &enable, sizeof(enable)); |
|---|
| 1918 | | if (re < 0) { |
|---|
| 1919 | | PRINT_ERRNO (errno, "ERROR: Setting TCP_CORK to fd %d: ${errno}\n", fd); |
|---|
| 1920 | | return ret_error; |
|---|
| 1921 | | } |
|---|
| | 1913 | int tmp = 0; |
|---|
| | 1914 | int fd = socket->socket; |
|---|
| | 1915 | |
|---|
| | 1916 | TRACE(ENTRIES",cork", "%s TCP_CORK on fd %d\n", |
|---|
| | 1917 | enable ? "Setting" : "Removing", fd); |
|---|
| | 1918 | |
|---|
| | 1919 | if (enable) { |
|---|
| | 1920 | tmp = 0; |
|---|
| | 1921 | re = setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &tmp, sizeof(tmp)); |
|---|
| | 1922 | if (unlikely (re < 0)) { |
|---|
| | 1923 | PRINT_ERRNO (errno, "ERROR: Removing TCP_NODELAY to fd %d: ${errno}", fd); |
|---|
| | 1924 | return ret_error; |
|---|
| | 1925 | } |
|---|
| | 1926 | |
|---|
| | 1927 | tmp = 1; |
|---|
| | 1928 | re = setsockopt (fd, IPPROTO_TCP, TCP_CORK, &tmp, sizeof(tmp)); |
|---|
| | 1929 | if (unlikely (re < 0)) { |
|---|
| | 1930 | PRINT_ERRNO (errno, "ERROR: Setting TCP_CORK to fd %d: ${errno}", fd); |
|---|
| | 1931 | return ret_error; |
|---|
| | 1932 | } |
|---|
| | 1933 | |
|---|
| | 1934 | return ret_ok; |
|---|
| | 1935 | } |
|---|
| | 1936 | |
|---|
| | 1937 | tmp = 0; |
|---|
| | 1938 | re = setsockopt (fd, IPPROTO_TCP, TCP_CORK, &tmp, sizeof(tmp)); |
|---|
| | 1939 | if (unlikely (re < 0)) { |
|---|
| | 1940 | PRINT_ERRNO (errno, "ERROR: Removing TCP_CORK to fd %d: ${errno}", fd); |
|---|
| | 1941 | return ret_error; |
|---|
| | 1942 | } |
|---|
| | 1943 | |
|---|
| | 1944 | tmp = 1; |
|---|
| | 1945 | re = setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &tmp, sizeof(tmp)); |
|---|
| | 1946 | if (unlikely (re < 0)) { |
|---|
| | 1947 | PRINT_ERRNO (errno, "ERROR: Setting TCP_NODELAY to fd %d: ${errno}", fd); |
|---|
| | 1948 | return ret_error; |
|---|
| | 1949 | } |
|---|
| | 1950 | |
|---|
| | 1951 | return ret_ok; |
|---|