mirror of https://github.com/aria2/aria2
2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/MSEHandshake.cc (encryptAndSendData): Use std::min().pull/1/head
parent
3c41ea24bf
commit
1d0175a29e
|
@ -1,3 +1,7 @@
|
||||||
|
2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
* src/MSEHandshake.cc (encryptAndSendData): Use std::min().
|
||||||
|
|
||||||
2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Determin _threadtholdSpeed in each constructor for
|
Determin _threadtholdSpeed in each constructor for
|
||||||
|
|
|
@ -196,7 +196,7 @@ void MSEHandshake::encryptAndSendData(const unsigned char* data, size_t length)
|
||||||
size_t s;
|
size_t s;
|
||||||
size_t r = length;
|
size_t r = length;
|
||||||
while(r > 0) {
|
while(r > 0) {
|
||||||
s = r > sizeof(temp)?sizeof(temp):r;
|
s = std::min(r, sizeof(temp));
|
||||||
_encryptor->encrypt(temp, s, dptr, s);
|
_encryptor->encrypt(temp, s, dptr, s);
|
||||||
_socket->writeData(temp, s);
|
_socket->writeData(temp, s);
|
||||||
dptr += s;
|
dptr += s;
|
||||||
|
|
Loading…
Reference in New Issue