View | Details | Raw Unified | Return to bug 240827 | Differences between
and this patch

Collapse All | Expand All

(-)contrib/tnftp/src/cmds.c (-2 / +6 lines)
Lines 2653-2662 Link Here
2653
		goto usage;
2653
		goto usage;
2654
	}
2654
	}
2655
2655
2656
	if (dir & RATE_PUT)
2656
	if (dir & RATE_PUT) {
2657
		sndbuf_size = size;
2657
		sndbuf_size = size;
2658
	if (dir & RATE_GET)
2658
		set_sndbufsize = 1;
2659
	}
2660
	if (dir & RATE_GET) {
2659
		rcvbuf_size = size;
2661
		rcvbuf_size = size;
2662
		set_rcvbufsize = 1;
2663
	}
2660
	fprintf(ttyout, "Socket buffer sizes: send %d, receive %d.\n",
2664
	fprintf(ttyout, "Socket buffer sizes: send %d, receive %d.\n",
2661
	    sndbuf_size, rcvbuf_size);
2665
	    sndbuf_size, rcvbuf_size);
2662
	code = 0;
2666
	code = 0;
(-)contrib/tnftp/src/ftp_var.h (+2 lines)
Lines 296-302 Link Here
296
296
297
GLOBAL	int	options;	/* used during socket creation */
297
GLOBAL	int	options;	/* used during socket creation */
298
298
299
GLOBAL	int	set_sndbufsize;	/* set socket send buffer size if true*/
299
GLOBAL	int	sndbuf_size;	/* socket send buffer size */
300
GLOBAL	int	sndbuf_size;	/* socket send buffer size */
301
GLOBAL	int	set_rcvbufsize;	/* set socket receive buffer size if true*/
300
GLOBAL	int	rcvbuf_size;	/* socket receive buffer size */
302
GLOBAL	int	rcvbuf_size;	/* socket receive buffer size */
301
303
302
GLOBAL	int	macnum;		/* number of defined macros */
304
GLOBAL	int	macnum;		/* number of defined macros */
(-)contrib/tnftp/src/util.c (-2 / +2 lines)
Lines 1087-1097 Link Here
1087
		    sndbuf_size);
1087
		    sndbuf_size);
1088
	}
1088
	}
1089
1089
1090
	if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF,
1090
	if (set_sndbufsize && setsockopt(sock, SOL_SOCKET, SO_SNDBUF,
1091
	    (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1)
1091
	    (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1)
1092
		warn("Unable to set sndbuf size %d", sndbuf_size);
1092
		warn("Unable to set sndbuf size %d", sndbuf_size);
1093
1093
1094
	if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
1094
	if (set_rcvbufsize && setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
1095
	    (void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1)
1095
	    (void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1)
1096
		warn("Unable to set rcvbuf size %d", rcvbuf_size);
1096
		warn("Unable to set rcvbuf size %d", rcvbuf_size);
1097
}
1097
}

Return to bug 240827