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

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 __uint64 unsigned __int64 |
| #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL |
| 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.
| 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) |
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.
| 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 |
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().

| 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.
| 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 |
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.
| connection | CONEXION struct returned by a previous call to GetSocketConnection |
Definition at line 699 of file IoFunctions.cpp.
Referenced by FreeConnection(), GetSocketConnection(), and ReadHTTPResponseData().
| HTTPIOMapping HTTPIoMappingData[MAXIMUM_OPENED_HANDLES] |
Definition at line 5 of file IoFunctions.cpp.
| CRITICAL_SECTION IoMappingLock |
Definition at line 10 of file IoFunctions.cpp.
1.5.4