2007-04-04 15:30 UTC+0200 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)

* harbour/contrib/pgsql/tpostgre.prg
    * removed unused vars
  * harbour/contrib/tip/cgi.prg
    * used new hb_serialize/hb_deserialize
    * removed unused vars
  * harbour/contrib/tip/ftpcln.prg
  * harbour/contrib/tip/httpcln.prg
  * harbour/contrib/tip/mail.prg
  * harbour/contrib/tip/popcln.prg
    * removed unused vars
This commit is contained in:
Lorenzo Fiorini
2007-04-04 13:29:56 +00:00
parent 343b680230
commit a8877c1fe9
7 changed files with 35 additions and 53 deletions

View File

@@ -8,6 +8,18 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-04-04 15:30 UTC+0200 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)
* harbour/contrib/pgsql/tpostgre.prg
* removed unused vars
* harbour/contrib/tip/cgi.prg
* used new hb_serialize/hb_deserialize
* removed unused vars
* harbour/contrib/tip/ftpcln.prg
* harbour/contrib/tip/httpcln.prg
* harbour/contrib/tip/mail.prg
* harbour/contrib/tip/popcln.prg
* removed unused vars
2007-04-04 12:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
! typos

View File

@@ -552,10 +552,7 @@ METHOD Refresh(lQuery,lMeta) CLASS TPQquery
Local aStruct := {}
Local aTemp := {}
Local i
Local n
Local temp
Local cQuery
Local cType, nType, nDec, nSize
Local cType, nDec, nSize
Default lQuery To .T.
Default lMeta To .T.
@@ -962,7 +959,6 @@ RETURN ! ::lError
METHOD FieldGet( nField, nRow ) CLASS TPQquery
Local result
Local i
Local cType
Local nSize
Local tmp
@@ -1093,7 +1089,6 @@ METHOD SetKey() CLASS TPQquery
Local i, x
Local nTableId, xTableId := -1
Local nCount := 0
Local cTable
Local res
Local nPos

View File

@@ -212,7 +212,7 @@ METHOD Flush() CLASS TIpCgi
local cSID := ::cSID
local cSession
hEval( ::hCookies, { |k,v,n| ::cCgiHeader += 'Set-Cookie: ' + k + '=' + v + ';' + _CRLF } )
hEval( ::hCookies, { |k,v| ::cCgiHeader += 'Set-Cookie: ' + k + '=' + v + ';' + _CRLF } )
cStream := ::cCgiHeader + _CRLF + ::cHtmlPage + _CRLF
@@ -250,6 +250,10 @@ METHOD DestroySession( cID ) CLASS TIpCgi
local cSID := ::cSID
local lRet
if !empty( cID )
cSID := cID
endif
if !empty( cSID )
::hSession := Hash()
@@ -423,38 +427,13 @@ METHOD StartSession() CLASS TIpCgi
METHOD SessionEncode() CLASS TIpCgi
local aSerial := {}
local cKey, xVal
for each cKey in ::hSession:Keys
xVal := ::hSession[ cKey ]
if xVal != nil
aAdd( aSerial, { cKey, xVal } )
endif
next
RETURN HB_Serialize( aSerial )
RETURN HB_Serialize( ::hSession )
METHOD SessionDecode( cData ) CLASS TIpCgi
local lRet := .t.
local cSerial := HB_DeserialBegin( cData )
local xVal, cKey, aElem
::hSession := HB_Deserialize( cData )
do while ( xVal := HB_DeserialNext( @cSerial ) ) != nil
switch ValType( xVal )
case 'A' // Vars are stored in array { VarName, Value }
for each aElem in xVal
::hSession[ aElem[1] ] := aElem[2]
next
exit
otherwise
lRet := .f.
exit
end
enddo
RETURN lRet
RETURN Valtype( ::hSession ) == "H"
STATIC FUNCTION HtmlTag( xVal, cKey )
@@ -478,7 +457,7 @@ STATIC FUNCTION HtmlAllTag( hTags, cSep )
DEFAULT cSep TO ' '
hEval( hTags, { |key,value,pos| cVal += HtmlTag( hTags, key ) + cSep } )
hEval( hTags, { |k,v,p| cVal += HtmlTag( hTags, k, v, p ) + cSep } )
return cVal
@@ -511,7 +490,7 @@ STATIC FUNCTION HtmlAllOption( hOptions, cSep )
DEFAULT cSep TO ' '
if !empty( hOptions )
hEval( hOptions, { |key,value,pos| cVal += HtmlOption( hOptions, key,,, .t. ) + cSep } )
hEval( hOptions, { |k| cVal += HtmlOption( hOptions, k,,, .t. ) + cSep } )
endif
return cVal
@@ -540,7 +519,7 @@ STATIC FUNCTION HtmlAllValue( hValues, cSep )
DEFAULT cSep TO ' '
if !empty( hValues )
hEval( hValues, { |key,value,pos| cVal += HtmlValue( hValues, key ) + cSep } )
hEval( hValues, { |k| cVal += HtmlValue( hValues, k ) + cSep } )
endif
return cVal

View File

@@ -344,8 +344,6 @@ RETURN NIL
METHOD Stor( cFile ) CLASS tIPClientFTP
LOCAL nTimeout
IF ::bUsePasv
IF .not. ::Pasv()
//::bUsePasv := .F.
@@ -463,8 +461,7 @@ METHOD Write( cData, nLen ) CLASS tIPClientFTP
RETURN ::super:Write( cData, nLen, .F. )
METHOD Retr( cFile,cLocalFile ) CLASS tIPClientFTP
LOCAL nTimeout,cRet
METHOD Retr( cFile ) CLASS tIPClientFTP
IF ::bUsePasv
IF .not. ::Pasv()
@@ -541,7 +538,7 @@ RETURN lRet
METHOD LS( cSpec ) CLASS tIPClientFTP
LOCAL cStr,cfile,x,y
LOCAL cStr
IF cSpec == nil
cSpec := ''
@@ -580,7 +577,6 @@ METHOD Rename( cFrom, cTo ) CLASS tIPClientFTP
Return lResult
METHOD DownLoadFile( cLocalFile, cRemoteFile ) CLASS tIPClientFTP
LOCAL cFileData
LOCAL lRet,xRet
Local nHandle

View File

@@ -51,6 +51,7 @@
*
*/
#include "common.ch"
#include "hbclass.ch"
#include "tip.ch"
@@ -92,7 +93,7 @@ HIDDEN:
ENDCLASS
METHOD New(lTrace) CLASS tIPClientHTTP
METHOD New() CLASS tIPClientHTTP
::nDefaultPort := 80
::nConnTimeout := 5000
::bChunked := .F.
@@ -219,7 +220,7 @@ RETURN .T.
METHOD ReadHeaders(lClear) CLASS tIPClientHTTP
LOCAL cLine, nPos, aVersion
LOCAL aHead, aCookie, cCookie
LOCAL aHead
// Now reads the fields and set the content lenght
cLine := ::InetRecvLine( ::SocketCon, @nPos, 500 )
@@ -376,9 +377,8 @@ METHOD ReadAll() CLASS tIPClientHTTP
METHOD setCookie(cLine) CLASS tIPClientHTTP
//docs from http://www.ietf.org/rfc/rfc2109.txt
local aParam,cParam
local cCookie,aCookies
local cHost,cPath,cName,cValue,hHost,hPath, aElements, cElement
local aParam
local cHost,cPath,cName,cValue,aElements, cElement
local cDefaultHost:=::oUrl:cServer, cDefaultPath:=::oUrl:cPath
local x,y
IF empty(cDefaultPath)
@@ -424,7 +424,7 @@ return NIL
METHOD getcookies(cHost,cPath) CLASS tIPClientHTTP
local x,y,aDomKeys:={},aKeys,z,cKey,aPathKeys,nPath
local a,b,cOut:='',cX,cY,c,d
local a,b,cOut:='',c,d
IF cHost=nil
cHost:=::oUrl:cServer
ENDIF

View File

@@ -51,6 +51,7 @@
*
*/
#include "common.ch"
#include "hbclass.ch"
CLASS TipMail
@@ -273,7 +274,6 @@ RETURN ::aAttachments[ ::nAttachPos ]
METHOD ToString() CLASS TipMail
LOCAL cBoundary, cElem, i
LOCAL oSubPart
LOCAL cRet := ""
// this is a multipart message; we need a boundary
IF Len( ::aAttachments ) > 0
@@ -513,4 +513,4 @@ METHOD MakeBoundary() CLASS TipMail
cBound += "_TIP_" + StrTran(Dtoc( Date() ),"/","") +;
"_" + StrTran(Time(), ":", "" )
RETURN cBound
RETURN cBound

View File

@@ -278,7 +278,7 @@ RETURN cRet
METHOD Retreive( nId, nLen ) CLASS tIPClientPOP
LOCAL nPos
LOCAL cStr, cRet, nRetLen, cBuffer, nRead
LOCAL cRet, nRetLen, cBuffer, nRead
LOCAL cEOM := ::cCRLF + "." + ::cCRLF // End Of Mail
IF .not. ::bInitialized