C:/fscan/HTTPCore/IoFunctions.cpp File Reference

#include "IoFunctions.h"
#include "Threading.h"
#include "Modules/Encoding_Chunked.h"

Include dependency graph for IoFunctions.cpp:

Go to the source code of this file.

Data Structures

struct  timezone

Defines

#define __uint64   unsigned __int64
#define DELTA_EPOCH_IN_MICROSECS   11644473600000000ULL

Functions

static int gettimeofday (struct timeval *tv, struct timezone *tz)
static int LimitIOBandwidth (unsigned long ChunkSize, struct timeval LastTime, struct timeval CurrentTime, int MAX_BW_LIMIT)
 This function checks if the transfered data exceeds the current bandwidth limit.
int SendHTTPRequestData (STABLISHED_CONNECTION *conexion, PHTTP_DATA request)
 This function sends an HTTP request to the remote webserver. a CONEXION struct with initialized sockets. If the connection was previously initialized that struct will be resused.
PHTTP_DATA ReadHTTPResponseData (STABLISHED_CONNECTION *conexion, PHTTP_DATA request, void *lock)
 This function reads an HTTP response stream from the remote webserver.
int StablishConnection (STABLISHED_CONNECTION *connection)
 This function stablishes a connection against a remote host.
int InitFileMapping (void)
int EndFileMapping (void)
char * DeleteFileMapping (void *ptr)
PHTTPIOMapping GetFileMapping (unsigned int DataSize, char *lpData)

Variables

HTTPIOMapping HTTPIoMappingData [MAXIMUM_OPENED_HANDLES]
CRITICAL_SECTION IoMappingLock


Define Documentation

#define __uint64   unsigned __int64

Definition at line 7 of file IoFunctions.cpp.

Referenced by LimitIOBandwidth().

#define DELTA_EPOCH_IN_MICROSECS   11644473600000000ULL

Definition at line 15 of file IoFunctions.cpp.

Referenced by gettimeofday().


Function Documentation

char* DeleteFileMapping ( void *  ptr  ) 

Definition at line 818 of file IoFunctions.cpp.

int EndFileMapping ( void   ) 

Definition at line 799 of file IoFunctions.cpp.

PHTTPIOMapping GetFileMapping ( unsigned int  DataSize,
char *  lpData 
)

Definition at line 862 of file IoFunctions.cpp.

Referenced by DecodeChunk(), and ReadHTTPResponseData().

static int gettimeofday ( struct timeval *  tv,
struct timezone tz 
) [static]

Definition at line 24 of file IoFunctions.cpp.

References DELTA_EPOCH_IN_MICROSECS, timezone::tz_dsttime, and timezone::tz_minuteswest.

Referenced by ReadHTTPResponseData().

int InitFileMapping ( void   ) 

Definition at line 792 of file IoFunctions.cpp.

static int LimitIOBandwidth ( unsigned long  ChunkSize,
struct timeval  LastTime,
struct timeval  CurrentTime,
int  MAX_BW_LIMIT 
) [static]

This function checks if the transfered data exceeds the current bandwidth limit.

Parameters:
ChunkSize Size of the transfered data block.
LastTime timeval struct that stores the moment when the application began to receive data.
CurrentTime timeval struct that stores the actual time
MAX_BW_LIMIT Bandwitdh limit (kbps)
Returns:
Number of miliseconds that the thread should wait until new data is readed from the remote server. -1 is returned if there is no enough information to calculate bandwidth.

Definition at line 72 of file IoFunctions.cpp.

References __uint64, and MAX_CHECK_TIME_FOR_BW_UTILIZATION.

Referenced by ReadHTTPResponseData().

PHTTP_DATA ReadHTTPResponseData ( STABLISHED_CONNECTION conexion,
PHTTP_DATA  request,
void *  lock 
)

This function reads an HTTP response stream from the remote webserver.

Parameters:
conexion struct returned by GetSocketConnection that includes the information of the remote host and valid socket.
request HTTP request that was sent before. This param is needed to resend the request
lock mutext used for exclusive access
Returns:
pointer to a HTTP_DATA Struct with the HTTP Response or NULL if the remote host can not be reached.

Definition at line 154 of file IoFunctions.cpp.

References _HTTPmapping_struct_::BufferedFileName, _HTTPmapping_struct_::BufferedPtr, BUFFSIZE, conexiones::BwLimit, conexiones::ConnectionAgainstProxy, _data::Data, _data::DataSize, conexiones::datasock, DWORD, FreeConnection(), GetFileMapping(), GetHeaderValue(), gettimeofday(), _data::Header, _data::HeaderSize, _HTTPmapping_struct_::hMapping, _HTTPmapping_struct_::hTmpFilename, InitHTTPData(), conexiones::io, LimitIOBandwidth(), conexiones::lock, LockMutex(), MAX_CHUNK_LENGTH, conexiones::NeedSSL, conexiones::NumberOfRequests, conexiones::PENDING_PIPELINE_REQUESTS, conexiones::PIPELINE_Request, READ_TIMEOUT, ReadHTTPResponseData(), RemovePipeLineRequest(), SendHTTPRequestData(), StablishConnection(), strnicmp, conexiones::tlastused, and UnLockMutex().

Referenced by ReadHTTPResponseData().

Here is the call graph for this function:

int SendHTTPRequestData ( STABLISHED_CONNECTION conexion,
PHTTP_DATA  request 
)

This function sends an HTTP request to the remote webserver. a CONEXION struct with initialized sockets. If the connection was previously initialized that struct will be resused.

Parameters:
conexion struct returned by GetSocketConnection that includes the information of the remote host and valid socket.
request HTTP request verbs and data to be delivered to the remote HTTP Server
Returns:
If there is no error, 1 is returned.
Note:
This Function only sends data, handling the responses from the HTTP server is done outside.

Definition at line 106 of file IoFunctions.cpp.

References _data::Data, _data::DataSize, conexiones::datasock, _data::Header, _data::HeaderSize, conexiones::NeedSSL, conexiones::port, and conexiones::targetDNS.

Referenced by FreeConnection(), and ReadHTTPResponseData().

int StablishConnection ( STABLISHED_CONNECTION connection  ) 

This function stablishes a connection against a remote host.

Parameters:
connection CONEXION struct returned by a previous call to GetSocketConnection
Returns:
If the remote connection can be stablished, 1 is returned otherwise, an error is signaled with 0

Definition at line 699 of file IoFunctions.cpp.

Referenced by FreeConnection(), GetSocketConnection(), and ReadHTTPResponseData().


Variable Documentation

HTTPIOMapping HTTPIoMappingData[MAXIMUM_OPENED_HANDLES]

Definition at line 5 of file IoFunctions.cpp.

CRITICAL_SECTION IoMappingLock

Definition at line 10 of file IoFunctions.cpp.


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