mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-31 17:43:22 -05:00
[httpd] Coverity fixups
This commit is contained in:
parent
c9aac896ee
commit
334beb1cfa
11
src/httpd.c
11
src/httpd.c
@ -1310,9 +1310,10 @@ httpd_stream_file(struct evhttp_request *req, int id)
|
|||||||
if (!transcode)
|
if (!transcode)
|
||||||
{
|
{
|
||||||
/* Hint the OS */
|
/* Hint the OS */
|
||||||
posix_fadvise(st->fd, st->start_offset, st->stream_size, POSIX_FADV_WILLNEED);
|
if ( (ret = posix_fadvise(st->fd, st->start_offset, st->stream_size, POSIX_FADV_WILLNEED)) != 0 ||
|
||||||
posix_fadvise(st->fd, st->start_offset, st->stream_size, POSIX_FADV_SEQUENTIAL);
|
(ret = posix_fadvise(st->fd, st->start_offset, st->stream_size, POSIX_FADV_SEQUENTIAL)) != 0 ||
|
||||||
posix_fadvise(st->fd, st->start_offset, st->stream_size, POSIX_FADV_NOREUSE);
|
(ret = posix_fadvise(st->fd, st->start_offset, st->stream_size, POSIX_FADV_NOREUSE)) != 0 )
|
||||||
|
DPRINTF(E_DBG, L_HTTPD, "posix_fadvise() failed with error %d\n", ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1353,6 +1354,10 @@ httpd_gzip_deflate(struct evbuffer *in)
|
|||||||
strm.zfree = Z_NULL;
|
strm.zfree = Z_NULL;
|
||||||
strm.opaque = Z_NULL;
|
strm.opaque = Z_NULL;
|
||||||
|
|
||||||
|
// Just to keep Coverity from complaining about uninitialized values
|
||||||
|
strm.total_in = 0;
|
||||||
|
strm.total_out = 0;
|
||||||
|
|
||||||
// Set up a gzip stream (the "+ 16" in 15 + 16), instead of a zlib stream (default)
|
// Set up a gzip stream (the "+ 16" in 15 + 16), instead of a zlib stream (default)
|
||||||
ret = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY);
|
ret = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY);
|
||||||
if (ret != Z_OK)
|
if (ret != Z_OK)
|
||||||
|
Loading…
Reference in New Issue
Block a user