[Qt-interest] QSslSocket: massive difference in app memory usage when encryption enabled

Stephen Collyer scollyer at netspinner.co.uk
Thu Oct 15 13:00:14 CEST 2009


2009/10/15 Markus Goetz <Markus.Goetz at nokia.com>

> ext Stephen Collyer wrote:
>
>> 2009/10/14 Markus Goetz <Markus.Goetz at nokia.com <mailto:
>> Markus.Goetz at nokia.com>>
>>
>>    ext Stephen Collyer wrote:
>>
>>
>>    1. With a QSslSocket, you'd have to check encryptedBytesToWrite()
>>    since those are the bytes going out on the actual TCP socket. So,
>>    to be on the safe side do check for (encryptedBytesToWrite() +
>>    bytesToWrite() < http_socket_buffer_length_)
>>
>>
>> Thanks for the response. I'll try your suggested changes and let you know
>> what happens.
>>
>> There's one point that I'm not clear about: I use QSslSocket in both
>> encrypted and unencrypted mode, and I only see the problem with encrypted
>> mode. So I need a solution that works in both cases. However, I assume that
>> encryptedBytesWritten() is only emitted for a QSslSocket in encrypted mode -
>> if so, I guess I'd need an ugly hack to connect the encryptedBytesWritten()
>> or bytesWritten() based on whether the socket is encrypted or not.
>>
>
> Hm, you can do it like that, yes. But I'd go for what I proposed. Since you
> are checking the buffer fill anyway and only writing when they are less than
> a certain size, you can just try to do it for both signals, it should work:)
>
> Markus
>

OK. I think I misunderstood what you were suggesting. You mean that I
should:

a) replace my test in emit_file_chunk() with your modified version
b) in addition, connect encryptedBytesWritten() to the the same slot as
bytesWritten()

?

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091015/4f228f71/attachment.html 


More information about the Qt-interest-old mailing list