From fd35e70e7a255b58b5cb835a529b32457ca5fba0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 7 Jul 2009 09:42:52 +0000 Subject: [PATCH] 2009-07-07 11:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtip/client.prg % Further simplified proxy handling code. * ChangeLog ! Typos. --- harbour/ChangeLog | 13 ++++++++++--- harbour/contrib/hbtip/client.prg | 24 ++++++++---------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3458ff10ab..be0ae3f13e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-07 11:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbtip/client.prg + % Further simplified proxy handling code. + + * ChangeLog + ! Typos. + 2009-07-07 11:18 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/config/dos/watcom.cf * harbour/config/win/watcom.cf @@ -44,8 +51,8 @@ Image now scales to bounding rectangle of the static object. * harbour/contrib/hbxbp/tests/demoxbp.prg - ! Updated to reflect above implementations. - Move mouse over the different parts. Also notice image in one of the + ! Updated to reflect above implementations. + Move mouse over the different parts. Also notice image in one of the static in group-box. 2009-07-07 01:13 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) @@ -84,7 +91,7 @@ * .cpp file rename. This is to resolve short term problem msvc builds failing due to too long command line length when assembling the library. - ; TOFIX: On the mide term which whould split this huge lib into smaller + ; TOFIX: On the mid term we should split this huge lib into smaller pieces. * Moved non-generated files to the top of the file list to make them build first. diff --git a/harbour/contrib/hbtip/client.prg b/harbour/contrib/hbtip/client.prg index 545ba58d7b..f49f2bc66f 100644 --- a/harbour/contrib/hbtip/client.prg +++ b/harbour/contrib/hbtip/client.prg @@ -240,17 +240,14 @@ METHOD Open( cUrl ) CLASS tIPClient RETURN .T. METHOD OpenProxy( cServer, nPort, cProxy, nProxyPort, cResp, cUserName, cPassWord, nTimeOut, cUserAgent ) CLASS tIPClient - LOCAL cRequest := "" + LOCAL cRequest + LOCAL lRet := .F. LOCAL tmp - LOCAL lRet := .T. - - LOCAL nResponseCode - LOCAL sResponseCode, nFirstSpace ::InetConnect( cProxy, nProxyPort, ::SocketCon ) IF ( tmp := ::InetErrorCode( ::SocketCon ) ) == 0 - cRequest += "CONNECT " + cServer + ":" + hb_ntos( nPort ) + " HTTP/1.1" + Chr( 13 ) + Chr( 10 ) + cRequest := "CONNECT " + cServer + ":" + hb_ntos( nPort ) + " HTTP/1.1" + Chr( 13 ) + Chr( 10 ) IF ! Empty( cUserAgent ) cRequest += "User-agent: " + cUserAgent + Chr( 13 ) + Chr( 10 ) ENDIF @@ -261,18 +258,13 @@ METHOD OpenProxy( cServer, nPort, cProxy, nProxyPort, cResp, cUserName, cPassWor ::InetSendAll( ::SocketCon, cRequest ) cResp := "" IF ::ReadHTTPProxyResponse( nTimeOut, @cResp ) - nFirstSpace := At( " ", cResp ) - IF nFirstSpace != 0 - sResponseCode := Right( cResp, Len( cResp ) - nFirstSpace ) - nResponseCode := Val( sResponseCode ) - IF nResponseCode != 200 - ::close() - lRet := .F. - ENDIF + tmp := At( " ", cResp ) + IF tmp > 0 .AND. Val( SubStr( cResp, tmp + 1 ) ) == 200 + lRet := .T. ENDIF - ELSE + ENDIF + IF ! lRet ::close() - lRet := .F. ENDIF ELSE cResp := hb_ntos( tmp )