mIRC Homepage
Posted By: Rixxon Socket bug? - 13/05/05 03:12 AM
Code:
alias modtest {
  sockclose modtest
  sockopen modtest www.weebl00.nl 80
}

on *:sockopen:modtest:{
  sockwrite -n $sockname GET /rixxon/modules/modules.txt HTTP/1.1
  sockwrite -n $sockname Host: www.weebl00.nl
  sockwrite -n $sockname
}

on *:sockread:modtest:{
  set -l %read
  sockread %read
  echo -s . %read
}


Yes, the code is not perfect, but it is just an example of what I think is a bug. Test the script (/modtest) and it echos the HTTP headers and the first line of the text document. Not the last line. First I had only one line and then I got only the headers.

I solved the problem by reading to a &binvar and bwrite it to a file, and read it on sockclose.

I think maybe mIRC isn't reading the line breaks correctly when reading to a %variable. /sockread -f doesn't solve the problem, though...

Or is something wrong with my code?
Posted By: Hammer Re: Socket bug? - 13/05/05 03:37 AM
Code:
on *:sockread:modtest:{
  var %read
  while 1 {
    sockread %read
    if (!$sockbr) return
    echo -si . %read
  }
}
© mIRC Discussion Forums