Commit 2b6d5a5f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the various http_Get* functions return const char * to what they find.

parent 49af0c1e
......@@ -876,11 +876,11 @@ void http_SetH(const struct http *to, unsigned n, const char *fm);
void http_ForceField(const struct http *to, unsigned n, const char *t);
void HTTP_Setup(struct http *, struct ws *, struct vsl_log *, enum VSL_tag_e);
void http_Teardown(struct http *ht);
int http_GetHdr(const struct http *hp, const char *hdr, char **ptr);
int http_GetHdr(const struct http *hp, const char *hdr, const char **ptr);
int http_GetHdrToken(const struct http *hp, const char *hdr,
const char *token, char **ptr);
const char *token, const char **ptr);
int http_GetHdrField(const struct http *hp, const char *hdr,
const char *field, char **ptr);
const char *field, const char **ptr);
double http_GetHdrQ(const struct http *hp, const char *hdr, const char *field);
ssize_t http_GetContentLength(const struct http *hp);
uint16_t http_GetStatus(const struct http *hp);
......
......@@ -832,7 +832,7 @@ ban_evaluate(struct worker *wrk, const uint8_t *bs, struct objcore *oc,
{
struct ban_test bt;
const uint8_t *be;
char *p;
const char *p;
const char *arg1;
be = bs + ban_len(bs);
......
......@@ -94,7 +94,7 @@ static int
vbf_beresp2obj(struct busyobj *bo)
{
unsigned l, l2;
char *b;
const char *b;
uint8_t *bp;
struct vsb *vary = NULL;
int varyl = 0;
......@@ -501,7 +501,7 @@ vbf_fetch_body_helper(struct busyobj *bo)
static enum fetch_step
vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
{
char *p;
const char *p;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
......
......@@ -377,7 +377,7 @@ http_CollectHdr(struct http *hp, const char *hdr)
/*--------------------------------------------------------------------*/
int
http_GetHdr(const struct http *hp, const char *hdr, char **ptr)
http_GetHdr(const struct http *hp, const char *hdr, const char **ptr)
{
unsigned u, l;
char *p;
......@@ -420,9 +420,9 @@ http_GetHdr(const struct http *hp, const char *hdr, char **ptr)
int
http_GetHdrToken(const struct http *hp, const char *hdr,
const char *token, char **ptr)
const char *token, const char **ptr)
{
char *h, *e;
const char *h, *e;
unsigned fl;
int quoted;
......@@ -468,7 +468,7 @@ http_GetHdrToken(const struct http *hp, const char *hdr,
double
http_GetHdrQ(const struct http *hp, const char *hdr, const char *field)
{
char *h;
const char *h;
int i;
double a, b;
......@@ -517,9 +517,9 @@ http_GetHdrQ(const struct http *hp, const char *hdr, const char *field)
int
http_GetHdrField(const struct http *hp, const char *hdr,
const char *field, char **ptr)
const char *field, const char **ptr)
{
char *h;
const char *h;
int i;
if (ptr != NULL)
......@@ -550,7 +550,7 @@ ssize_t
http_GetContentLength(const struct http *hp)
{
ssize_t cl, cll;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
......@@ -579,7 +579,7 @@ http_GetContentLength(const struct http *hp)
enum sess_close
http_DoConnection(struct http *hp)
{
char *p, *q;
const char *p, *q;
enum sess_close retval;
unsigned u;
......@@ -618,7 +618,7 @@ http_DoConnection(struct http *hp)
int
http_HdrIs(const struct http *hp, const char *hdr, const char *val)
{
char *p;
const char *p;
if (!http_GetHdr(hp, hdr, &p))
return (0);
......
......@@ -230,7 +230,7 @@ V1D_FlushReleaseAcct(struct req *req)
void
V1D_Deliver(struct req *req, struct busyobj *bo)
{
char *r;
const char *r;
enum objiter_status ois;
ssize_t l;
......@@ -369,7 +369,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
void
V1D_Deliver_Synth(struct req *req)
{
char *r;
const char *r;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
AN(req->synth_body);
......
......@@ -260,7 +260,7 @@ http1_dissect(struct worker *wrk, struct req *req)
const char *r_100 = "HTTP/1.1 100 Continue\r\n\r\n";
const char *r_400 = "HTTP/1.1 400 Bad Request\r\n\r\n";
const char *r_417 = "HTTP/1.1 417 Expectation Failed\r\n\r\n";
char *p;
const char *p;
ssize_t r;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
......
......@@ -382,7 +382,7 @@ static enum body_status
http1_body_status(const struct http *hp, struct http_conn *htc)
{
ssize_t cl;
char *b;
const char *b;
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
......
......@@ -680,7 +680,7 @@ cnt_recv(struct worker *wrk, struct req *req)
{
unsigned recv_handling;
struct SHA256Context sha256ctx;
char *xff;
const char *xff;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
......
......@@ -67,7 +67,7 @@ RFC2616_Ttl(struct busyobj *bo, double now)
{
unsigned max_age, age;
double h_date, h_expires;
char *p;
const char *p;
const struct http *hp;
struct exp *expp;
......@@ -214,7 +214,7 @@ RFC2616_Req_Gzip(const struct http *hp)
int
RFC2616_Do_Cond(const struct req *req)
{
char *p, *e;
const char *p, *e;
double ims, lm;
int do_cond = 0;
......@@ -246,7 +246,7 @@ RFC2616_Do_Cond(const struct req *req)
void
RFC2616_Weaken_Etag(struct http *hp)
{
char *p;
const char *p;
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
......@@ -264,7 +264,7 @@ RFC2616_Weaken_Etag(struct http *hp)
void
RFC2616_Vary_AE(struct http *hp)
{
char *vary;
const char *vary;
if (http_GetHdrToken(hp, H_Vary, "Accept-Encoding", NULL))
return;
......
......@@ -77,7 +77,7 @@ static unsigned VRY_Validate(const uint8_t *vary);
int
VRY_Create(struct busyobj *bo, struct vsb **psb)
{
char *v, *p, *q, *h, *e;
const char *v, *p, *q, *h, *e;
struct vsb *sb, *sbh;
unsigned l;
int error = 0;
......@@ -286,7 +286,7 @@ int
VRY_Match(struct req *req, const uint8_t *vary)
{
uint8_t *vsp = req->vary_b;
char *h, *e;
const char *h, *e;
unsigned lh, ln;
int i, oflo = 0;
......
......@@ -120,7 +120,7 @@ vrt_selecthttp(VRT_CTX, enum gethdr_e where)
const char *
VRT_GetHdr(VRT_CTX, const struct gethdr_s *hs)
{
char *p;
const char *p;
struct http *hp;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment