commit d2c65b4f624879cfc20dafc08382d964304f4234
parent cda09b60650973cf7d1bf152598d5c0ad241ea63
Author: Joris Vink <joris@coders.se>
Date: Thu, 7 Aug 2014 14:31:45 +0200
Change http_response_stream() to only take a base + len
Diffstat:
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/includes/http.h b/includes/http.h
@@ -202,7 +202,7 @@ void http_process_request(struct http_request *, int);
u_int8_t *http_post_data_bytes(struct http_request *, u_int32_t *);
void http_response(struct http_request *, int, void *, u_int32_t);
void http_response_stream(struct http_request *, int,
- void *, u_int64_t, u_int64_t);
+ void *, u_int64_t);
int http_request_header(struct http_request *,
const char *, char **);
void http_response_header(struct http_request *,
diff --git a/src/http.c b/src/http.c
@@ -396,25 +396,21 @@ http_response(struct http_request *req, int status, void *d, u_int32_t l)
void
http_response_stream(struct http_request *req, int status, void *base,
- u_int64_t start, u_int64_t end)
+ u_int64_t len)
{
- u_int8_t *d;
- u_int64_t len;
-
- len = end - start;
req->status = status;
switch (req->owner->proto) {
case CONN_PROTO_SPDY:
- http_response_spdy(req, req->owner, req->stream, status, NULL, len);
+ http_response_spdy(req, req->owner,
+ req->stream, status, NULL, len);
break;
case CONN_PROTO_HTTP:
http_response_normal(req, req->owner, status, NULL, len);
break;
}
- d = base;
- net_send_stream(req->owner, d + start, end - start, req->stream);
+ net_send_stream(req->owner, base, len, req->stream);
}
int