|
|
http::geturl: error reading socket: invalid argument...
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: http::geturl: error reading socket: invalid argument... - comp ...Hex to ascii - comp.lang.asm.x86... 17:46:18 GMT, Robert Redelmeier <redelm@ev1.net.invalid ... Your argument would have more power in ALA, but here one ... with hex ... Why a invalid keystore format exception? - comp.lang.java.security ...I found an usefull example here http ... file copy: invalid argument - comp.lang.tcl ... java.security... pfx file being read into using java KeyStore ... "Invalid ... Sockets in gfortran? - comp.lang.fortranhttp::geturl: error reading socket: invalid argument... - comp ... Sockets in gfortran? - comp.lang.fortran * Used SOCKET_ERROR and INVALID_SOCKET to test for errors ... Ping from C tutorial, problem - comp.compilers.lccFrom the MSDN docs I read gather that getnameinfo ... NULL ); if (rc == SOCKET_ERROR ... recvol; SOCKET s=INVALID_SOCKET; char ... Bad File Descriptor - comp.protocols.time.ntp... having "ntpd[11911]: sendto(x.x.x.x): Invalid argument ... opened, but still are reported a lot of "Invalid Socket ... read() error - Bad Address - comp.unix.programmer The ... is closing an opened file required before unlinking it? - comp ...http::geturl: error reading socket: invalid argument... - comp ... is closing an opened file required before unlinking it? - comp ... case 1) file has been opened for ... Interface IP address Change. - comp.protocols.time.ntp... quite some time the routing socket interface. This interface allows to read ... NTP Public Services Project - http ... sendto() starts failing with "Invalid arguments" error. Lost Memory in RAM card - comp.sys.hp48... About memory chips and card socket shorts: http://groups ... try them all on Emu48 first, or read any docs first: http ... during transfer and gave an Invalid error ... Something bad happened to my gfortran installation - comp.lang ...... inquiry where each designator or function argument is ... divide-by-zero, denormal operation, and invalid ... read() error - Bad Address - comp.unix.programmer... easy ... Hex to ascii - comp.lang.asm.x86... 17:46:18 GMT, Robert Redelmeier <redelm@ev1.net.invalid ... Your argument would have more power in ALA, but here one ... For post-processing/reading the output you can write ... http::geturl: error reading socket: invalid argument... - comp ...Hex to ascii - comp.lang.asm.x86... 17:46:18 GMT, Robert Redelmeier <redelm@ev1.net.invalid ... Your argument would have more power in ALA, but here one ... with hex ... Tcl Reference Manual: http - TMML: Introductionset data [read $socket 1000] set ... gets three additional arguments: the token from ::http::geturl, the ... Another error possibility is that ::http::geturl is unable to write ... 7/24/2012 6:44:36 PM
|
|
|
|
|
|
|
|
|