2015-03-13 18:56 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* contrib/hbwin/win_bmp.c
    ! fixed copy and past typo in my last modification - thanks to
      Juan Francolino for reporting the problem and to Alexander
      Czjczyński for locating the reason. It closes issue #91.

  * contrib/hbtip/smtpcli.prg
    * be sure that server answer after HELO command (:open() method) is
      fully consumed

  * contrib/hbtip/sendmail.prg
    ! removed redundant waiting for sever answer after opening connection
      without authentication - it fixes timeout delay in such case
    ! do not create TIPClientSMTP() object twice when it's not necessary
    % small code simplification
This commit is contained in:
Przemysław Czerpak
2015-03-13 18:56:10 +01:00
parent 58bc2c6f00
commit f090e652cd
4 changed files with 45 additions and 35 deletions

View File

@@ -10,6 +10,22 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2015-03-13 18:56 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbwin/win_bmp.c
! fixed copy and past typo in my last modification - thanks to
Juan Francolino for reporting the problem and to Alexander
Czjczyński for locating the reason. It closes issue #91.
* contrib/hbtip/smtpcli.prg
* be sure that server answer after HELO command (:open() method) is
fully consumed
* contrib/hbtip/sendmail.prg
! removed redundant waiting for sever answer after opening connection
without authentication - it fixes timeout delay in such case
! do not create TIPClientSMTP() object twice when it's not necessary
% small code simplification
2015-03-12 09:41 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbtip/sendmail.prg
! fixed wrong login conditions - AICS it's old problem which had existed

View File

@@ -94,7 +94,7 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ;
LOCAL oUrl1
LOCAL lAuthTLS := .F.
LOCAL lConnect := .T.
LOCAL lConnect := .F.
LOCAL oPop
/* consider any empty values invalid */
@@ -210,48 +210,33 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ;
oInmail:nConnTimeout := nTimeOut
IF ! lNoAuth .AND. oInMail:OpenSecure( , lSSL )
IF ! lNoAuth
IF oInMail:OpenSecure( , lSSL )
lAuthTLS := oInMail:lTLS
lAuthTLS := oInMail:lTLS
IF ! ( oInMail:lAuthLogin .AND. oInMail:Auth( cUser, cSMTPPass ) ) .AND. ;
! ( oInMail:lAuthPlain .AND. oInMail:AuthPlain( cUser, cSMTPPass ) )
lConnect := .F.
IF ( oInMail:lAuthLogin .AND. oInMail:Auth( cUser, cSMTPPass ) ) .OR. ;
( oInMail:lAuthPlain .AND. oInMail:AuthPlain( cUser, cSMTPPass ) )
lConnect := .T.
ENDIF
ENDIF
IF ! lConnect
oInMail:Close()
BEGIN SEQUENCE WITH __BreakBlock()
oInmail := TIPClientSMTP():New( oUrl, xTrace,, cClientHost )
RECOVER
RETURN .F.
END SEQUENCE
oInmail:nConnTimeout := nTimeOut
ENDIF
ELSE
lConnect := .F.
ENDIF
IF ! lConnect
IF ! lNoAuth
oInMail:Close()
ENDIF
BEGIN SEQUENCE WITH __BreakBlock()
oInmail := TIPClientSMTP():New( oUrl, xTrace,, cClientHost )
RECOVER
RETURN .F.
END SEQUENCE
oInmail:nConnTimeout := nTimeOut
IF ! oInMail:Open( NIL, lAuthTLS )
oInmail:Close()
RETURN .F.
ENDIF
DO WHILE .T.
IF ! oInMail:GetOk()
EXIT
ENDIF
IF oInMail:cReply == NIL
EXIT
ENDIF
IF hb_LeftEq( oInMail:cReply, "250 " )
EXIT
ENDIF
ENDDO
ENDIF
oInMail:oUrl:cUserid := tip_GetRawEmail( cFrom )

View File

@@ -104,6 +104,8 @@ METHOD New( oUrl, xTrace, oCredentials, cClientHost ) CLASS TIPClientSMTP
METHOD Open( cUrl, lSSL ) CLASS TIPClientSMTP
LOCAL lOk
IF ! ::super:Open( cUrl )
RETURN .F.
ENDIF
@@ -120,7 +122,14 @@ METHOD Open( cUrl, lSSL ) CLASS TIPClientSMTP
::inetSendAll( ::SocketCon, "HELO " + iif( Empty( ::cClientHost ), "TIPClientSMTP", ::cClientHost ) + ::cCRLF )
RETURN ::GetOk()
DO WHILE .T.
IF !( lOk := ::GetOk() ) .OR. ::cReply == NIL .OR. ;
hb_LeftEq( ::cReply, "250 " )
EXIT
ENDIF
ENDDO
RETURN lOk
METHOD OpenSecure( cUrl, lSSL ) CLASS TIPClientSMTP

View File

@@ -105,7 +105,7 @@ HB_FUNC( WIN_LOADBITMAPFILE )
[vszakats] */
if( nSize > 2 && nSize <= HB_MAX_BMP_SIZE )
{
char * pBuffer = ( char * ) hb_xgrab( nSize + 1 );
pBuffer = ( char * ) hb_xgrab( nSize + 1 );
if( hb_fileReadAt( pFile, pBuffer, nSize, 0 ) != nSize ||
hbwin_bitmapType( pBuffer, nSize ) == HB_WIN_BITMAP_UNKNOWN )