Mercurial > dropbear
comparison packet.c @ 448:9c61e7af0156
Rearrange the channel buffer sizes into three neat use-editable values in
options.h. Increasing RECV_MAX_WINDOW gives big network performance
increases - even with the present buffers (which haven't changed) it
performs a lot better.
Next step is to make the window size a cmdline option.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 24 Jul 2007 15:40:23 +0000 |
parents | 695413c59b6a |
children | 4cab61369879 |
comparison
equal
deleted
inserted
replaced
447:278805938dcf | 448:9c61e7af0156 |
---|---|
210 len = buf_getint(ses.decryptreadbuf) + 4 + macsize; | 210 len = buf_getint(ses.decryptreadbuf) + 4 + macsize; |
211 | 211 |
212 buf_setpos(ses.readbuf, blocksize); | 212 buf_setpos(ses.readbuf, blocksize); |
213 | 213 |
214 /* check packet length */ | 214 /* check packet length */ |
215 if ((len > MAX_PACKET_LEN) || | 215 if ((len > RECV_MAX_PACKET_LEN) || |
216 (len < MIN_PACKET_LEN + macsize) || | 216 (len < MIN_PACKET_LEN + macsize) || |
217 ((len - macsize) % blocksize != 0)) { | 217 ((len - macsize) % blocksize != 0)) { |
218 dropbear_exit("bad packet size %d", len); | 218 dropbear_exit("bad packet size %d", len); |
219 } | 219 } |
220 | 220 |
279 padlen = buf_getbyte(ses.decryptreadbuf); | 279 padlen = buf_getbyte(ses.decryptreadbuf); |
280 | 280 |
281 /* payload length */ | 281 /* payload length */ |
282 /* - 4 - 1 is for LEN and PADLEN values */ | 282 /* - 4 - 1 is for LEN and PADLEN values */ |
283 len = ses.decryptreadbuf->len - padlen - 4 - 1; | 283 len = ses.decryptreadbuf->len - padlen - 4 - 1; |
284 if ((len > MAX_PAYLOAD_LEN) || (len < 1)) { | 284 if ((len > RECV_MAX_PAYLOAD_LEN) || (len < 1)) { |
285 dropbear_exit("bad packet size"); | 285 dropbear_exit("bad packet size"); |
286 } | 286 } |
287 | 287 |
288 buf_setpos(ses.decryptreadbuf, PACKET_PAYLOAD_OFF); | 288 buf_setpos(ses.decryptreadbuf, PACKET_PAYLOAD_OFF); |
289 | 289 |