Re: openssl from tcl
- From: vitick@xxxxxxxxx
- Date: Wed, 9 Apr 2008 07:51:25 -0700 (PDT)
I have finally gotten back to the TLS code and there is definitely
some kind of a race condition problem where often you would get lots
of empty data in the beginning of the request. I have spent some time
figuring a way out of it and the only way I could deal with it is to
retry "gets sock" after each empty data until I get some good data. I
don't like that solution at all because it might last indefinitely, so
I had to set up a counter and stop after
some number of [gets sock]. The counter has not exceeded 500 so far
but you never know.
So, basically, I cannot use the following code:
while {[gets $sock data] >= 0} {...} -- which is the code used most of
the time in examples on how to get the request data from the client.
I instead ended up using something like this:
set counter 0
while {![eof $sock]} {
incr counter
if {$counter >= 1000} {break}
gets $sock data
if {$data == ""} {
continue
}
....
process the data
....
}
I hope this will get fixed, because timing out is not a good solution
(not happen yet to me with the time out count set to 1000, but in some
cases it probably will happen). I want to read and process every
request correctly.
Of course, there is probably a better solution. That's where people
like Alex Ferrieux often come to the rescue. ;)
.
- Follow-Ups:
- Re: openssl from tcl
- From: Erik Leunissen
- Re: openssl from tcl
- From: Alexandre Ferrieux
- Re: openssl from tcl
- From: vitick
- Re: openssl from tcl
- References:
- Re: openssl from tcl
- From: vitick
- Re: openssl from tcl
- Prev by Date: Re: Hobb's Megawidgets
- Next by Date: Re: fconfigure
- Previous by thread: Re: openssl from tcl
- Next by thread: Re: openssl from tcl
- Index(es):
Relevant Pages
|