2012-11-08 16:02 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/hbmysql/tmysql.prg
  * contrib/hbnf/tests/test.prg
  * contrib/hbtip/cgi.prg
  * contrib/hbtip/tests/base64.prg
  * contrib/hbtip/tests/dbtohtml.prg
  * contrib/hbtip/tests/ftpadv.prg
  * contrib/hbtip/tests/httpadv.prg
  * contrib/hbtip/tests/tiptest.prg
  * contrib/hbtip/thtml.prg
  * contrib/rddads/tests/testmg.prg
  * extras/gfspell/spell.prg
  * extras/hbvpdf/hbvpdf.prg
  * extras/httpsrv/cgifunc.prg
  * extras/httpsrv/modules/tableservletdb.prg
  * extras/httpsrv/session.prg
  * extras/httpsrv/uhttpd.prg
  * utils/hbmk2/hbmk2.prg
    * minor cleanups

  * contrib/xhb/*.ch
    * formatted .ch files
    ! fixed SETLASTKEY() to be HB_SETLASTKEY() in xhb

  * contrib/hbtinymt/3rd/tinymt/tinymt.hbp
  - contrib/hbtinymt/3rd/tinymt/tinymt.hbx
    ! deleted .hbx file for 3rd lib and fixed not to generate it

  * extras/httpsrv/modules/tableservletdb.prg
    ! DEFAULT TO -> hb_default()
This commit is contained in:
Viktor Szakats
2012-11-08 15:06:50 +00:00
parent 3cba05eca5
commit 95ca642c65
34 changed files with 953 additions and 950 deletions

View File

@@ -343,11 +343,11 @@ FUNCTION uhttpd_URLEncode( cString, lComplete )
CASE ( cChar >= "A" .AND. cChar <= "Z" ) .OR. ;
( cChar >= "a" .AND. cChar <= "z" ) .OR. ;
( cChar >= "0" .AND. cChar <= "9" ) .OR. ;
cChar == '.' .OR. cChar == ',' .OR. cChar == '&' .OR. ;
cChar == '/' .OR. cChar == ';' .OR. cChar == '_'
cChar == "." .OR. cChar == "," .OR. cChar == "&" .OR. ;
cChar == "/" .OR. cChar == ";" .OR. cChar == "_"
cRet += cChar
CASE iif( ! lComplete, cChar == ':' .OR. cChar == '?' .OR. cChar == '=', .F. )
CASE iif( ! lComplete, cChar == ":" .OR. cChar == "?" .OR. cChar == "=", .F. )
cRet += cChar
OTHERWISE
@@ -482,7 +482,7 @@ FUNCTION uhttpd_OutputString( cString, aTranslate, lProtected )
LOCAL cHtml
__defaultNIL( @lProtected, .F. )
__defaultNIL( @aTranslate, { { '"', '&quot;' }, { ' ', '&nbsp;' } } )
__defaultNIL( @aTranslate, { { '"', "&quot;" }, { " ", "&nbsp;" } } )
// TraceLog( "OutputString( cString, aTranslate, lProtected )", cString, aTranslate, lProtected )
IF lProtected
@@ -497,9 +497,9 @@ FUNCTION uhttpd_OutputString( cString, aTranslate, lProtected )
FUNCTION uhttpd_HtmlSpecialChars( cString, cQuote_style )
LOCAL aTranslations := { ;
{ '&', '&amp;' }, ;
{ '<', '&lt;' }, ;
{ '>', '&gt;' } }
{ "&", "&amp;" }, ;
{ "<", "&lt;" }, ;
{ ">", "&gt;" } }
RETURN uhttpd_HtmlConvertChars( cString, cQuote_style, aTranslations )

View File

@@ -65,7 +65,7 @@ FUNCTION HRBMAIN()
hGets := _REQUEST
DEFAULT hGets TO { => }
hb_default( @hGets, { => } )
IF hb_HHasKey( hGets, "page" )
@@ -116,7 +116,7 @@ FUNCTION HRBMAIN()
uhttpd_SetHeader( "Content-Type", "text/xml" )
uhttpd_Write( '<?xml version="1.0" encoding="ISO-8859-1"?>' )
uhttpd_Write( '<pages><page>No Data</page></pages>' )
uhttpd_Write( "<pages><page>No Data</page></pages>" )
ENDIF
@@ -353,7 +353,7 @@ METHOD xmlEncode( input ) CLASS TableManager
FOR i := 1 TO Len( input )
c := SubStr( input, i, 1 )
SWITCH c
CASE '&'
CASE "&"
out += "&amp;"
EXIT
CASE "'"
@@ -362,14 +362,14 @@ METHOD xmlEncode( input ) CLASS TableManager
CASE '"'
out += "&quot;"
EXIT
CASE '<'
CASE "<"
out += "&lt;"
EXIT
CASE '>'
CASE ">"
out += "&gt;"
EXIT
#if 0
CASE ' '
CASE " "
out += "&nbsp;"
EXIT
#endif

View File

@@ -272,7 +272,7 @@ METHOD Start( cSID ) CLASS uhttpd_Session
// Should we define the SID?
IF lDefine_SID
cSID := ::cName + '=' + ::cSID
cSID := ::cName + "=" + ::cSID
_REQUEST[ ::cName ] := ::cSID
ENDIF
@@ -282,7 +282,7 @@ METHOD Start( cSID ) CLASS uhttpd_Session
// Start session
IF ! ::Open( ::cSavePath, ::cName )
uhttpd_Die( 'ERROR: Failed to open session file' )
uhttpd_Die( "ERROR: Failed to open session file" )
ENDIF
// Read session data
@@ -337,11 +337,11 @@ METHOD Close() CLASS uhttpd_Session
// Save session
IF ! ::Write( ::cSID, cVal )
uhttpd_Die( 'Session could not be saved.' )
uhttpd_Die( "Session could not be saved." )
ENDIF
// Close session
IF ! Eval( ::bClose )
uhttpd_Die( 'Session could not be closed.' )
uhttpd_Die( "Session could not be closed." )
ENDIF
::nActiveSessions--
@@ -826,7 +826,7 @@ METHOD Decode( cData ) CLASS uhttpd_Session
SWITCH ValType( xVal )
#if 0
CASE 'O'
CASE "O"
// TraceLog( "Decode - xVal - Object", xVal )
IF xVal:classname == "TASSOCIATIVEARRAY"
// TraceLog( "Decode - xVal - Object - TAssociativeArray - Keys", xVal:Keys )
@@ -838,7 +838,7 @@ METHOD Decode( cData ) CLASS uhttpd_Session
EXIT
#endif
CASE 'A' // Le variabili sono conservate come array { VarName, Value }
CASE "A" // Le variabili sono conservate come array { VarName, Value }
// TraceLog( "Decode - xVal - Array", xVal )
// ::oCGI:ToLogFile( "Decode - xVal - Array = " + hb_CStr( xVal ) + ", Len = " + hb_CStr( Len( xVal ) ), "/pointtoit/tmp/log.txt" )
FOR EACH aElem IN xVal
@@ -861,24 +861,24 @@ METHOD SendCacheLimiter() CLASS uhttpd_Session
LOCAL dDate
DO CASE
CASE ::cCache_Limiter == 'nocache'
// uhttpd_SetHeader( 'Expires', 'Thu, 19 Nov 1981 08:52:00 GMT' )
uhttpd_SetHeader( 'Expires', uhttpd_DateToGMT( ,, -1, ) )
uhttpd_SetHeader( 'Cache-Control', 'no-cache' )
// uhttpd_SetHeader("Cache-Control", "no-store, no-cache, must-revalidate") // HTTP/1.1
// uhttpd_SetHeader("Cache-Control", "post-check=0, pre-check=0", .F. )
uhttpd_SetHeader( 'Pragma', 'no-cache' )
CASE ::cCache_Limiter == 'private'
uhttpd_SetHeader( 'Expires', 'Thu, 19 Nov 1981 08:52:00 GMT' )
uhttpd_SetHeader( 'Cache-Control', 'private, max-age=' + hb_ntos( ::nCache_Expire * 60 ) )
CASE ::cCache_Limiter == "nocache"
// uhttpd_SetHeader( "Expires", "Thu, 19 Nov 1981 08:52:00 GMT" )
uhttpd_SetHeader( "Expires", uhttpd_DateToGMT( ,, -1, ) )
uhttpd_SetHeader( "Cache-Control", "no-cache" )
// uhttpd_SetHeader( "Cache-Control", "no-store, no-cache, must-revalidate" ) // HTTP/1.1
// uhttpd_SetHeader( "Cache-Control", "post-check=0, pre-check=0", .F. )
uhttpd_SetHeader( "Pragma", "no-cache" )
CASE ::cCache_Limiter == "private"
uhttpd_SetHeader( "Expires", "Thu, 19 Nov 1981 08:52:00 GMT" )
uhttpd_SetHeader( "Cache-Control", "private, max-age=" + hb_ntos( ::nCache_Expire * 60 ) )
IF hb_FGetDateTime( hb_argv( 0 ), @dDate )
uhttpd_SetHeader( 'Last-Modified', uhttpd_DateToGMT( dDate ) )
uhttpd_SetHeader( "Last-Modified", uhttpd_DateToGMT( dDate ) )
ENDIF
CASE ::cCache_Limiter == 'public'
uhttpd_SetHeader( 'Expires', uhttpd_DateToGMT( ,,, ::nCache_Expire * 60 ) )
uhttpd_SetHeader( 'Cache-Control', 'public, max-age=' + hb_ntos( ::nCache_Expire * 60 ) )
CASE ::cCache_Limiter == "public"
uhttpd_SetHeader( "Expires", uhttpd_DateToGMT( ,,, ::nCache_Expire * 60 ) )
uhttpd_SetHeader( "Cache-Control", "public, max-age=" + hb_ntos( ::nCache_Expire * 60 ) )
IF hb_FGetDateTime( hb_argv( 0 ), @dDate )
uhttpd_SetHeader( 'Last-Modified', uhttpd_DateToGMT( dDate ) )
uhttpd_SetHeader( "Last-Modified", uhttpd_DateToGMT( dDate ) )
ENDIF
OTHERWISE
uhttpd_Die( "ERROR: Caching method " + ::cCache_Limiter + " not implemented." )

View File

@@ -1239,7 +1239,7 @@ STATIC FUNCTION ParseRequest( cRequest )
// hb_toOutDebug( "GET: cFields = %s, hVars = %s, _GET = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _GET ), hb_ValToExp( _REQUEST ) )
// POST
IF "POST" $ Upper( _SERVER[ 'REQUEST_METHOD' ] )
IF "POST" $ Upper( _SERVER[ "REQUEST_METHOD" ] )
cFields := ATail( aRequest )
IF ! Empty( cFields )
hVars := uhttpd_GetVars( cFields )
@@ -1252,7 +1252,7 @@ STATIC FUNCTION ParseRequest( cRequest )
// hb_toOutDebug( "POST: cFields = %s, hVars = %s, _POST = %s, _REQUEST = %s\n\r", cFields, hb_ValToExp( hVars ), hb_ValToExp( _POST ), hb_ValToExp( _REQUEST ) )
// COOKIES
cFields := _SERVER[ 'HTTP_COOKIE' ]
cFields := _SERVER[ "HTTP_COOKIE" ]
IF ! Empty( cFields )
hVars := uhttpd_GetVars( cFields, ";" )
hb_HMerge( _COOKIE, hVars )
@@ -1450,7 +1450,7 @@ STATIC PROCEDURE WriteToLog( cRequest )
cAccess := _SERVER[ "REMOTE_ADDR" ] + " - - [" + Right( cDate, 2 ) + "/" + ;
aMonths[ Val( SubStr( cDate, 5, 2 ) ) ] + ;
"/" + Left( cDate, 4 ) + ":" + cTime + ' ' + cBias + '] "' + ;
"/" + Left( cDate, 4 ) + ":" + cTime + " " + cBias + '] "' + ;
Left( cRequest, At( CR_LF, cRequest ) - 1 ) + '" ' + ;
hb_ntos( t_nStatusCode ) + " " + iif( nSize == 0, "-", hb_ntos( nSize ) ) + ;
' "' + iif( Empty( cReferer ), "-", cReferer ) + '" "' + _SERVER[ "HTTP_USER_AGENT" ] + ;