diff options
Diffstat (limited to 'src/aclk/https_client.c')
-rw-r--r-- | src/aclk/https_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/aclk/https_client.c b/src/aclk/https_client.c index 4a0362992..f144eaf15 100644 --- a/src/aclk/https_client.c +++ b/src/aclk/https_client.c @@ -105,7 +105,8 @@ static int parse_http_hdr(rbuf_t buf, http_parse_ctx *parse_ctx) int idx, idx_end; char buf_key[HTTP_HDR_BUFFER_SIZE]; char buf_val[HTTP_HDR_BUFFER_SIZE]; - char *ptr = buf_key; + char *ptr; + if (!rbuf_find_bytes(buf, HTTP_LINE_TERM, strlen(HTTP_LINE_TERM), &idx_end)) { netdata_log_error("CRLF expected"); return 1; @@ -555,7 +556,7 @@ static int handle_http_request(https_req_ctx_t *ctx) { // we remove those but during encoding we need that space in the buffer creds_base64_len += (1+(creds_base64_len/64)) * strlen("\n"); char *creds_base64 = callocz(1, creds_base64_len + 1); - base64_encode_helper((unsigned char*)creds_base64, &creds_base64_len, (unsigned char*)creds_plain, creds_plain_len); + (void) netdata_base64_encode((unsigned char *)creds_base64, (unsigned char *)creds_plain, creds_plain_len); buffer_sprintf(hdr, "Proxy-Authorization: Basic %s\x0D\x0A", creds_base64); freez(creds_plain); } @@ -583,7 +584,6 @@ static int handle_http_request(https_req_ctx_t *ctx) { if (ctx->parse_ctx.chunked_response) freez(ctx->parse_ctx.chunked_response); rc = 4; - goto err_exit; } err_exit: |