http.h File Reference

#include "common.h"
#include <curl/curl.h>
Include dependency graph for http.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dlqueue_s
struct  dlhandle_s

Defines

#define CURL_STATICLIB

Typedefs

typedef struct dlqueue_s dlqueue_t
typedef struct dlhandle_s dlhandle_t

Enumerations

enum  dlq_state { DLQ_STATE_NOT_STARTED, DLQ_STATE_RUNNING, DLQ_STATE_DONE }

Functions

char * HTTP_GetURL (const char *url)
 Gets a specific url and store into.
size_t HTTP_Recv (void *ptr, size_t size, size_t nmemb, void *stream)
 libcurl callback for HTTP_GetURL
size_t HTTP_Header (void *ptr, size_t size, size_t nmemb, void *stream)
 libcurl callback to update header info.
void HTTP_Cleanup (void)
 UFO is exiting or we're changing servers. Clean up.

Detailed Description

Definition in file http.h.


Define Documentation

#define CURL_STATICLIB

Definition at line 29 of file http.h.


Typedef Documentation

typedef struct dlhandle_s dlhandle_t
typedef struct dlqueue_s dlqueue_t

Enumeration Type Documentation

enum dlq_state
Enumerator:
DLQ_STATE_NOT_STARTED 
DLQ_STATE_RUNNING 
DLQ_STATE_DONE 

Definition at line 32 of file http.h.


Function Documentation

void HTTP_Cleanup ( void   ) 

UFO is exiting or we're changing servers. Clean up.

Definition at line 137 of file http.c.

Referenced by Qcommon_Shutdown().

char* HTTP_GetURL ( const char *  url  ) 

Gets a specific url and store into.

Note:
Make sure, that you free the strings that is returned by this function

Definition at line 94 of file http.c.

References Com_Printf(), dlhandle_s::curl, Cvar_GetString(), HTTP_Header(), http_proxy, HTTP_Recv(), http_timeout, cvar_s::integer, Q_strncpyz(), qfalse, qtrue, cvar_s::string, dlhandle_s::tempBuffer, and dlhandle_s::URL.

Referenced by CL_QueryMasterServerThread(), Master_HeartbeatThread(), Master_Shutdown(), and SV_SetMaster_f().

size_t HTTP_Header ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  stream 
)

libcurl callback to update header info.

Definition at line 27 of file http.c.

References dlhandle_s::file, dlhandle_s::fileSize, len, Q_strncasecmp(), and Q_strncpyz().

Referenced by CL_StartHTTPDownload(), and HTTP_GetURL().

size_t HTTP_Recv ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  stream 
)

libcurl callback for HTTP_GetURL

Definition at line 60 of file http.c.

References dlhandle_s::fileSize, Mem_Alloc, Mem_Free, dlhandle_s::position, and dlhandle_s::tempBuffer.

Referenced by CL_StartHTTPDownload(), and HTTP_GetURL().


Generated by  doxygen 1.6.2