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.
This commit is contained in:
Viktor Szakats
2009-08-10 09:25:22 +00:00
parent ff6e21f3f5
commit 272b5e9512
8 changed files with 76 additions and 56 deletions

View File

@@ -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

View File

@@ -1,5 +0,0 @@
@rem
@rem $Id$
@rem
@"%~dp0hbmk2.exe" %*

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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-<nNr>.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()

View File

@@ -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