Ace_Decoder_Fragment_Add()
Abstract
Sets up fragmentation information for a packet.
Syntax
Ace_Decoder_Fragment_Add (pk_ptr, unique_id, frag_offset, layer, layer_offset, last_fragment)
| Argument | Type | Description |
|---|---|---|
pk_ptr |
AceT_Packet * |
Packet of interest. |
unique_id |
int |
ID of the current message, of which the fragment is a part. |
frag_offset |
int |
Fragment offset in the message, in bytes. |
layer |
int |
Protocol layer of interest. |
layer_offset |
int |
Protocol offset in the packet, in bytes. |
last_fragment |
int |
PRGC_TRUE if this is the last fragment; PRGC_FALSE if not. |
Return Type
void
No return value.
Header
ace_client_api.h
Example
/* There was a "Content-Length" header in the frame, so we know */
/* exactly the number of bytes in the HTTP Message Body. */
if (curr_msg_ptr->prev_pk_ptr || curr_msg_ptr->remaining_bytes > 0)
{
/* If we know to expect more bytes then we should be able to */
/* set up the fragment info, expecting there will be continuation frames. */
Ace_Decoder_Fragment_Add (pk_ptr, curr_msg_ptr->unique_id,
curr_msg_ptr->bytes_so_far, layer-1, offset,
(curr_msg_ptr->remaining_bytes==0)?PRGC_TRUE:PRGC_FALSE);
Details
This function adds a new fragment to the fragmentation database. If the fragmentation group for this fragment is not already in the database, the function creates a new fragmentation group before adding the new fragment.