This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

over*

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

over*

Post by caesar »

Code: Select all

package require http 

bind pub - !radio pub:radio

proc pub:radio {nick handle host chan text } { 
set mydata "$chan" 
set token [::http::geturl "http://something.com/" -command [list mycallback "$mydata"]] 
}

proc mycallback {mydata token} { 
  set data [::http::data $token] 
  foreach z [split $data \n] { 
    putserv "PRIVMSG $mydata :$z" 
  } 
}

putlog "radio.tcl loaded"
With it he says in the channel the html code of that page. After he finishes sits a bit and the he starts pasting stuff don't know from where he colects them, I've also noticed a warning on party line: !!! OVER MAXIMUM SERVER QUEUE. What to change/add to make it stop doing this? Also, how to read from a web page like this: http://something.com:8000/? I've tryed the it and nothing. I even tryed a closed port and was working, got a error with a notice that port is closed.

Oh, and the junk he pastes on the channel after finishin the html code sound like this:
“²W‰IÍ ÿ4û§ûÅx_¾„ñ4Þ¦”Óá9_„u…§ÿåa<ÿ§ÞS'‰Hÿ°ŸþœxO)§,' @‹âr!Žu`‹ùóçú]]aÛÿý¬ºCÂBŠ0<‹OÛF°™:¼B@ÃBÕé÷'‰õ=ÜÔ¶^f‰ÅCÅ–wJô<ë’ñ.þœïZR*Vž¹â*¶¬«Oõ+›øQ)$Jb%>wýåJSX›Tÿ[ôÄ}æÖ‰ég”9¸„ø'(
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Too be honest, the only reasonw hy such data would be posted, is if the http server is sending it.

As for reaching the max queue size, it is because the script is continualy sending to the queue, lots of junk like you posted.

From what I can see, you are tapping into the actual music source, causing junk like so to be streamed.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

you might consider using the -blocksize option on the ::http::geturl command...
and also it's always a good idea to do the ::http::cleanup
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

On that server is running an Apache web server on the 8080 port and an shoutcast radio server on 8000. I'm reading and getting that junk from the apache server, when I try the shoutcast server is not working due an unknows reason..
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The cleanup idea is very important.

After a complete request, the collected deta remains in memory, until you remove it, using the ::http::cleanup command.

THis means lots of wasted memory each time.

However, I suspect both the blocksize option, and cleaningup, will help such issues.

If an existing http request/data download has taken place, the http package, will not reuse the token. Meaning it can't be a clash of data (though the memory issue is still there, without a cleanup).

As for blocksize, this is used to state how much buffering takes place, and how manhy byte are read per filevent. If there is less than X bytes in the buffer when reading, then only read the buffer length. There is no penalty, and no errornous data return up to X bytes.

All issues point towards the URL you are downloading from, sending some sort of music feed, which you did not request. I sugest looking at the URL you are trying to obtain from youself.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, the normal apache web page is at: http://something.com/ and the radio page is at http://something.com:8000/ and I'm reading the normal page not the radio one..
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Too be perfectly honest, I was going to test it, using a slightly modified version of your own script, but without a real URL like the one yours if failing on, I can't help more.

With no cleanup code, and using exactly the same as you (however, only printing the size of the text, and random portions of it), I had no errornous output, even when processing 7 URL's at the same time.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've added the cleanup thing and also a msg to channel:

Code: Select all

::http::cleanup
putserv "PRIVMSG $chan :Cleanup and reading complete"
and he finishes to read/paste the html page and dosen't show the "Cleanup and reading complete" msg.
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is because the queue is full.

Once the queue is full, it will not buffer any more. Otherwise there would be no point, in it being full.

You need to state which HTTP token you have finished with, when using ::http::cleanup.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

What you mean? I've put thouse two lines at the end of the 'foreach' and seems that it dosen't end or something like this.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

::http::cleanup
should be
::http::cleanup $token

as for your loop not returning... what better evidence do you need that the proc keeps recieving data ;)
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

yes, I've used ::http::cleanup $token.. I'm asking for a way to stop it getting that junk from the server.. the html code is pasted corectly then starts spreading junk in the channel..
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Then it can only be what it coming in over the HTTP stream.

As noted, using your code, with slight adjustments, so my screen can't get flooded, these is ntohing wrong.

TCP connections can't bleed into each other, as it's the OS that deals with seperation.

Thus leaving only the possibility, that the data comming is, is meant to be coming in via that URL.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

To be honest I haven't understood a damn thing about this *problem*.. I've tryed http://something.com/ to listen with winamp like I do for the radio and is not working, this means that somewhere is a *leek* of info.. Something is weird round here. I'll take a deeper look at the server, the tcl code and thru the forum and search for other alternatives for this radio thing..
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It's as if we are talking about two seperate tpoic here.

OK, this is what you have said sao far.

----

You have the code above.

WHen it is used, the HTML is output, then it starts spitting out junk.

When you use winamp, it doesn't work.

This can only mean 1 thing.

That there is HTML and some sort of binary feed being passed down the line in one go.

The HTML is interfeering with winamp, when it tried to play the stream.

Can you explain your problems properly if this is not the case.
Locked