http::geturl: error reading socket: invalid argument...

  • Follow


Hi all,

I am trying the following:

package require http
set url 
{http://aplaceintheauvergne.blogspot.com/2008/12/place-in-auvergne-tuesday-16th-december.html}
set timeout 10000
set fd [open temp_filename.txt w]
set token [::http::geturl $url -binary 1 -channel $fd -strict 0\
                    -protocol 1.0 -timeout $timeout]

 > error reading "sock584": invalid argument

Any idea why? It seems that part of the data is written to the file,
and then this error occurs.
This used to work with 8.5 (with -protocol 1.0, as I remember getting 
part of the data if the protocol version is not specified), but now I 
get an error with 8.6 (ActiveTcl 8.6.b1.1).


George
0
Reply Georgios 1/8/2010 7:48:04 PM

On Jan 8, 8:48=A0pm, Georgios Petasis <peta...@iit.demokritos.gr> wrote:
> Hi all,
>
> I am trying the following:
>
> package require http
> set url
> {http://aplaceintheauvergne.blogspot.com/2008/12/place-in-auvergne-tue...=
}
> set timeout 10000
> set fd [open temp_filename.txt w]
> set token [::http::geturl $url -binary 1 -channel $fd -strict 0\
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -protocol 1.0 -timeout $timeout]
>
> =A0> error reading "sock584": invalid argument
>
> Any idea why? It seems that part of the data is written to the file,
> and then this error occurs.
> This used to work with 8.5 (with -protocol 1.0, as I remember getting
> part of the data if the protocol version is not specified), but now I
> get an error with 8.6 (ActiveTcl 8.6.b1.1).

What does the read()/recv() syscall get as errno ? (use strace to
check)

-Alex

0
Reply Alexandre 1/8/2010 10:28:04 PM


Georgios Petasis <petasis@iit.demokritos.gr> writes:

>Hi all,
>
>I am trying the following:
>
>package require http
>set url
>{http://aplaceintheauvergne.blogspot.com/2008/12/place-in-auvergne-tuesday-16th-december.html}
>set timeout 10000
>set fd [open temp_filename.txt w]
>set token [::http::geturl $url -binary 1 -channel $fd -strict 0\
>                   -protocol 1.0 -timeout $timeout]
>
>> error reading "sock584": invalid argument
>
>Any idea why? It seems that part of the data is written to the file,
>and then this error occurs.
>This used to work with 8.5 (with -protocol 1.0, as I remember getting
>part of the data if the protocol version is not specified), but now I
>get an error with 8.6 (ActiveTcl 8.6.b1.1).
>
>
>George

Works fine when I use the current HEAD version on Linux. That is I can
see the file contains both <html> and </html>. The data is provided as
gzip compressed data with the content-length being that of the
compressed stream. We decompress that on the fly as we write it to the
channel. The only thing that occurs to me is that while you specified
-binary 1 to http::geturl you opened the output file in the default text
mode (and are working on Windows where it makes a difference). You
should probably use [open $tempfile wb]. 

However, this doesn't really help with the error you have there. I would
debug this by using 'sockspy' and configuring the http package to use
sockspy as a proxy so that I can see the traffic.

I've got http 2.8.2 here so maybe you are using an older version of the
http package. I don't know how old a version of tcl 8.6 is in the
ActiveState bundle there. You are likely to require at least 2.8.0 to be
able to handle gzip streams to a channel.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
0
Reply Pat 1/8/2010 11:50:40 PM

On Jan 8, 1:48 pm, Georgios Petasis <peta...@iit.demokritos.gr> wrote:
> Hi all,
>
> I am trying the following:
>
> package require http
> set url
> {http://aplaceintheauvergne.blogspot.com/2008/12/place-in-auvergne-tue...}
> set timeout 10000
> set fd [open temp_filename.txt w]
> set token [::http::geturl $url -binary 1 -channel $fd -strict 0\
>                     -protocol 1.0 -timeout $timeout]
>
>  > error reading "sock584": invalid argument
>
> Any idea why? It seems that part of the data is written to the file,
> and then this error occurs.
> This used to work with 8.5 (with -protocol 1.0, as I remember getting
> part of the data if the protocol version is not specified), but now I
> get an error with 8.6 (ActiveTcl 8.6.b1.1).
>
> George

When I browse to this link I get a redirect to another address maybe
this is the
problem.

Carl
0
Reply Bezoar 1/9/2010 12:02:54 AM

3 Replies
350 Views

(page loaded in 0.069 seconds)

Similiar Articles:













7/24/2012 6:44:36 PM


Reply: