aboutsummaryrefslogtreecommitdiffstats
path: root/epan/req_resp_hdrs.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-09-10 14:03:08 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-09-10 14:03:08 +0000
commit6d3c94a53aa8deac5f524248c3dd89c54a92bf5a (patch)
tree3c7c1b9828872c00fd0d73a709701b6034ed820d /epan/req_resp_hdrs.c
parent9568b76a63d8f52b35262d7953b2270c2e19f9a0 (diff)
implement support to reassemble tcp sessions until the end of the session (FIN)
add required code to the http (and others) code in req_resp_hdrs.c to signal to tcp when it wants a session to be reassembled to the FIN. This is currently done for all HTTP packets where we have a Content-type in the header but no content-length. svn path=/trunk/; revision=19185
Diffstat (limited to 'epan/req_resp_hdrs.c')
-rw-r--r--epan/req_resp_hdrs.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/epan/req_resp_hdrs.c b/epan/req_resp_hdrs.c
index cbc861de3e..5696c51558 100644
--- a/epan/req_resp_hdrs.c
+++ b/epan/req_resp_hdrs.c
@@ -48,6 +48,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
gchar *header_val;
long int content_length;
gboolean content_length_found = FALSE;
+ gboolean content_type_found = FALSE;
gboolean chunked_encoding = FALSE;
/*
@@ -154,6 +155,9 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
== 1)
content_length_found = TRUE;
g_free(header_val);
+ } else if (tvb_strncaseeql(tvb, next_offset_sav,
+ "Content-Type:", 13) == 0) {
+ content_type_found = TRUE;
} else if (tvb_strncaseeql(tvb,
next_offset_sav,
"Transfer-Encoding:", 18) == 0) {
@@ -329,6 +333,27 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
+ } else if (content_type_found && pinfo->can_desegment) {
+ /* We found a content-type but no content-length.
+ * This is probably a HTTP header for a session with
+ * only one HTTP PDU and where the content spans
+ * until the end of the tcp session.
+ * Set up tcp reassembly until the end of this session.
+ */
+ length_remaining = tvb_length_remaining(tvb, next_offset);
+ reported_length_remaining = tvb_reported_length_remaining(tvb, next_offset);
+ if (length_remaining < reported_length_remaining) {
+ /*
+ * It's a waste of time asking for more
+ * data, because that data wasn't captured.
+ */
+ return TRUE;
+ }
+
+ pinfo->desegment_offset = offset;
+ pinfo->desegment_len = DESEGMENT_UNTIL_FIN;
+
+ return FALSE;
}
}