mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 4
D
davbusu Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Apr 2003
Posts: 4
:2
sockread 4096 &binary
if ($sockbr == 0) {
return
}
bwrite filename.ext -1 -1 &binary
goto 2

......

i'm using the above script for dcc proxies etc.... and on large files such as 80 megs... they're arriving corrupted... any help pls?

Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
Remove one of the -1 in your bwrite... That should work...

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
actually you want 2 -1's The forst is wat pos to start at in the file (-1 is EOF) the second, wat position would u like to start from the binary variable.


-KingTomato
Joined: Jan 2003
Posts: 87
T
Tat Offline
Babel fish
Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
Code:
on *:SOCKREAD:getfile*: {
  sockread -nf &binfile
  bwrite file.ext -1 -1 &binfile
}


There is also the brilliant trick of lying to dccserver and making the recieved socket look like a dcc send. I invented when I made my ftp client. And managed to use it to download several 300+ meg file flawlessly. While also having the internals to check the sends as nice dcc sends.

Code:
alias getfile {
  if ($regex($1,/http:\/\/([^\/]+)(\/(?:.+\/)?)([^\/]+)/)) {
    .dccserver +scf on 59
    var %newsock = fdcc $+ $sock(fdcc*,0)
    sockopen %newsock 127.0.0.1 59
    sockmark %newsock $regml(1) $regml(2) $regml(3)
  }
  else { echo -a Invalid web address. }
}
on 1:sockopen:fdcc*:{
  tokenize 32 $sock($sockname).mark
  sockwrite -n $sockname 120 FakeSend 500000000 $iif($3,$replace($3,$chr(32),_),file.ext)
  var %newsock = gethttp $+ $remove($sockname,fdcc)
  sockopen %newsock $1 80
  sockmark %newsock $2 $3
}
on *:sockopen:gethttp*:{
  tokenize 32 $sock($sockname).mark
  sockwrite -n $sockname GET $1 $+ $2
}
on *:sockread:gethttp*:{
  if ($sockerr > 0) { return }
  var %pushsock = fdcc $+ $remove($sockname,gethttp)
  sockread $iif($calc(16384 - $sock(%pushsock).sq) >= 4096, 4096, 128) &binvar
  if (($sock(%pushsock)) && ($calc($bvar(&binvar,0) + $sock(%pushsock).sq) <= 16384)) { sockwrite %pushsock &binvar }
  else { sockclose $sockname }
}
on 1:sockclose:fdcc*:{ if ($sock(gethttp $+ $remove($sockname, fdcc))) { sockclose gethttp $+ $remove($sockname, fdcc) } }
on 1:sockclose:gethttp*:{ if ($sock(fdcc $+ $remove($sockname, gethttp))) { sockclose fdcc $+ $remove($sockname, gethttp) } }


This code works as follows, load it and type /getfile http://blah.com/blah/blah/file.ext

Bit outthere, and only a suggestion.

Joined: Apr 2003
Posts: 4
D
davbusu Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Apr 2003
Posts: 4
tnx a lot smile))))
appriciate a lot hehe... but i really need to use dcc's + proxy due to capping from my isp :| ... mirc uses a firewall when send a dcc ... not while receiving... since the client can easily connect to the server. dunno... i've been testing the dcc resume protocol and i was getting corrupted while i was resuming.... i was sending in as the position of the file it's same file size. ..now i tried to trim 100 kb from the file to avoid getting them corrupt. dunno :\


Link Copied to Clipboard