summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-08-03 06:57:51 +0000
committerRobey Pointer <robey@lag.net>2005-08-03 06:57:51 +0000
commit7b4cd51b7693f401e926b5e25dcfd1b014e9815f (patch)
tree48f374f403fdb40435fbf10e507de82f97ce3957
parenteb60811594711e8aed9b8cabeb2949ad74c82843 (diff)
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-49]
dumb tiny tweaks
-rw-r--r--paramiko/file.py2
-rw-r--r--paramiko/kex_gex.py4
-rw-r--r--paramiko/rsakey.py2
-rwxr-xr-xtests/test_sftp.py3
4 files changed, 4 insertions, 7 deletions
diff --git a/paramiko/file.py b/paramiko/file.py
index 13d36ac8..f066c4a8 100644
--- a/paramiko/file.py
+++ b/paramiko/file.py
@@ -321,7 +321,7 @@ class BufferedFile (object):
return
# even if we're line buffering, if the buffer has grown past the
# buffer size, force a flush.
- if len(self._wbuffer.getvalue()) >= self._bufsize:
+ if self._wbuffer.tell() >= self._bufsize:
self.flush()
return
diff --git a/paramiko/kex_gex.py b/paramiko/kex_gex.py
index 902677d9..e0974c1f 100644
--- a/paramiko/kex_gex.py
+++ b/paramiko/kex_gex.py
@@ -119,6 +119,7 @@ class KexGex (object):
pack = self.transport._get_modulus_pack()
if pack is None:
raise SSHException('Can\'t do server-side gex with no modulus pack')
+ self.transport._log(DEBUG, 'Picking p (%d <= %d <= %d bits)' % (minbits, preferredbits, maxbits))
self.g, self.p = pack.get_modulus(minbits, preferredbits, maxbits)
m = Message()
m.add_byte(chr(_MSG_KEXDH_GEX_GROUP))
@@ -201,6 +202,3 @@ class KexGex (object):
self.transport._set_K_H(K, SHA.new(str(hm)).digest())
self.transport._verify_key(host_key, sig)
self.transport._activate_outbound()
-
-
-
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py
index 3e9fb410..7751b494 100644
--- a/paramiko/rsakey.py
+++ b/paramiko/rsakey.py
@@ -89,7 +89,7 @@ class RSAKey (PKey):
if msg.get_string() != 'ssh-rsa':
return False
sig = util.inflate_long(msg.get_string(), True)
- # verify the signature by SHA'ing the data and encrypting it using theŚ
+ # verify the signature by SHA'ing the data and encrypting it using the
# public key. some wackiness ensues where we "pkcs1imify" the 20-byte
# hash into a string as long as the RSA key.
hash = util.inflate_long(self._pkcs1imify(SHA.new(data).digest()), True)
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index d5de063d..fdbbe1ae 100755
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -433,14 +433,13 @@ class SFTPTest (unittest.TestCase):
def test_E_big_file(self):
"""
write a 1MB file, with no linefeeds, using line buffering.
- FIXME: this is slow! what causes the slowness?
"""
global g_big_file_test
if not g_big_file_test:
return
kblob = (1024 * 'x')
try:
- f = sftp.open('%s/hongry.txt' % FOLDER, 'w', 1)
+ f = sftp.open('%s/hongry.txt' % FOLDER, 'w')
for n in range(1024):
f.write(kblob)
if n % 128 == 0: