Hi,
> cKey = StringSha164( hb_sha1( cContext + MAGIC_KEY ) )
> static function StringSha164( cKey )
> local n
> local cVal, cNewKey := ""
> for n = 1 to len( cKey ) step 2
> cVal = SubStr( cKey, n, 2 )
> cNewKey += Chr( hb_HexToNum( cVal ) )
> next
> return hb_Base64Encode( cNewKey )
In Harbour hash functions like HB_SHA*() or HB_MD5*() accept
additional logical parameter which can be used to force
binary representation of hash result so above code can be
rewritten as:
cKey := hb_Base64Encode( hb_sha1( cContext + MAGIC_KEY, .t. ) )
best regards,
Przemek
Regards
Bacco
"Antonio Linares" <antonio....@gmail.com> pisze:
When I tested Mindaugas HTTP server from Chrome, Chrome wanted (required) *. png (I do not remember the name) file with a graphical icon to display it in head card. The server did not respond: "there is no file" or "file not exist" but "see other" and session "goes in raspberries".
Maybe there is something similar?
Regards,
Marek Horodyski
----------------------------------------------------------------
Najtansze auta w Internecie!
http://linkint.pl/f2a5a
I have : favicon.ico, in HTTP header :
----------------------------------------------
GET /favicon.ico HTTP/1.1
Host: 127.0.0.1:8002
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24
Accept-Encoding: gzip,deflate,sdch
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
------------------------------------------------
and answer is "See Other" :
------------------------------------------------
HTTP/1.1 303 See Other
Connection: keep-alive
Location: /app/login
Content-Type: text/html
Date: Thu, 19 May 201114:23:53 GMT
Content-Length: 48
<html><body><h1>303 See Other</h1></body></html>
------------------------------------------------
Regards,
Marek Horodyski
----------------------------------------------------------------------
Uczestniczki 36. Międzynarodowego Konkursu Miss Bikini na plaży.
Zobacz galerię >>> http://linkint.pl/f2a4a
On 2011.10.12 11:50, marek.h...@interia.pl wrote:
> When I tested Mindaugas HTTP server from Chrome, Chrome wanted (required) *. png (I do not remember the name) file with a graphical icon to display it in head card. The server did not respond: "there is no file" or "file not exist" but "see other" and session "goes in raspberries".
> Maybe there is something similar?
>
> I have : favicon.ico, in HTTP header :
> ----------------------------------------------
> GET /favicon.ico HTTP/1.1
> Host: 127.0.0.1:8002
> Connection: keep-alive
> Accept: */*
> User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24
> Accept-Encoding: gzip,deflate,sdch
> Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
> Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
> ------------------------------------------------
>
> and answer is "See Other" :
> ------------------------------------------------
> HTTP/1.1 303 See Other
> Connection: keep-alive
> Location: /app/login
> Content-Type: text/html
> Date: Thu, 19 May 201114:23:53 GMT
> Content-Length: 48
>
> <html><body><h1>303 See Other</h1></body></html>
> ------------------------------------------------
I do not remember the details, but as I see from the protocol log above,
the sample app was written to redirect to login page if user is not
logged in (or URL is not valid). So, the same happens for favicon.ico. I
guess you'll be able to find a way and fix sample code.
Antonio case is different. He put connection processing into main
thread, so, main thread cannot accept new connections.
Regards,
Mindaugas
On 2011.10.12 13:03, Antonio Linares wrote:
> Mindaugas, thanks for joining. After reading your post, could it be
> that we are loosing an income connection because we are not using MT ?
Yes.
Regards,
Mindaugas
I've noticed. IMHO Antonio should turn off "code for sesioned", but not MT.
By the way, is not better support sessinons ID on "Cookie: SESSID=" ?
For example establish : Cookie: SESSID=fc9c59934cd91e1524f51065a86eed42 // unique series for id session.
Regards,
Marek Horodyski
----------------------------------------------------------------
Twoj wlasny dom za 675 zl/m-c!
http://linkint.pl/f2a56