send(c,"GET /big.gif",0)

Started by
17 comments, last by zix99 19 years, 3 months ago
Quote:Original post by crazy_andy
cheers, like you said thats probably not the fix but I will try it anyway.


You can try HTTP Made Really Easy[http://www.jmarshall.com/easy/http/]
Patrick
Advertisement
cheers, I will read those, but I reallyt should study for my mock oracle exam tommorow, ah well.
www.stickskate.com -> check it out, some gnarly stick skating movies
cheers, both those links were pretty usefull.

My problem was that I wasn't accounting for the headers, I was reading the header, and no more. I've solved that now.

I succesfuly downloaded a 1.3mb pdf file.
however when I try to get a file on my website http://www.geocities.com/andrew_parlane2000/penguin.gif
I send:

GET /andrew_parlane2000/penguin.gif
HOST: www.geocities.com
Connection: close

I get no response. my recv times out after about 30 secconds, returning -1.
I know this file exists, and I got the url correct, because I copied it directly from IE. Even if it was wrong, It should have responded with http/1.1 404 File Not found.

This has happened with a few files. The servers arn't down, because I can get the files in IE.

I am not sure what I can do about it.
www.stickskate.com -> check it out, some gnarly stick skating movies
I'd guess especially geocities does a few checks for parameters as they try to have their bandwidth not leeched.

Try sniffing the exact get header that IE or Firefox or whatever sends, and use those.

I'm using the following header and it works for me:

GET http://www.geocities.com/andrew_parlane2000/penguin.gif HTTP/1.0
Connection: keep-alive

Might be the HTTP bit at the end.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

I sorted that out Im using http/1.1
I will try adding the keep alive header again.

www.stickskate.com -> check it out, some gnarly stick skating movies
Use /1.0

1.1 can do things that make writing the client a bit harder.
do all servers support 1.0,
What sort of disadvantage, would I get from using the older version?

edit: Ok, I just sent http/1.0
and it responded, with two different files, off two different sites:

http/1.1 200 OK

or basically the same as when I sent 1.1, at least I get a response though.

[Edited by - crazy_andy on January 9, 2005 7:00:54 PM]
www.stickskate.com -> check it out, some gnarly stick skating movies
OK, I havn't solved the problem yet, but here is aother question anyway?I try running this on a computer network, with a proxy, the connect statement times out. I think its the proxy, so does anyone know how I can connect through a proxy?
www.stickskate.com -> check it out, some gnarly stick skating movies
You have to connect to the computer with the proxy and then ask it for the webpage using the HOST: line.

It's been a while sense i've done this, but I'll take a shot. Let's say the proxy is on 192.168.0.5, port 80, and you want google:

connect 192.168.0.5:80
send-

GET / HTTP/1.1
Host: google.com
Connection: <whatever>

Then you will recieve the information from the proxy, rather than from the actual website. In other words, the proxy is middle-man. This is for HTTP proxy, I believe, not sure about SOCKS. If i'm wrong please go ahead in correct me, like i said, havent done this in a bit, but I hope i helped.

~zix~
---------------------------------------------------Game Programming Resources, Tutorials, and Multimedia | Free Skyboxes

This topic is closed to new replies.

Advertisement