3 * For working with TIS proxies. TODO: Fix for use with aim_conn.c.
9 #ifdef TIS_TELNET_PROXY
10 #include "tis_telnet_proxy.h"
13 tis_telnet_proxy_connect( int fd, char *host, int port )
18 char connectstring[512];
19 char responsestring[512];
23 hent = gethostbyname( host );
25 snprintf( connectstring, 512, "connect %s %d\n", hent->h_name, port );
26 snprintf( responsestring, 512, "Connected to %s.\r\n", hent->h_name);
29 FD_SET( fd, &outset );
33 if( select( fd + 1, NULL, &outset, NULL, &tv ) == 1 )
34 if( write( fd, connectstring, strlen(connectstring) ) !=
35 strlen(connectstring) )
36 printf("\n****ERROR ON WRITE**** (proxy connect)\n");
43 while( select( fd + 1, &inset, NULL, NULL, NULL ) == 1 )
47 if( read( fd, &c, sizeof(c) ) != 1 )
48 printf("\n****ERROR ON READ**** (proxy response)\n");
52 if( *(++ptr) == '\0' )
63 #endif /* TIS_TELNET_PROXY */