Lines Matching refs:cp
646 static int tunnel(struct perclient *cp, fd_set *fds) in tunnel() argument
651 if(FD_ISSET(cp->clientfd, fds)) { in tunnel()
653 nread = recv(cp->clientfd, buffer, sizeof(buffer), 0); in tunnel()
655 nwrite = send(cp->remotefd, (char *)buffer, in tunnel()
659 cp->fromclient += nwrite; in tunnel()
664 if(FD_ISSET(cp->remotefd, fds)) { in tunnel()
666 nread = recv(cp->remotefd, buffer, sizeof(buffer), 0); in tunnel()
668 nwrite = send(cp->clientfd, (char *)buffer, in tunnel()
672 cp->fromremote += nwrite; in tunnel()
768 struct perclient *cp = &c[0]; in incoming() local
772 cp = &c[1]; in incoming()
773 cp->fromremote = 0; in incoming()
774 cp->fromclient = 0; in incoming()
775 cp->clientfd = newfd; in incoming()
776 cp->remotefd = remotefd; in incoming()
777 cp->used = TRUE; in incoming()
784 struct perclient *cp = &c[i]; in incoming() local
785 if(cp->used) { in incoming()
786 if(tunnel(cp, &fds_read)) { in incoming()
788 cp->fromremote, cp->fromclient); in incoming()
789 sclose(cp->clientfd); in incoming()
790 sclose(cp->remotefd); in incoming()
791 cp->used = FALSE; in incoming()