View | Details | Raw Unified | Return to bug 55897
Collapse All | Expand All

(-)apr-1.5.0/include/apr_network_io.h (+5 lines)
Lines 65-70 Link Here
65
#define APR_SO_DEBUG         4    /**< Debug */
65
#define APR_SO_DEBUG         4    /**< Debug */
66
#define APR_SO_NONBLOCK      8    /**< Non-blocking IO */
66
#define APR_SO_NONBLOCK      8    /**< Non-blocking IO */
67
#define APR_SO_REUSEADDR     16   /**< Reuse addresses */
67
#define APR_SO_REUSEADDR     16   /**< Reuse addresses */
68
#define APR_SO_REUSEPORT     32   /**< Reuse port */
68
#define APR_SO_SNDBUF        64   /**< Send buffer */
69
#define APR_SO_SNDBUF        64   /**< Send buffer */
69
#define APR_SO_RCVBUF        128  /**< Receive buffer */
70
#define APR_SO_RCVBUF        128  /**< Receive buffer */
70
#define APR_SO_DISCONNECTED  256  /**< Disconnected */
71
#define APR_SO_DISCONNECTED  256  /**< Disconnected */
Lines 616-621 Link Here
616
 *            APR_SO_REUSEADDR  --  The rules used in validating addresses
617
 *            APR_SO_REUSEADDR  --  The rules used in validating addresses
617
 *                                  supplied to bind should allow reuse
618
 *                                  supplied to bind should allow reuse
618
 *                                  of local addresses.
619
 *                                  of local addresses.
620
 *            APR_SO_REUSEPORT  --  This enable multiple sockets listen to 
621
 *                                  the same ipaddress:port. 
619
 *            APR_SO_SNDBUF     --  Set the SendBufferSize
622
 *            APR_SO_SNDBUF     --  Set the SendBufferSize
620
 *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
623
 *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
621
 * </PRE>
624
 * </PRE>
Lines 650-655 Link Here
650
 *            APR_SO_REUSEADDR  --  The rules used in validating addresses
653
 *            APR_SO_REUSEADDR  --  The rules used in validating addresses
651
 *                                  supplied to bind should allow reuse
654
 *                                  supplied to bind should allow reuse
652
 *                                  of local addresses.
655
 *                                  of local addresses.
656
 *            APR_SO_REUSEPORT  --  enable multiple sockets listen to 
657
 *                                  the same ipaddress:port.
653
 *            APR_SO_SNDBUF     --  Set the SendBufferSize
658
 *            APR_SO_SNDBUF     --  Set the SendBufferSize
654
 *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
659
 *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
655
 *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket.
660
 *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket.
(-)apr-1.5.0/network_io/unix/sockopt.c (+14 lines)
Lines 161-166 Link Here
161
            apr_set_option(sock, APR_SO_REUSEADDR, on);
161
            apr_set_option(sock, APR_SO_REUSEADDR, on);
162
        }
162
        }
163
        break;
163
        break;
164
/* SO_REUSEPORT is enabled in the Linux kernel newer than 3.9. It allows
165
 * multiple sockets listen to the same ipaddress:port. 
166
 */
167
    case APR_SO_REUSEPORT:
168
#ifndef SO_REUSEPORT
169
#define SO_REUSEPORT 15
170
        if(on != apr_is_option_set(sock, APR_SO_REUSEPORT)) {
171
            if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEPORT, (void *)&one, sizeof(int)) == -1) {
172
                return errno;
173
            }
174
            apr_set_option(sock, APR_SO_REUSEPORT, on);
175
        }
176
#endif
177
        break;
164
    case APR_SO_SNDBUF:
178
    case APR_SO_SNDBUF:
165
#ifdef SO_SNDBUF
179
#ifdef SO_SNDBUF
166
        if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) {
180
        if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) {

Return to bug 55897