Skip to content

Commit

Permalink
api: add ic_get_content_len
Browse files Browse the repository at this point in the history
  • Loading branch information
0x501D committed Aug 17, 2020
1 parent b6bda23 commit 6751223
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions libicap.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int ic_get_status_code(ic_query_t *q);
const char *ic_get_icap_hdr(ic_query_t *q);
const char *ic_get_req_hdr(ic_query_t *q);
const char *ic_get_resp_hdr(ic_query_t *q);
uint64_t ic_get_content_len(ic_query_t *q);
/** @return NULL if ERROR */
const char *ic_get_content(ic_query_t *q, size_t *len, int *err);

Expand Down
11 changes: 11 additions & 0 deletions src/ic_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,17 @@ IC_EXPORT const char *ic_get_icap_hdr(ic_query_t *q)
return icap->srv.icap_hdr;
}

IC_EXPORT uint64_t ic_get_content_len(ic_query_t *q)
{
ic_query_int_t *icap = ic_int_query(q);

if (!icap) {
return NULL;
}

return icap->cl.content_len;
}

IC_EXPORT const char *ic_get_content(ic_query_t *q, size_t *len, int *err)
{
ic_query_int_t *icap = ic_int_query(q);
Expand Down

0 comments on commit 6751223

Please sign in to comment.