From e92edfa2a4eb257d717fc49e33374a18df16f1bd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 30 Jul 2012 14:08:36 +0000 Subject: [PATCH] 2012-07-30 16:06 UTC+0200 Viktor Szakats (harbour syenar.net) + contrib/hbtip/tests/test01.prg * contrib/hbtip/httpcli.prg ! RTE was happening in class TIPClientHTTP when calling method post() after calling method setCookie(): Error BASE/1123 Argument error: HB_HKEYAT Called from HB_HKEYAT(0) Called from TIPCLIENTHTTP:GETCOOKIES(0) This error happens because in r7888 (changelog: 2007-10-30 19:45 UTC+0100 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)) the function HGetKeys() was replaced by HB_HKeyAt() and the correct is HB_HKeys(). ; Report, patch and description by Raphael Gozzo. Thank you. --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/hbtip/httpcli.prg | 2 +- harbour/contrib/hbtip/tests/test01.prg | 26 ++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 harbour/contrib/hbtip/tests/test01.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3cf384b1d0..cec23d9cfa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,17 @@ The license applies to all entries newer than 2009-04-28. */ +2012-07-30 16:06 UTC+0200 Viktor Szakats (harbour syenar.net) + + contrib/hbtip/tests/test01.prg + * contrib/hbtip/httpcli.prg + ! RTE was happening in class TIPClientHTTP when calling method post() after calling method setCookie(): + Error BASE/1123 Argument error: HB_HKEYAT + Called from HB_HKEYAT(0) + Called from TIPCLIENTHTTP:GETCOOKIES(0) + This error happens because in r7888 (changelog: 2007-10-30 19:45 UTC+0100 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)) + the function HGetKeys() was replaced by HB_HKeyAt() and the correct is HB_HKeys(). + ; Report, patch and description by Raphael Gozzo. Thank you. + 2012-07-30 12:47 UTC+0200 Viktor Szakats (harbour syenar.net) * ChangeLog ! typo in prev ChangeLog example diff --git a/harbour/contrib/hbtip/httpcli.prg b/harbour/contrib/hbtip/httpcli.prg index 0f89f23ef9..a6a6dc7881 100644 --- a/harbour/contrib/hbtip/httpcli.prg +++ b/harbour/contrib/hbtip/httpcli.prg @@ -455,7 +455,7 @@ METHOD getcookies( cHost, cPath ) CLASS tIPClientHTTP ASort( aPathKeys,,, {| cX, cY | Len( cX ) > Len( cY ) } ) b := Len( aPathKeys ) FOR a := 1 TO b - aKeys := hb_Hkeyat( ::hCookies[ aDomKeys[ x ] ] [ aPathKeys[ a ] ] ) + aKeys := hb_Hkeys( ::hCookies[ aDomKeys[ x ] ][ aPathKeys[ a ] ] ) d := Len( aKeys ) FOR c := 1 TO d IF ! Empty( cOut ) diff --git a/harbour/contrib/hbtip/tests/test01.prg b/harbour/contrib/hbtip/tests/test01.prg new file mode 100644 index 0000000000..b58017f13a --- /dev/null +++ b/harbour/contrib/hbtip/tests/test01.prg @@ -0,0 +1,26 @@ +/* + * $Id$ + */ + +PROCEDURE Main() + + LOCAL oHttp + + CLS + + oHttp := TIPClientHTTP():New( "http://www.google.com", .T. ) + + oHttp:setCookie( "test01=value01" ) + + IF ! oHttp:open() + ? "Error: oHttp:open(): " + oHttp:lastErrorMessage() + RETURN + ENDIF + + IF ! oHttp:post( "test" ) + ? "Error: oHttp:post(): " + oHttp:lastErrorMessage() + ENDIF + + oHttp:close() + + RETURN