/* made variable names more sane removed some cruft  */
int set_tcp_windowsize(int sock, int bufsize, int dir)
/* made variable names more sane removed some cruft  */
int set_tcp_windowsize(int sock, int bufsize, int dir)
{
    int       rc;
    int       newbufsize;
    if (bufsize > 0)
    {
	newbufsize = bufsize;
	rc = setsockopt(sock, SOL_SOCKET, dir, (char *) &newbufsize, sizeof newbufsize);
	if (rc < 0)
	    return rc;
    } else {
    }
    return 0;
}