This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Cygwin B20.1 compiled programs cannot connect through Microsoft Proxy 2.0.


A hearty hello to all,
	Following are two messages posted to the cygwin-help mailing list dated May
7, 1999 and May 26, 1999 .  I am experiencing a similar problem using Cygwin
b20.1 and a file transfer program called rsync (http://rsync.samba.org/).
It fails with a "bad response from proxy" error through Microsoft Proxy 2.0.
I realize it is a long time since these messages were written but it is two
of the few I could find similar to my own problem.  I am wondering if these
issues were ever resolved or if anyone has more insight to the problem.  Any
information would be appreciated.  Is the subject of my message a valid
conclusion?
Thank-you,
Rod Ollerhead
Coynet International Corp.
Yellowknife, Northwest Territories, Canada

First Message
http://www.delorie.com/archives/browse.cgi?p=cygwin/1999/05/26/07:08:04
<<
Hi,
I once used Andy Piper's cygwin /usr/local stuff happily until my company
installed Microsoft Proxy Server as firwall. The ftp.exe and telnet.exe of
Andy's are all blocked by the firewall but still work well within the
firewall. On the other hand, the ftp.exe and telnet.exe that come with Ms
Win98 still work happily through the firewall. I'm using Cygwin b20.1 I
strongly suspect that it is the problem of the cygwin environment but still
cannot pinpoint it. I then got the gnu wget source for testing. I compiled
wget.exe 2 times with MSVC6 and Cygwin tool chain respectively. As I have
expected, the cygwin version is always blocked by the firewall while the
msvc6 version can reach outside with no problem. When I traced cygwin
version into the source code with gdb, I found it is blocked at line 91 of
connect.c where the statement is, if (connect (*sock, (struct sockaddr *)
&sock_name, sizeof (sock_name))) ... I also traced the MSVC6 version that it
passed this statement with no problem. I can only reach here and have no
idea to investigate further. I don't know if it is the cygwin1.dll that
makes the proxy function incorrect. Actually not only the proxy server is
installed at the server computer, my PC also installed the WSP (WinSock
Proxy) client. The WSPWSP.dll is added to \windows\system directory. Anyone
can help?
Thanks!
Yu-Jui Lee
Trinity Communications Inc.
Taipei, Taiwan
>>

Message Response
http://www.delorie.com/archives/browse.cgi?p=cygwin/1999/05/26/10:04:10
<<
It's a bug of winsock proxy client dll - an application cannot connect
duplicated socket. Cygwin1.dll contains the following routine:
/* Cygwin internal */
static SOCKET
duplicate_socket (SOCKET sock)
{ 
	/* Do not duplicate socket on Windows NT because of problems with MS winsock proxy server. */
 	if (os_being_run == winNT) 
		return sock; 
	SOCKET newsock; 
	if (DuplicateHandle (GetCurrentProcess(), (HANDLE) sock, 
			GetCurrentProcess(), (HANDLE *) &newsock, 
			0, TRUE, DUPLICATE_SAME_ACCESS)) 
	{ 
		(*i_closesocket) (sock); 
		sock = newsock; 
	} 
	else small_printf ("DuplicateHandle failed %E"); 
	return sock; 
} 

This routine is neccessary to run socket applications on Win95 (I don't know if it neccessary for Win98). The problem is in socket() call on W95 - the socket returned is non-inherittable handle (unlike NT and Unixes, where sockets are inherittable). To fix the problem DuplicateHandle call is used to create inherittable handle, and original handle is closed. But, unfortunately, that raises a problem with winsock proxy dll. 
Sergey Okhapkin, 
Piscataway, NJ 
>>

__________________________________________________________
Get your FREE personalized e-mail at http://www.canada.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]