Dailydave mailing list archives
A small fun Python puzzle
From: Dave Aitel <dave () immunityinc com>
Date: Mon, 31 Mar 2008 13:10:47 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is part of our smb file putter. With small files it works great.
With larger files, it uses 100% of the CPU and takes forever. Can anyone
spot why? (Answer forthcoming, of course)
~ while data!="":
~ data_to_send=data[:1024]
~ success, results=smb_writex(self.s,self.fid,self.uid,
self.tid,self.pid,data_to_send,offset)
~ offset+=len(data_to_send) #nt4 needs the offset to be
calculated correctly on a named pipe
~ #for a given DCE call - oddly, 2000 and above don't care.
~ if not success:
~ devlog("msrpc", "Error while writex-ing")
~ #close request
~ self.fileclose()
~ return 0
~ #we wrote up to 1024 bytes...
~ data=data[1024:]
- -dave
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH8RsXtehAhL0gheoRAnsRAJ97NNsKL0K0H3JOpsa86ouixGJqCACfSPgI
O1LaA/yuCAV7DFB0H0HHr0s=
=ase8
-----END PGP SIGNATURE-----
_______________________________________________
Dailydave mailing list
Dailydave () lists immunitysec com
http://lists.immunitysec.com/mailman/listinfo/dailydave
Current thread:
- A small fun Python puzzle Dave Aitel (Mar 31)
