Home | History | Annotate | Download | only in x11vnc

Lines Matching refs:s_in

78 void raw_xfer(int csock, int s_in, int s_out);
701 static int ssl_init(int s_in, int s_out, int skip_vnc_tls, double last_https) {
709 static void ssl_xfer(int csock, int s_in, int s_out, int is_https) {
713 raw_xfer(csock, s_in, s_out);
741 static int ssl_init(int s_in, int s_out, int skip_vnc_tls, double last_https);
742 static void ssl_xfer(int csock, int s_in, int s_out, int is_https);
1559 static int anontls_dialog(int s_in, int s_out) {
1561 if (s_in || s_out) {}
1577 static int vencrypt_dialog(int s_in, int s_out) {
1589 close(s_in); close(s_out);
1595 if (!read_exact(s_in, buf, 2)) {
1596 close(s_in); close(s_out);
1604 close(s_in); close(s_out);
1613 close(s_in); close(s_out);
1620 close(s_in); close(s_out);
1661 close(s_in); close(s_out);
1666 close(s_in); close(s_out);
1671 if (!read_exact(s_in, (char *)&ival, 4)) {
1672 close(s_in); close(s_out);
1680 close(s_in); close(s_out);
1694 close(s_in); close(s_out);
1712 close(s_in); close(s_out);
1730 static int check_vnc_tls_mode(int s_in, int s_out, double last_https) {
1778 FD_SET(s_in, &rfds);
1781 select(s_in+1, &rfds, NULL, NULL, &tv);
1782 if (FD_ISSET(s_in, &rfds)) {
1803 close(s_in); close(s_out);
1808 if (!read_exact(s_in, buf, 12)) {
1809 close(s_in); close(s_out);
1820 close(s_in); close(s_out);
1826 close(s_in); close(s_out);
1851 close(s_in); close(s_out);
1857 if (!read_exact(s_in, buf, 1)) {
1858 close(s_in); close(s_out);
1880 close(s_in); close(s_out);
1887 return vencrypt_dialog(s_in, s_out);
1889 return anontls_dialog(s_in, s_out);
1937 static int ssl_init(int s_in, int s_out, int skip_vnc_tls, double last_https) {
1942 int ssock = s_in;
1967 } else if (!check_vnc_tls_mode(s_in, s_out, last_https)) {
1971 getpid(), s_in, s_out, timeout);
1982 if (s_in == s_out) {
1988 if (! SSL_set_rfd(ssl, s_in)) {
2157 static void symmetric_encryption_xfer(int csock, int s_in, int s_out);
2159 static void ssl_xfer(int csock, int s_in, int s_out, int is_https) {
2183 raw_xfer(csock, s_in, s_out);
2190 raw_xfer(csock, s_in, s_out);
2192 symmetric_encryption_xfer(csock, s_in, s_out);
2215 * to cover inetd mode, we have s_in and s_out, but in non-inetd
2226 if (s_out > s_in) {
2229 ssock = s_in;
2301 FD_SET(s_in, &rd);
2360 if (0) fprintf(stderr, "nfd[%d]: %d w/r csock: %d %d s_in: %d %d\n", getpid(), nfd, FD_ISSET(csock, &wr), FD_ISSET(csock, &rd), FD_ISSET(s_out, &wr), FD_ISSET(s_in, &rd));
2422 (SSL_want_read(ssl) && FD_ISSET(s_in, &rd))) {
2494 if ((sptr < ABSIZE && FD_ISSET(s_in, &rd)) ||
2550 getpid(), csock, s_in, s_out);
2552 close(s_in);
3046 static int is_ssl_readable(int s_in, double last_https, char *last_get,
3057 * we'll do a select() on s_in for reading. this is not an
3088 FD_SET(s_in, &rd);
3092 nfd = select(s_in+1, &rd, NULL, NULL, &tv);
3098 if (nfd <= 0 || ! FD_ISSET(s_in, &rd)) {
3491 int s_in, s_out, httpsock = -1;
3539 s_in = fileno(stdin);
3542 s_in = s_out = sock;
3545 if (! ssl_init(s_in, s_out, skip_vnc_tls, last_https)) {
3613 if (! is_ssl_readable(s_in, last_https, last_get,
3627 is_http = watch_for_http_traffic(buf, &n, s_in);
3673 n = read(s_in, buf2 + ptr, 1);
3841 ssl_xfer(httpsock, s_in, s_out, is_http);
3856 ssl_xfer(vncsock, s_in, s_out, 0);
4213 void raw_xfer(int csock, int s_in, int s_out) {
4234 if (db) rfbLog("raw_xfer start: %d -> %d/%d\n", csock, s_in, s_out);
4266 if (db) rfbLog("raw_xfer start: %d <- %d\n", csock, s_in);
4269 n = read(s_in, buf, sz);
4286 if (db) rfbLog("raw_xfer bad write: %d <- %d | %d/%d errno=%d\n", csock, s_in, m, n, errno);
4294 if (db) rfbLog("raw_xfer done: %d <- %d\n", csock, s_in);
4297 close(s_in);
4318 static void symmetric_encryption_xfer(int csock, int s_in, int s_out) {
4338 /* TBD: s_in != s_out */
4341 sprintf(tmp, "fd=%d,%d", s_in, csock);