summaryrefslogtreecommitdiff
path: root/src/tcp.c
diff options
context:
space:
mode:
authorDaniel Dressler <danieru.dressler@gmail.com>2014-06-09 16:19:55 -0600
committerDaniel Dressler <danieru.dressler@gmail.com>2014-06-09 16:19:55 -0600
commit57ea9f8ecc8b13e98f4a1cbd52057a4f956cd631 (patch)
tree05d29104c369b5b0e3ffbf98c70455e37aa36fee /src/tcp.c
parentf9d1bd3b433b340f7cf7e6973c598ee185e02b56 (diff)
Make tcp find end of get requests
Diffstat (limited to 'src/tcp.c')
-rw-r--r--src/tcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tcp.c b/src/tcp.c
index b1e3339..1f967da 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -102,16 +102,17 @@ struct http_packet_t *tcp_packet_get(struct tcp_conn_t *tcp, struct http_message
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4
// Note: this method will not be used by clients
// if they expect a responce.
- if (size_read == 0) {
+ if (size_read == 0)
msg->is_completed = 1;
- }
// TODO: Did we receive more than a packets worth?
// Assemble packet
pkt->filled_size = size_read;
- sniff_request_type(pkt);
+ enum http_request_t type = sniff_request_type(pkt);
+ if (type == HTTP_HEADER_ONLY)
+ msg->is_completed = 1;
return pkt;