diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c7a97ab8bb..270fbf8279 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,30 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-10 11:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + - bin/hbmk.bat + - Deleted. Probably no one uses it. + + * contrib/hbtip/sendmail.prg + + Added pop3s support for lPopAuth option. + + * contrib/hbtip/client.prg + % TIPCLIENT() now uses INIT instead of manual initialization of + class vars. + * TIPCLIENT():NEW(): Protocol check made more robust. + + * source/vm/dynlibhb.c + + Enabled HB_HAS_DLFCN on darwin. Support is there, tested on + latest 10.5 Leopard. + + * config/global.cf + * Minor. + + * config/linux/sunpro.cf + * config/sunos/sunpro.cf + + Using 'suncc|sunCC' compiler executables. This makes HB_CCPATH + unnecessary. Thanks Przemek. + 2009-08-10 11:07 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbatomic.h % added architecture independent support for atomic operations and diff --git a/harbour/bin/hbmk.bat b/harbour/bin/hbmk.bat deleted file mode 100644 index 3e3d7c55fe..0000000000 --- a/harbour/bin/hbmk.bat +++ /dev/null @@ -1,5 +0,0 @@ -@rem -@rem $Id$ -@rem - -@"%~dp0hbmk2.exe" %* diff --git a/harbour/config/global.cf b/harbour/config/global.cf index aca8a6f754..1281b8f897 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -700,8 +700,8 @@ export HB_HOST_BIN_DIR # clear these options for an unambiguous Harbour enviornment export HARBOUR := -export CLIPPER := export HARBOURCMD := +export CLIPPER := export CLIPPERCMD := include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf diff --git a/harbour/config/linux/sunpro.cf b/harbour/config/linux/sunpro.cf index 387f310766..654ab0aff3 100644 --- a/harbour/config/linux/sunpro.cf +++ b/harbour/config/linux/sunpro.cf @@ -3,16 +3,16 @@ # ifeq ($(HB_BUILD_MODE),cpp) - HB_CMP := CC + HB_CMP := sunCC else - HB_CMP := cc + HB_CMP := suncc endif OBJ_EXT := .o LIB_PREF := lib LIB_EXT := .a -CC := $(HB_CCACHE) $(HB_CCPATH)$(HB_CCPREFIX)$(HB_CMP) +CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP) CC_IN := -c # NOTE: The ending space after -o is important, please preserve it. # Now solved with '$(subst x,x, )' expression. @@ -50,7 +50,7 @@ ifeq ($(HB_BUILD_DEBUG),yes) CFLAGS += -g endif -LD := $(HB_CCACHE) $(HB_CCPATH)$(HB_CCPREFIX)$(HB_CMP) +LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP) LD_OUT := -o$(subst x,x, ) # Add all libraries specified in LIBS. diff --git a/harbour/config/sunos/sunpro.cf b/harbour/config/sunos/sunpro.cf index 2d08a8b4fe..1cb2caaf52 100644 --- a/harbour/config/sunos/sunpro.cf +++ b/harbour/config/sunos/sunpro.cf @@ -3,16 +3,16 @@ # ifeq ($(HB_BUILD_MODE),cpp) - HB_CMP := CC + HB_CMP := sunCC else - HB_CMP := cc + HB_CMP := suncc endif OBJ_EXT := .o LIB_PREF := lib LIB_EXT := .a -CC := $(HB_CCACHE) $(HB_CCPATH)$(HB_CCPREFIX)$(HB_CMP) +CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP) CC_IN := -c # NOTE: The ending space after -o is important, please preserve it. # Now solved with '$(subst x,x, )' expression. @@ -60,7 +60,7 @@ ifeq ($(HB_BUILD_DEBUG),yes) CFLAGS += -g endif -LD := $(HB_CCACHE) $(HB_CCPATH)$(HB_CCPREFIX)$(HB_CMP) +LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP) LD_OUT := -o$(subst x,x, ) # Add all libraries specified in LIBS. diff --git a/harbour/contrib/hbtip/client.prg b/harbour/contrib/hbtip/client.prg index 0b8c69baef..0bff3e705d 100644 --- a/harbour/contrib/hbtip/client.prg +++ b/harbour/contrib/hbtip/client.prg @@ -93,45 +93,45 @@ CREATE CLASS tIPClient CLASSDATA bInitSocks INIT .F. CLASSDATA cCRLF INIT hb_inetCRLF() - VAR oUrl /* url to wich to connect */ - VAR oCredentials /* credential needed to access the service */ - VAR nStatus /* basic status */ + VAR oUrl /* url to wich to connect */ + VAR oCredentials /* credential needed to access the service */ + VAR nStatus INIT 0 /* basic status */ VAR SocketCon VAR bTrace VAR nDefaultRcvBuffSize VAR nDefaultSndBuffSize - VAR nLength /* Input stream length */ - VAR nRead /* Input stream data read by the app*/ - VAR nLastRead /* Last physical read amount */ + VAR nLength INIT -1 /* Input stream length */ + VAR nRead INIT 0 /* Input stream data read by the app*/ + VAR nLastRead INIT 0 /* Last physical read amount */ VAR nDefaultPort VAR nConnTimeout - VAR bInitialized + VAR bInitialized INIT .F. VAR cReply VAR nAccessMode - VAR nWrite - VAR nLastWrite + VAR nWrite INIT 0 + VAR nLastWrite INIT 0 - VAR bEof - VAR isOpen INIT .F. + VAR bEof INIT .F. + VAR isOpen INIT .F. VAR exGauge /* Gauge control; it can be a codeblock or a function pointer. */ - VAR lTLS INIT .F. + VAR lTLS INIT .F. #if defined( HAS_OPENSSL ) VAR ssl_ctx VAR ssl - VAR nSSLError INIT 0 + VAR nSSLError INIT 0 #endif VAR Cargo /* Data for proxy connection */ VAR cProxyHost - VAR nProxyPort INIT 0 + VAR nProxyPort INIT 0 VAR cProxyUser VAR cProxyPassword @@ -183,32 +183,21 @@ ENDCLASS METHOD New( oUrl, bTrace, oCredentials ) CLASS tIPClient LOCAL oErr - LOCAL cProtoAccepted := "ftp,http,pop,smtp" - IF ! ::bInitSocks - hb_inetInit() + LOCAL aProtoAccepted := { "ftp", "http", "pop", "smtp" } #if defined( HAS_OPENSSL ) - SSL_init() - RAND_seed( Time() + hb_username() + DToS( Date() ) + hb_DirBase() + NetName() ) + LOCAL aProtoAcceptedSSL := { "ftps", "https", "pop3s", "pop3", "smtps" } +#else + LOCAL aProtoAcceptedSSL := {} #endif - ::bInitSocks := .T. - ENDIF IF ISCHARACTER( oUrl ) oUrl := tUrl():New( oUrl ) ENDIF -#if defined( HAS_OPENSSL ) - IF oURL:cProto == "ftps" .OR. ; - oURL:cProto == "https" .OR. ; - oURL:cProto == "pop3s" .OR. oURL:cProto == "pops" .OR. ; - oURL:cProto == "smtps" - ::EnableTLS( .T. ) - ENDIF - cProtoAccepted += "," + "ftps,https,pop3s,pops,smtps" -#endif + IF AScan( aProtoAccepted , {| tmp | tmp == oURL:cProto } ) == 0 .AND. ; + AScan( aProtoAcceptedSSL, {| tmp | tmp == oURL:cProto } ) == 0 - IF ! oURL:cProto $ cProtoAccepted oErr := ErrorNew() oErr:Args := { Self, oURL:cProto } oErr:CanDefault := .F. @@ -223,16 +212,26 @@ METHOD New( oUrl, bTrace, oCredentials ) CLASS tIPClient Eval( ErrorBlock(), oErr ) ENDIF + IF ! ::bInitSocks + hb_inetInit() +#if defined( HAS_OPENSSL ) + SSL_init() + RAND_seed( Time() + hb_username() + DToS( Date() ) + hb_DirBase() + NetName() ) +#endif + ::bInitSocks := .T. + ENDIF + +#if defined( HAS_OPENSSL ) + IF oURL:cProto == "ftps" .OR. ; + oURL:cProto == "https" .OR. ; + oURL:cProto == "pop3s" .OR. oURL:cProto == "pops" .OR. ; + oURL:cProto == "smtps" + ::EnableTLS( .T. ) + ENDIF +#endif + ::oUrl := oUrl ::oCredentials := oCredentials - ::nStatus := 0 - ::bInitialized := .F. - ::nWrite := 0 - ::nLastWrite := 0 - ::nLength := -1 - ::nRead := 0 - ::nLastRead := 0 - ::bEof := .F. ::bTrace := bTrace RETURN self diff --git a/harbour/contrib/hbtip/sendmail.prg b/harbour/contrib/hbtip/sendmail.prg index 09d450bbcb..a474ea709d 100644 --- a/harbour/contrib/hbtip/sendmail.prg +++ b/harbour/contrib/hbtip/sendmail.prg @@ -68,11 +68,12 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF aFiles -> Optional. Array of attachments to the email to send cUser -> Required. User name for the POP3 server cPass -> Required. Password for cUser - cPopServer -> Required. Pop3 server name or address + cPopServer -> Required. POP3 server name or address nPriority -> Optional. Email priority: 1=High, 3=Normal (Standard), 5=Low lRead -> Optional. If set to .T., a confirmation request is send. Standard setting is .F. bTrace -> Optional. If set to .T., a log file is created (smtp-.log). Standard setting is NIL. If a block is passed, it will be called for each log event with the message a string, no param on session close. + lPopAuth -> Optional. Do POP3 authentication before sending mail. lNoAuth -> Optional. Disable Autentication methods nTimeOut -> Optional. Number os ms to wait default 20000 (20s) cReplyTo -> Optional. @@ -196,7 +197,7 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF IF cPopServer != NIL .AND. lPopAuth BEGIN SEQUENCE - oUrl1 := tUrl():New( "pop://" + cUser + ":" + cPass + "@" + cPopServer + "/" ) + oUrl1 := tUrl():New( iif( lTLS, "pop3s://" , "pop://" ) + cUser + ":" + cPass + "@" + cPopServer + "/" ) oUrl1:cUserid := StrTran( cUser, "&at;", "@" ) opop:= tIPClientPOP():New( oUrl1, bTrace ) IF oPop:Open() diff --git a/harbour/source/vm/dynlibhb.c b/harbour/source/vm/dynlibhb.c index 57e21df0ce..403b5cff19 100644 --- a/harbour/source/vm/dynlibhb.c +++ b/harbour/source/vm/dynlibhb.c @@ -66,7 +66,8 @@ #if !defined( HB_HAS_DLFCN ) && \ ( ( defined( HB_OS_LINUX ) && !defined( __WATCOMC__ ) ) || \ - defined( HB_OS_SUNOS ) ) + defined( HB_OS_SUNOS ) || \ + defined( HB_OS_DARWIN ) ) # define HB_HAS_DLFCN #endif