1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

clean: coverity

This commit is contained in:
Andy Green 2018-08-23 11:48:17 +08:00
parent 253942ca80
commit a27dfb2a3e
3 changed files with 6 additions and 3 deletions

View file

@ -84,7 +84,7 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len)
lwsl_debug("%s: draining %d\n", __func__, (int)len);
}
if (!len)
if (!len || !buf)
return 0;
if (!wsi->http2_substream && !lws_socket_is_valid(wsi->desc.sockfd))

View file

@ -362,6 +362,9 @@ rops_write_role_protocol_h2(struct lws *wsi, unsigned char *buf, size_t len,
unsigned char flags = 0, base = (*wp) & 0x1f;
size_t olen = len;
int n;
#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION)
unsigned char mtubuf[1450 + LWS_PRE];
#endif
/* if not in a state to send stuff, then just send nothing */
@ -386,7 +389,7 @@ rops_write_role_protocol_h2(struct lws *wsi, unsigned char *buf, size_t len,
#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION)
if (wsi->http.lcs) {
unsigned char mtubuf[1450 + LWS_PRE], *out = mtubuf + LWS_PRE;
unsigned char *out = mtubuf + LWS_PRE;
size_t o = sizeof(mtubuf) - LWS_PRE;
n = lws_http_compression_transform(wsi, buf, len, wp, &out, &o);

View file

@ -587,7 +587,7 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin,
/* but we still need to send cache control... */
if (m && m->cache_max_age && m->cache_reusable) {
if (m->cache_max_age && m->cache_reusable) {
if (!m->cache_revalidate) {
cc = cache_control;
cclen = sprintf(cache_control, "%s, max-age=%u",