All pastes #449264 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-20 03:16 UTC
rendered paste body
on *:SOCKOPEN:update: {
  sockwrite -nt $sockname GET /ian/pm/update.txt HTTP/1.1 
  sockwrite -nt $sockname Host: www.bootstraps.net
  sockwrite -nt $sockname $crlf 
  .timer 1 2 did -a update 8 [Updater] Connected, Downloading update.
}
on *:SOCKREAD:update: {
  if ($sockerr) {
    did -a update 8 [Fatal Error] Cannot read from site. Abort.
    sockclose $sockname
    halt
  }
  var %read
  sockread %read
  echo %read
  if (*$* iswm %read) {
    .timer 1 3 updatefile %read
    sockclose $sockname
    halt
  }
  .timer 1 3 did -a update 8 [Fatal Error] Insufficient ammount of data. 
  .timer 1 3 did -a update 8 Process halted.
  sockclose $sockname  
}