Skip to content

Commit

Permalink
from ian abel
Browse files Browse the repository at this point in the history
Hi,

The attached file should fix the following two bugs in the AJP dissector.

1) The dissector doesn't know about CPING/CPONG
2) The dissector misinterprets multiple requests in one connection if a
prior request has a Body request part.




svn path=/trunk/; revision=18780
  • Loading branch information
Ronnie Sahlberg committed Jul 22, 2006
1 parent 2b4d003 commit 64c10f1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,7 @@ Diego Pettenò <flameeyes [AT] gentoo.org>
Daniel Black <dragonheart [AT] gentoo.org>
Christoph Werle <Christoph.Werle [AT] ira.uka.de>
Aaron Christensen <aaronmf [AT] gmail.com>
Ian Abel <ianabel [AT] mxtelecom.com>

Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.
Expand Down
21 changes: 19 additions & 2 deletions epan/dissectors/packet-ajp13.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ static const value_string mtype_codes[] = {
{ 5, "END RESPONSE" },
{ 6, "GET BODY CHUNK" },
{ 7, "SHUTDOWN" },
{ 9, "CPONG" },
{10, "CPING" },
{ 0, NULL }
};

Expand Down Expand Up @@ -393,6 +395,8 @@ display_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ajp13_tree)
proto_tree_add_item(ajp13_tree, hf_ajp13_rlen, tvb, pos, 2, 0);
pos+=2;

} else if ( mcode == 9 ) {

} else {
/* MESSAGE DATA (COPOUT)
*/
Expand All @@ -409,10 +413,18 @@ display_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ajp13_tree)
* packets.
*/
static void
display_req_body(tvbuff_t *tvb, proto_tree *ajp13_tree)
display_req_body(tvbuff_t *tvb, proto_tree *ajp13_tree, ajp13_conv_data* cd)
{
/*printf("ajp13:display_req_body()\n");*/

/*
* In a resued connection this is never reset.
*/
guint16 content_length;

content_length = tvb_get_ntohs( tvb, 4 );
cd->content_length -= content_length;

if (ajp13_tree) {

guint8 body_bytes[128*1024]; /* DANGER WILL ROBINSON */
Expand Down Expand Up @@ -487,6 +499,11 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_string(ajp13_tree, hf_ajp13_code, tvb, pos, 1, mcode_buf);
}
pos+=1;
if ( cod == 10 ) {
if(check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO, "CPING" );
return;
}

/* HTTP METHOD (ENCODED AS INTEGER)
*/
Expand Down Expand Up @@ -712,7 +729,7 @@ dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (mag == 0x1234) {

if (fd->is_request_body)
display_req_body(tvb, ajp13_tree);
display_req_body(tvb, ajp13_tree, cd);
else
display_req_forward(tvb, pinfo, ajp13_tree, cd);

Expand Down

0 comments on commit 64c10f1

Please sign in to comment.