mIRC Home    About    Download    Register    News    Help

Print Thread
Sockread Bug #174517 09/04/07 01:54 AM
Joined: Mar 2007
Posts: 60
S
Spitfire3292 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Mar 2007
Posts: 60
When I socket to http://runehead.com/feeds/lowtech/searchuser.php?user=Zezima

Replace Zezima with any user in Runescape if you would like (That's besides the point)

The source code displays this

Quote:
@@start
The Forgotten Legion|http://www.theforgottenlegion.co.nr
Slayers of Chaos|http://z6.invisionfree.com/The_Slayers_of_Chaos/
Anzacs MB Pking Team|http://z6.invisionfree.com/Anzacs/index.php?act=idx
World 3|http://runescape.com
Links|
The Holy Kingdom|http://www.NoneATM.com
gloryofpures|http://z4.invisionfree.com/gloryofpures
@@end


But the interesting thing about when I echo the sockread using a variable. I get this.

Quote:
HTTP/1.1 200 OK
Date: Mon, 09 Apr 2007 01:47:29 GMT
Server: Apache/2.2.3 (Unix)
X-Powered-By: PHP/5.2.0
Content-Length: 338
Connection: close
Content-Type: text/html
@@start
The Forgotten Legion|http://www.theforgottenlegion.co.nr
Slayers of Chaos|http://z6.invisionfree.com/The_Slayers_of_Chaos/
Anzacs MB Pking Team|http://z6.invisionfree.com/Anzacs/index.php?act=idx
World 3|http://runescape.com
Links|
The Holy Kingdom|http://www.NoneATM.com
gloryofpures|http://z4.invisionfree.com/gloryofpures


Notice how there isn't an @@end. This isn't the case when I use bvars. When I use bvars I get this.

Quote:
HTTP/1.1 200 OK
Date: Mon, 09 Apr 2007 01:49:21 GMT
Server: Apache/2.2.3 (Unix)
X-Powered-By: PHP/5.2.0
Content-Length: 338
Connection: close
Content-Type: text/html

@@start
The Forgotten Legion|http://www.theforgottenlegion.co.nr
Slayers of Chaos|http://z6.invisionfree.com/The_Slayers_of_Chaos/
Anzacs MB Pking Team|http://z6.invisionfree.com/Anzacs/index.php?act=idx
World 3|http://runescape.com
Links|
The Holy Kingdom|http://www.NoneATM.com
gloryofpures|http://z4.invisionfree.com/gloryofpures
@@end


Notice how @@end is now there. My friend had a similar problem with another website which I do not know the name of right now and said bvars fixed it, and sure enough it did. I know this is a problem with mIRC because 1) It works with bvars and 2) HTTP Sniffer picks it up.

My friend said this might be the reason of the bug:
Quote:
<Marius> mIRC cuts out the last line, it's because it closes the socket too soon, thinking the document is empty because the document data is read as part of the document, thus making it fail to read the last line
<Marius> this is the case when reading ANY website or ducoment through mIRC sockets.


Thanks for taking the time to read this.

-Andrew N. (Spitfire3292)


"In order to succeed, your desire for success should be greater than your fear of failure."
Re: Sockread Bug [Re: Spitfire3292] #174520 09/04/07 03:17 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I'll bet $1000 this isn't a bug but is instead due to that website's output not ending with a $crlf and your socket code not using /sockread -f to force the last line to be read.

See this post for a practical example of what you need to be doing to get the whole webpage.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: Sockread Bug [Re: Spitfire3292] #174521 09/04/07 03:28 AM
Joined: Mar 2007
Posts: 60
S
Spitfire3292 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Mar 2007
Posts: 60
Hehe thanks. I forgot about the -f trigger smile Wonderful Jaytea reminded me of it after I bugged the living hell out of him with highlights and memo's for a solution to this problem. Thanks star and Jaytea :P

As far as I'm concerned, Case Closed:


"In order to succeed, your desire for success should be greater than your fear of failure."