]> git.proxmox.com Git - pve-manager.git/commit
api: journal: stream the journal data to the client
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 24 Nov 2021 14:47:48 +0000 (15:47 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 24 Nov 2021 17:19:16 +0000 (18:19 +0100)
commit68df94969042b76f152db1c51048f7efb5315a0a
tree090e700d91f50b8ac2e823f13b3af9ae6eeb50fb
parenta6aa09fdd13698307de05f78f0db0c896d30c800
api: journal: stream the journal data to the client

instead of accumulating the whole output of 'mini-journalreader' in
the api call (this can be quite big), use the download mechanic of the
http-server to stream the output to the client.

we lose some error handling possibilities, but we do not have
to allocate anything here, and since perl does not free memory after
allocating[0] this is our desired behaviour.

to keep api compatiblitiy, we need to give the journalreader the '-j'
flag to let it output json.

also tell the http server that the encoding is gzip and pipe
the output through it.

0: https://perldoc.perl.org/perlfaq3#How-can-I-free-an-array-or-hash-so-my-program-shrinks?

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Nodes.pm