AOL Webserver - Help, read blocks when using openssl

This is Interesting: Free IT Magazines  
Home > Archive > AOL Webserver > December 2005 > Help, read blocks when using openssl





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Help, read blocks when using openssl
Ron Emerick

2005-12-24, 5:48 pm

I'm using AOLserver 3.5.9 to send an http request to a web server.
Using the code below, I send the request and then read the
response. My problem is that using openssl, the read blocks at
about 95% of the message. For example, the content (after the headers)
is about 35000 characters. The read will block at about 34,000 characters.
This only occurs using SSL not when I use ns_sockopen.

Any help would be appreciated.
Ron Emerick

Code snippet below.


# establish connection
set fds [ns_openssl_sockopen $host $port
set r [lindex $fds 0]
set w [lindex $fds 1]
# send request
puts $w "$httprequest\n\n"
flush $w
while {[set line [string trim [gets $r]]] != ""} {
lappend headers $line
}
#set content_len from http headers
set out [read $r $content_len]
close $r
close $w


Wojciech Kocjan

2005-12-24, 5:48 pm

Dnia 25-10-2005 o 22:23:51 Ron Emerick <rcemerick@AOL.COM> napisa=C5=82:
> # establish connection
> set fds [ns_openssl_sockopen $host $port
> set r [lindex $fds 0]
> set w [lindex $fds 1]
> # send request
> puts $w "$httprequest\n\n"
> flush $w
> while {[set line [string trim [gets $r]]] !=3D ""} {
> lappend headers $line
> }
> #set content_len from http headers


Just guessing here, but this is probably needed:
fconfigure $r -translation binary

> set out [read $r $content_len]
> close $r
> close $w


--=20
WK


Nathan Folkman

2005-12-24, 5:48 pm

Can you log some info about the socket:

fconfigure $fds

On Oct 25, 2005, at 4:23 PM, Ron Emerick wrote:

> I'm using AOLserver 3.5.9 to send an http request to a web server.
> Using the code below, I send the request and then read the
> response. My problem is that using openssl, the read blocks at
> about 95% of the message. For example, the content (after the headers)
> is about 35000 characters. The read will block at about 34,000
> characters.
> This only occurs using SSL not when I use ns_sockopen.
>
> Any help would be appreciated.
> Ron Emerick
>
> Code snippet below.
>
>
> # establish connection
> set fds [ns_openssl_sockopen $host $port
> set r [lindex $fds 0]
> set w [lindex $fds 1]
> # send request
> puts $w "$httprequest\n\n"
> flush $w
> while {[set line [string trim [gets $r]]] != ""} {
> lappend headers $line
> }
> #set content_len from http headers
> set out [read $r $content_len]
> close $r
> close $w
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <listserv@listserv.aol.com> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com