1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "apr_network_io.h"
18 #include "apr_strings.h"
20 #define APR_WANT_STRFUNC
23 #include "ap_config.h"
25 #include "http_config.h"
26 #include "http_core.h"
27 #include "ap_listen.h"
29 #include "mpm_common.h"
32 #include <systemd/sd-daemon.h>
35 /* we know core's module_index is 0 */
36 #undef APLOG_MODULE_INDEX
37 #define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
39 AP_DECLARE_DATA ap_listen_rec *ap_listeners = NULL;
41 AP_DECLARE_DATA ap_listen_rec **mpm_listen = NULL;
42 AP_DECLARE_DATA int enable_default_listener = 1;
43 AP_DECLARE_DATA int num_buckets = 1;
44 AP_DECLARE_DATA int have_so_reuseport = 0;
46 static ap_listen_rec *old_listeners;
47 static int ap_listenbacklog;
48 static int send_buffer_size;
49 static int receive_buffer_size;
51 static int use_systemd;
54 /* TODO: make_sock is just begging and screaming for APR abstraction */
55 static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server, int do_bind_listen)
57 apr_socket_t *s = server->sd;
60 #ifdef AP_ENABLE_V4_MAPPED
61 int v6only_setting = 0;
63 int v6only_setting = 1;
69 stat = apr_socket_opt_set(s, APR_SO_REUSEADDR, one);
70 if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
71 ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(00067)
72 "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEADDR)",
79 stat = apr_socket_opt_set(s, APR_SO_KEEPALIVE, one);
80 if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
81 ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(00068)
82 "make_sock: for address %pI, apr_socket_opt_set: (SO_KEEPALIVE)",
89 * To send data over high bandwidth-delay connections at full
90 * speed we must force the TCP window to open wide enough to keep the
91 * pipe full. The default window size on many systems
92 * is only 4kB. Cross-country WAN connections of 100ms
93 * at 1Mb/s are not impossible for well connected sites.
94 * If we assume 100ms cross-country latency,
95 * a 4kB buffer limits throughput to 40kB/s.
97 * To avoid this problem I've added the SendBufferSize directive
98 * to allow the web master to configure send buffer size.
100 * The trade-off of larger buffers is that more kernel memory
101 * is consumed. YMMV, know your customers and your network!
103 * -John Heidemann <johnh@isi.edu> 25-Oct-96
105 * If no size is specified, use the kernel default.
107 if (send_buffer_size) {
108 stat = apr_socket_opt_set(s, APR_SO_SNDBUF, send_buffer_size);
109 if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
110 ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p, APLOGNO(00070)
111 "make_sock: failed to set SendBufferSize for "
112 "address %pI, using default",
114 /* not a fatal error */
117 if (receive_buffer_size) {
118 stat = apr_socket_opt_set(s, APR_SO_RCVBUF, receive_buffer_size);
119 if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
120 ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p, APLOGNO(00071)
121 "make_sock: failed to set ReceiveBufferSize for "
122 "address %pI, using default",
124 /* not a fatal error */
128 #if APR_TCP_NODELAY_INHERITED
129 ap_sock_disable_nagle(s);
135 apr_os_sock_get(&thesock, s);
136 if (setsockopt(thesock, SOL_SOCKET, SO_REUSEPORT, (void *)&one, sizeof(int)) < 0) {
137 /* defined by not valid? */
138 if (errno == ENOPROTOOPT) {
139 have_so_reuseport = 0;
140 } /* Check if SO_REUSEPORT is supported by the running Linux Kernel.*/
142 ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(02638)
143 "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEPORT)",
150 have_so_reuseport = 1;
155 if (do_bind_listen) {
157 if (server->bind_addr->family == APR_INET6) {
158 stat = apr_socket_opt_set(s, APR_IPV6_V6ONLY, v6only_setting);
159 if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
160 ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(00069)
161 "make_sock: for address %pI, apr_socket_opt_set: "
170 if ((stat = apr_socket_bind(s, server->bind_addr)) != APR_SUCCESS) {
171 ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, stat, p, APLOGNO(00072)
172 "make_sock: could not bind to address %pI",
178 if ((stat = apr_socket_listen(s, ap_listenbacklog)) != APR_SUCCESS) {
179 ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, stat, p, APLOGNO(00073)
180 "make_sock: unable to listen for connections "
189 /* I seriously doubt that this would work on Unix; I have doubts that
190 * it entirely solves the problem on Win32. However, since setting
191 * reuseaddr on the listener -prior- to binding the socket has allowed
192 * us to attach to the same port as an already running instance of
193 * Apache, or even another web server, we cannot identify that this
194 * port was exclusively granted to this instance of Apache.
196 * So set reuseaddr, but do not attempt to do so until we have the
197 * parent listeners successfully bound.
199 stat = apr_socket_opt_set(s, APR_SO_REUSEADDR, one);
200 if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
201 ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(00074)
202 "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEADDR)",
210 server->active = enable_default_listener;
212 server->accept_func = NULL;
217 static const char* find_accf_name(server_rec *s, const char *proto)
220 core_server_config *conf = ap_get_core_module_config(s->module_config);
225 accf = apr_table_get(conf->accf_map, proto);
227 if (accf && !strcmp("none", accf)) {
234 static void ap_apply_accept_filter(apr_pool_t *p, ap_listen_rec *lis,
237 apr_socket_t *s = lis->sd;
242 proto = lis->protocol;
245 proto = ap_get_server_protocol(server);
249 accf = find_accf_name(server, proto);
252 #if APR_HAS_SO_ACCEPTFILTER
253 /* In APR 1.x, the 2nd and 3rd parameters are char * instead of
254 * const char *, so make a copy of those args here.
256 rv = apr_socket_accept_filter(s, apr_pstrdup(p, accf),
258 if (rv != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(rv)) {
259 ap_log_perror(APLOG_MARK, APLOG_WARNING, rv, p, APLOGNO(00075)
260 "Failed to enable the '%s' Accept Filter",
264 rv = apr_socket_opt_set(s, APR_TCP_DEFER_ACCEPT, 30);
265 if (rv != APR_SUCCESS && !APR_STATUS_IS_ENOTIMPL(rv)) {
266 ap_log_perror(APLOG_MARK, APLOG_WARNING, rv, p, APLOGNO(00076)
267 "Failed to enable APR_TCP_DEFER_ACCEPT");
273 static apr_status_t close_listeners_on_exec(void *v)
275 ap_close_listeners();
282 static apr_status_t alloc_systemd_listener(process_rec * process,
284 ap_listen_rec **out_rec)
288 socklen_t len = sizeof(struct sockaddr);
289 apr_os_sock_info_t si;
293 memset(&si, 0, sizeof(si));
295 rv = getsockname(fd, &sa, &len);
298 rv = apr_get_netos_error();
299 ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, process->pool, APLOGNO(02489)
300 "getsockname on %d failed.", fd);
305 si.family = sa.sa_family;
307 si.type = SOCK_STREAM;
308 si.protocol = APR_PROTO_TCP;
310 rec = apr_palloc(process->pool, sizeof(ap_listen_rec));
315 rv = apr_os_sock_make(&rec->sd, &si, process->pool);
316 if (rv != APR_SUCCESS) {
317 ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, process->pool, APLOGNO(02490)
318 "apr_os_sock_make on %d failed.", fd);
322 rv = apr_socket_addr_get(&rec->bind_addr, APR_LOCAL, rec->sd);
323 if (rv != APR_SUCCESS) {
324 ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, process->pool, APLOGNO(02491)
325 "apr_socket_addr_get on %d failed.", fd);
329 if (rec->bind_addr->port == 443) {
330 rec->protocol = apr_pstrdup(process->pool, "https");
332 rec->protocol = apr_pstrdup(process->pool, "http");
337 return make_sock(process->pool, rec, 0);
340 static int open_systemd_listeners(process_rec *process)
342 ap_listen_rec *last, *new;
346 const char *userdata_key = "ap_systemd_listeners";
347 int sdc = sd_listen_fds(0);
350 ap_log_perror(APLOG_MARK, APLOG_CRIT, sdc, process->pool, APLOGNO(02486)
351 "open_systemd_listeners: Error parsing enviroment, sd_listen_fds returned %d",
357 ap_log_perror(APLOG_MARK, APLOG_CRIT, sdc, process->pool, APLOGNO(02487)
358 "open_systemd_listeners: At least one socket must be set.");
363 while (last && last->next) {
367 fdcount = atoi(getenv("LISTEN_FDS"));
369 for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + fdcount; fd++) {
370 rv = alloc_systemd_listener(process, fd, &new);
372 if (rv != APR_SUCCESS) {
373 ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, process->pool, APLOGNO(02488)
374 "open_systemd_listeners: failed to setup socket %d.", fd);
379 ap_listeners = last = new;
387 /* clear the enviroment on our second run
388 * so that none of our future children get confused.
390 apr_pool_userdata_get(&data, userdata_key, process->pool);
392 apr_pool_userdata_set((const void *)1, userdata_key,
393 apr_pool_cleanup_null, process->pool);
403 #endif /* HAVE_SYSTEMD */
405 static const char *alloc_listener(process_rec *process, char *addr,
406 apr_port_t port, const char* proto,
409 ap_listen_rec **walk, *last;
412 int found_listener = 0;
414 /* see if we've got an old listener for this address:port */
415 for (walk = &old_listeners; *walk;) {
416 sa = (*walk)->bind_addr;
417 /* Some listeners are not real so they will not have a bind_addr. */
423 /* If both ports are equivalent, then if their names are equivalent,
424 * then we will re-use the existing record.
426 if (port == oldport &&
427 ((!addr && !sa->hostname) ||
428 ((addr && sa->hostname) && !strcmp(sa->hostname, addr)))) {
431 new->next = ap_listeners;
438 walk = &(*walk)->next;
441 if (found_listener) {
442 if (ap_listeners->slave != slave) {
443 return "Cannot define a slave on the same IP:port as a Listener";
448 if ((status = apr_sockaddr_info_get(&sa, addr, APR_UNSPEC, port, 0,
451 ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool, APLOGNO(00077)
452 "alloc_listener: failed to set up sockaddr for %s",
454 return "Listen setup failed";
457 /* Initialize to our last configured ap_listener. */
459 while (last && last->next) {
466 /* this has to survive restarts */
467 new = apr_palloc(process->pool, sizeof(ap_listen_rec));
471 new->protocol = apr_pstrdup(process->pool, proto);
473 /* Go to the next sockaddr. */
476 status = apr_socket_create(&new->sd, new->bind_addr->family,
477 SOCK_STREAM, 0, process->pool);
480 /* What could happen is that we got an IPv6 address, but this system
481 * doesn't actually support IPv6. Try the next address.
483 if (status != APR_SUCCESS && !addr &&
484 new->bind_addr->family == APR_INET6) {
488 if (status != APR_SUCCESS) {
489 ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool, APLOGNO(00078)
490 "alloc_listener: failed to get a socket for %s",
492 return "Listen setup failed";
495 /* We need to preserve the order returned by getaddrinfo() */
497 ap_listeners = last = new;
507 /* Evaluates to true if the (apr_sockaddr_t *) addr argument is the
508 * IPv4 match-any-address, 0.0.0.0. */
509 #define IS_INADDR_ANY(addr) ((addr)->family == APR_INET \
510 && (addr)->sa.sin.sin_addr.s_addr == INADDR_ANY)
512 /* Evaluates to true if the (apr_sockaddr_t *) addr argument is the
513 * IPv6 match-any-address, [::]. */
514 #define IS_IN6ADDR_ANY(addr) ((addr)->family == APR_INET6 \
515 && IN6_IS_ADDR_UNSPECIFIED(&(addr)->sa.sin6.sin6_addr))
518 * Create, open, listen, and bind all sockets.
519 * @param process The process record for the currently running server
520 * @return The number of open sockets
522 static int open_listeners(apr_pool_t *pool)
526 ap_listen_rec *previous;
528 const char *userdata_key = "ap_open_listeners";
530 #if AP_NONBLOCK_WHEN_MULTI_LISTEN
534 /* Don't allocate a default listener. If we need to listen to a
535 * port, then the user needs to have a Listen directive in their
540 for (lr = ap_listeners; lr; previous = lr, lr = lr->next) {
550 /* If we have the unspecified IPv4 address (0.0.0.0) and
551 * the unspecified IPv6 address (::) is next, we need to
552 * swap the order of these in the list. We always try to
553 * bind to IPv6 first, then IPv4, since an IPv6 socket
554 * might be able to receive IPv4 packets if V6ONLY is not
555 * enabled, but never the other way around.
556 * Note: In some configurations, the unspecified IPv6 address
557 * could be even later in the list. This logic only corrects
558 * the situation where it is next in the list, such as when
559 * apr_sockaddr_info_get() returns an IPv4 and an IPv6 address,
563 && IS_INADDR_ANY(lr->bind_addr)
564 && lr->bind_addr->port == lr->next->bind_addr->port
565 && IS_IN6ADDR_ANY(lr->next->bind_addr)) {
566 /* Exchange lr and lr->next */
568 lr->next = next->next;
571 previous->next = next;
579 /* If we are trying to bind to 0.0.0.0 and a previous listener
580 * was :: on the same port and in turn that socket does not have
581 * the IPV6_V6ONLY flag set; we must skip the current attempt to
582 * listen (which would generate an error). IPv4 will be handled
583 * on the established IPv6 socket.
585 if (IS_INADDR_ANY(lr->bind_addr) && previous) {
586 for (cur = ap_listeners; cur != lr; cur = cur->next) {
587 if (lr->bind_addr->port == cur->bind_addr->port
588 && IS_IN6ADDR_ANY(cur->bind_addr)
589 && apr_socket_opt_get(cur->sd, APR_IPV6_V6ONLY,
590 &v6only_setting) == APR_SUCCESS
591 && v6only_setting == 0) {
593 /* Remove the current listener from the list */
594 previous->next = lr->next;
595 lr = previous; /* maintain current value of previous after
596 * post-loop expression is evaluated
607 if (make_sock(pool, lr, enable_default_listener) == APR_SUCCESS) {
612 /* If we tried to bind to ::, and the next listener is
613 * on 0.0.0.0 with the same port, don't give a fatal
614 * error. The user will still get a warning from make_sock
618 && IS_IN6ADDR_ANY(lr->bind_addr)
619 && lr->bind_addr->port == lr->next->bind_addr->port
620 && IS_INADDR_ANY(lr->next->bind_addr)) {
622 /* Remove the current listener from the list */
624 previous->next = lr->next;
627 ap_listeners = lr->next;
630 /* Although we've removed ourselves from the list,
631 * we need to make sure that the next iteration won't
632 * consider "previous" a working IPv6 '::' socket.
633 * Changing the family is enough to make sure the
634 * conditions before make_sock() fail.
636 lr->bind_addr->family = AF_INET;
647 /* close the old listeners */
648 for (lr = old_listeners; lr; lr = next) {
649 apr_socket_close(lr->sd);
653 old_listeners = NULL;
655 #if AP_NONBLOCK_WHEN_MULTI_LISTEN
656 /* if multiple listening sockets, make them non-blocking so that
657 * if select()/poll() reports readability for a reset connection that
658 * is already forgotten about by the time we call accept, we won't
659 * be hung until another connection arrives on that port
661 use_nonblock = (ap_listeners && ap_listeners->next);
662 for (lr = ap_listeners; lr; lr = lr->next) {
665 status = apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, use_nonblock);
666 if (status != APR_SUCCESS) {
667 ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, status, pool, APLOGNO(00079)
668 "unable to control socket non-blocking status");
672 #endif /* AP_NONBLOCK_WHEN_MULTI_LISTEN */
674 /* we come through here on both passes of the open logs phase
675 * only register the cleanup once... otherwise we try to close
676 * listening sockets twice when cleaning up prior to exec
678 apr_pool_userdata_get(&data, userdata_key, pool);
680 apr_pool_userdata_set((const void *)1, userdata_key,
681 apr_pool_cleanup_null, pool);
682 apr_pool_cleanup_register(pool, NULL, apr_pool_cleanup_null,
683 close_listeners_on_exec);
686 return num_open ? 0 : -1;
689 AP_DECLARE(int) ap_setup_listeners(server_rec *s)
692 server_addr_rec *addr;
694 int num_listeners = 0;
698 for (ls = s; ls; ls = ls->next) {
699 proto = ap_get_server_protocol(ls);
702 /* No protocol was set for this vhost,
703 * use the default for this listener.
705 for (addr = ls->addrs; addr && !found; addr = addr->next) {
706 for (lr = ap_listeners; lr; lr = lr->next) {
707 if (apr_sockaddr_equal(lr->bind_addr, addr->host_addr) &&
708 lr->bind_addr->port == addr->host_port) {
709 ap_set_server_protocol(ls, lr->protocol);
717 /* TODO: set protocol defaults per-Port, eg 25=smtp */
718 ap_set_server_protocol(ls, "http");
726 if (open_systemd_listeners(s->process) != 0) {
733 if (open_listeners(s->process->pool)) {
738 for (lr = ap_listeners; lr; lr = lr->next) {
741 for (ls = s; ls && !found; ls = ls->next) {
742 for (addr = ls->addrs; addr && !found; addr = addr->next) {
743 if (apr_sockaddr_equal(lr->bind_addr, addr->host_addr) &&
744 lr->bind_addr->port == addr->host_port) {
746 ap_apply_accept_filter(s->process->pool, lr, ls);
752 ap_apply_accept_filter(s->process->pool, lr, s);
756 return num_listeners;
759 AP_DECLARE(apr_status_t) ap_duplicate_listeners(server_rec *s, apr_pool_t *p,
763 int use_nonblock = 0;
766 mpm_listen = apr_palloc(p, sizeof(ap_listen_rec*) * num_buckets);
767 for (i = 0; i < num_buckets; i++) {
768 ap_listen_rec *last = NULL;
771 ap_listen_rec *duplr;
778 apr_os_sock_get(&thesock, lr->sd);
779 if ((stat = alloc_systemd_listener(s->process, thesock, &duplr))
787 duplr = apr_palloc(p, sizeof(ap_listen_rec));
789 duplr->protocol = apr_pstrdup(p, lr->protocol);
790 hostname = apr_pstrdup(p, lr->bind_addr->hostname);
791 port = lr->bind_addr->port;
792 apr_sockaddr_info_get(&sa, hostname, APR_UNSPEC, port, 0, p);
793 duplr->bind_addr = sa;
795 if ((stat = apr_socket_create(&duplr->sd, duplr->bind_addr->family,
796 SOCK_STREAM, 0, p)) != APR_SUCCESS) {
797 ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, p, APLOGNO(02640)
798 "ap_duplicate_socket: for address %pI, "
799 "cannot duplicate a new socket!",
803 make_sock(p, duplr, 1);
805 #if AP_NONBLOCK_WHEN_MULTI_LISTEN
806 use_nonblock = (ap_listeners && ap_listeners->next);
807 if ((stat = apr_socket_opt_set(duplr->sd, APR_SO_NONBLOCK, use_nonblock))
809 ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(02641)
810 "unable to control socket non-blocking status");
814 ap_apply_accept_filter(p, duplr, s);
817 mpm_listen[i] = last = duplr;
829 AP_DECLARE_NONSTD(void) ap_close_listeners(void)
833 for (i = 0; i < num_buckets; i++) {
834 for (lr = mpm_listen[i]; lr; lr = lr->next) {
835 apr_socket_close(lr->sd);
841 AP_DECLARE_NONSTD(int) ap_close_selected_listeners(ap_slave_t *slave)
846 for (lr = ap_listeners; lr; lr = lr->next) {
847 if (lr->slave != slave) {
848 apr_socket_close(lr->sd);
858 AP_DECLARE(void) ap_listen_pre_config(void)
860 old_listeners = ap_listeners;
862 ap_listenbacklog = DEFAULT_LISTENBACKLOG;
865 AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
866 int argc, char *const argv[])
868 char *host, *scope_id, *proto;
871 const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
877 if (argc < 1 || argc > 2) {
878 return "Listen requires 1 or 2 arguments.";
881 if (strcmp("systemd", argv[0]) == 0) {
884 if (ap_listeners != NULL) {
885 return "systemd socket activation support must be used exclusive of normal listeners.";
889 return "systemd support was not compiled in.";
895 return "systemd socket activation support must be used exclusive of normal listeners.";
899 rv = apr_parse_addr_port(&host, &scope_id, &port, argv[0], cmd->pool);
900 if (rv != APR_SUCCESS) {
901 return "Invalid address or port";
904 if (host && !strcmp(host, "*")) {
909 /* XXX scope id support is useful with link-local IPv6 addresses */
910 return "Scope id is not supported";
914 return "Port must be specified";
925 proto = apr_pstrdup(cmd->pool, argv[1]);
926 ap_str_tolower(proto);
929 return alloc_listener(cmd->server->process, host, port, proto, NULL);
932 AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd,
937 const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
945 return "ListenBacklog must be > 0";
948 ap_listenbacklog = b;
952 AP_DECLARE_NONSTD(const char *) ap_set_send_buffer_size(cmd_parms *cmd,
957 const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
963 if (s < 512 && s != 0) {
964 return "SendBufferSize must be >= 512 bytes, or 0 for system default.";
967 send_buffer_size = s;
971 AP_DECLARE_NONSTD(const char *) ap_set_receive_buffer_size(cmd_parms *cmd,
976 const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
982 if (s < 512 && s != 0) {
983 return "ReceiveBufferSize must be >= 512 bytes, or 0 for system default.";
986 receive_buffer_size = s;