C:/fscan/HTTPCore/Modules/Encoding_Chunked.cpp File Reference

#include "Encoding_Chunked.h"
#include "../IoFunctions.h"
#include "../CallBack.h"
#include "../Build.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for Encoding_Chunked.cpp:

Go to the source code of this file.

Functions

static char * DecodeChunk (char *lpBuffer, unsigned int encodedlen, unsigned int *decodedlen)
 This function decodes the buffer returned by the remote HTTP Server when "Chunk encoding" is enabled.
int CBDecodeChunk (int cbType, HTTPHANDLE HTTPHandle, PHTTP_DATA *prequest, PHTTP_DATA *presponse)
 CallBack Function. This function is called from the DoCallBack() function once its registered and will intercept the callback information.


Detailed Description

Fast HTTP Auth Scanner - Chunk encoding for handling transfer encoding.

Author:
Andres Tarasco Acuna - http://www.tarasco.org (c) 2007 - 2008

Definition in file Encoding_Chunked.cpp.


Function Documentation

int CBDecodeChunk ( int  cbType,
HTTPHANDLE  HTTPHandle,
PHTTP_DATA prequest,
PHTTP_DATA presponse 
)

CallBack Function. This function is called from the DoCallBack() function once its registered and will intercept the callback information.

Parameters:
cbType CallBack Source Type. Valid options are CBTYPE_CLIENT_REQUEST , CBTYPE_CLIENT_RESPONSE , CBTYPE_BROWSER_REQUEST , CBTYPE_SERVER_RESPONSE
HTTPHandle HTTP Connection Handle with information about remote target (like ip address, port, ssl, protocol version,...)
prequest struct containing all information related to the HTTP Request.
presponse struct containing information about http reponse. This parameter could be NULL if the callback type is CBTYPE_CLIENT_REQUEST or CBTYPE_CLIENT_RESPONSE because request was not send yet.
Returns:
the return value CBRET_STATUS_NEXT_CB_CONTINUE indicates that the request (modified or not) its ok. If a registered handler blocks the request then CBRET_STATUS_CANCEL_REQUEST is returned. This value indicates that the response is locked
Note:
This function does not block requests, only tries to decode HTTP response.

Definition at line 162 of file Encoding_Chunked.cpp.

static char* DecodeChunk ( char *  lpBuffer,
unsigned int  encodedlen,
unsigned int *  decodedlen 
) [static]

This function decodes the buffer returned by the remote HTTP Server when "Chunk encoding" is enabled.

Parameters:
lpBuffer Buffer returned by the http server (Without headers )
encodedlen length of lpBuffer
decodedlen length of the returned decoded buffer
Returns:
Pointer to the decoded buffer.
Note:
If the function fails due to malformed or incomplete datachunks, NULL is returned instead. If that happends, the user must use the original lpBuffer data

Definition at line 29 of file Encoding_Chunked.cpp.

References _HTTPmapping_struct_::assigned, _HTTPmapping_struct_::BufferedFileName, _HTTPmapping_struct_::BufferedPtr, GetFileMapping(), _HTTPmapping_struct_::hMapping, _HTTPmapping_struct_::hTmpFilename, MAX_CHUNK_LENGTH, and _HTTPmapping_struct_::MemoryLenght.

Here is the call graph for this function:


Generated on Sun Jan 18 00:32:04 2009 for Fast HTTP Vulnerability Scanner by  doxygen 1.5.4