diff --git a/harbour/ChangeLog b/harbour/ChangeLog index da418d7342..045252411c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2010-11-24 15:42 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + ! Fixed typo causing not recognized -hbl (without parameter) + resetting option. Thanks to Mindaugas for the find. + + * contrib/hbhttpd/core.prg + ! Changed UErrorHandler() to not issue a BREAK, to avoid + new Harbour compiler behavior making it impossible + to close a PROCEDURE with RETURN. + + * contrib/hbhttpd/log.prg + * Reworked a little bit. + 2010-11-24 12:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) - contrib/rddbmcdx + contrib/rddbm diff --git a/harbour/contrib/hbhttpd/core.prg b/harbour/contrib/hbhttpd/core.prg index 94cfd7283c..ca7711b55a 100644 --- a/harbour/contrib/hbhttpd/core.prg +++ b/harbour/contrib/hbhttpd/core.prg @@ -344,7 +344,7 @@ STATIC FUNCTION ProcessRequest( oServer, hSocket, cBuffer ) t_aHeader := {} t_nStatusCode := 200 t_lSessionDestroy := .F. - BEGIN SEQUENCE WITH {|oErr| UErrorHandler( oErr, oServer ) } + BEGIN SEQUENCE WITH {|oErr| iif( UErrorHandler( oErr, oServer ), Break( oErr ), ) } Eval( bEval, cPath ) RECOVER USetStatusCode( 500 ) @@ -422,7 +422,7 @@ STATIC FUNCTION ProcessRequest( oServer, hSocket, cBuffer ) RETURN .F. ELSE /* not sessioned */ - BEGIN SEQUENCE WITH {|oErr| UErrorHandler( oErr, oServer ) } + BEGIN SEQUENCE WITH {|oErr| iif( UErrorHandler( oErr, oServer ), Break( oErr ), ) } Eval( bEval, cPath ) RECOVER USetStatusCode( 500 ) @@ -662,10 +662,10 @@ STATIC FUNCTION UErrorHandler( oErr, oServer ) NetErr( .T. ) RETURN .F. ENDIF - oServer:LogError( GetErrorDesc( oErr ) ) - BREAK( oErr ) -/* RETURN NIL */ + oServer:LogError( GetErrorDesc( oErr ) ) + + RETURN .T. STATIC FUNCTION GetErrorDesc( oErr ) diff --git a/harbour/contrib/hbhttpd/log.prg b/harbour/contrib/hbhttpd/log.prg index 3a60e51952..9b170e4d6d 100644 --- a/harbour/contrib/hbhttpd/log.prg +++ b/harbour/contrib/hbhttpd/log.prg @@ -59,50 +59,53 @@ CREATE CLASS UHttpdLog METHOD New( cFileName ) METHOD Add( cMsg ) METHOD Close() + METHOD IsOpen() PROTECTED: VAR cFileName - VAR fhnd + VAR fhnd INIT F_ERROR ENDCLASS METHOD New( cFileName ) CLASS UHttpdLog LOCAL cExt - IF ! hb_isString( cFileName ) - cFileName := "hbhttpd" - ENDIF + IF hb_isString( cFileName ) - IF Set( _SET_DEFEXTENSIONS ) - hb_FNameSplit( cFileName, NIL, NIL, @cExt ) - IF Empty( cExt ) - cFileName += ".log" + IF Set( _SET_DEFEXTENSIONS ) + hb_FNameSplit( cFileName, NIL, NIL, @cExt ) + IF Empty( cExt ) + cFileName += ".log" + ENDIF ENDIF - ENDIF - ::cFileName := cFileName + ::cFileName := cFileName + ENDIF RETURN Self +METHOD IsOpen() CLASS UHttpdLog + RETURN ::fhnd != F_ERROR + METHOD Add( cMsg ) CLASS UHttpdLog - IF Empty( ::fhnd ) .OR. ::fhnd == F_ERROR - ::fhnd := hb_FCreate( ::cFileName, FC_NORMAL, FO_WRITE + FO_DENYNONE ) - ELSE - FSeek( ::fhnd, 0, FS_END ) + IF ! hb_isString( cMsg ) + RETURN .F. ENDIF - RETURN ! Empty( ::fhnd ) .AND. ; - ::fhnd != F_ERROR .AND. ; - FWrite( ::fhnd, cMsg ) == Len( cMsg ) + IF ::fhnd == F_ERROR .AND. ! Empty( ::cFileName ) + ::fhnd := hb_FCreate( ::cFileName, FC_NORMAL, FO_WRITE + FO_DENYNONE ) + ENDIF + + RETURN ::fhnd != F_ERROR .AND. FWrite( ::fhnd, cMsg ) == Len( cMsg ) METHOD Close() CLASS UHttpdLog LOCAL lRetVal - IF ! Empty( ::fhnd ) .AND. ::fhnd != F_ERROR + IF ::fhnd != F_ERROR lRetVal := FClose( ::fhnd ) - ::fhnd := NIL + ::fhnd := F_ERROR ELSE lRetVal := .F. ENDIF diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5ec0fb43e6..2380698f73 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2278,7 +2278,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) hbmk[ _HBMK_cPO ] := PathMakeAbsolute( PathSepToSelf( SubStr( cParam, 5 ) ), FNameDirGet( aParam[ _PAR_cFileName ] ) ) - CASE Left( cParamL, 5 ) == "-hbl" + CASE Left( cParamL, 4 ) == "-hbl" hbmk[ _HBMK_cHBL ] := "" hbmk[ _HBMK_cHBLDir ] := ""