Deleted Added
full compact
misc.c (124208) misc.c (126274)
1/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
1/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26RCSID("$OpenBSD: misc.c,v 1.22 2003/09/18 08:49:45 markus Exp $");
26RCSID("$OpenBSD: misc.c,v 1.23 2003/10/28 09:08:06 markus Exp $");
27
28#include "misc.h"
29#include "log.h"
30#include "xmalloc.h"
31
32/* remove newline at end of string */
33char *
34chop(char *s)

--- 57 unchanged lines hidden (view full) ---

92void
93set_nodelay(int fd)
94{
95 int opt;
96 socklen_t optlen;
97
98 optlen = sizeof opt;
99 if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) {
27
28#include "misc.h"
29#include "log.h"
30#include "xmalloc.h"
31
32/* remove newline at end of string */
33char *
34chop(char *s)

--- 57 unchanged lines hidden (view full) ---

92void
93set_nodelay(int fd)
94{
95 int opt;
96 socklen_t optlen;
97
98 optlen = sizeof opt;
99 if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) {
100 error("getsockopt TCP_NODELAY: %.100s", strerror(errno));
100 debug("getsockopt TCP_NODELAY: %.100s", strerror(errno));
101 return;
102 }
103 if (opt == 1) {
104 debug2("fd %d is TCP_NODELAY", fd);
105 return;
106 }
107 opt = 1;
108 debug2("fd %d setting TCP_NODELAY", fd);

--- 220 unchanged lines hidden ---
101 return;
102 }
103 if (opt == 1) {
104 debug2("fd %d is TCP_NODELAY", fd);
105 return;
106 }
107 opt = 1;
108 debug2("fd %d setting TCP_NODELAY", fd);

--- 220 unchanged lines hidden ---