D:/opendownloadmanager/ODM-1.x/InetFile/cURL_lib/http.c File Reference

#include "setup.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include <signal.h>
#include "urldata.h"
#include <curl/curl.h>
#include "transfer.h"
#include "sendf.h"
#include "easyif.h"
#include "formdata.h"
#include "progress.h"
#include "base64.h"
#include "cookie.h"
#include "strequal.h"
#include "sslgen.h"
#include "http_digest.h"
#include "http_ntlm.h"
#include "http_negotiate.h"
#include "url.h"
#include "share.h"
#include "hostip.h"
#include "http.h"
#include "memory.h"
#include "select.h"
#include "parsedate.h"
#include "strtoofft.h"
#include "multiif.h"
#include <curl/mprintf.h>
#include "memdebug.h"

Go to the source code of this file.

Classes

struct  send_buffer

Defines

#define _MPRINTF_REPLACE
#define SELECT_OK   0
#define SELECT_ERROR   1
#define SELECT_TIMEOUT   2

Typedefs

typedef struct send_buffer send_buffer

Functions

static char * checkheaders (struct SessionHandle *data, const char *thisheader)
static CURLcode Curl_output_basic (struct connectdata *conn, bool proxy)
static bool pickoneauth (struct auth *pick)
static CURLcode perhapsrewind (struct connectdata *conn)
CURLcode Curl_http_auth_act (struct connectdata *conn)
static CURLcode Curl_http_output_auth (struct connectdata *conn, char *request, char *path, bool proxytunnel)
CURLcode Curl_http_input_auth (struct connectdata *conn, int httpcode, char *header)
int Curl_http_should_fail (struct connectdata *conn)
static size_t readmoredata (char *buffer, size_t size, size_t nitems, void *userp)
static CURLcode add_custom_headers (struct connectdata *conn, send_buffer *req_buffer)
static CURLcode add_buffer (send_buffer *in, const void *inptr, size_t size)
static send_bufferadd_buffer_init (void)
static CURLcode add_buffer_send (send_buffer *in, struct connectdata *conn, long *bytes_written, size_t included_body_bytes, int socketindex)
static CURLcode add_bufferf (send_buffer *in, const char *fmt,...)
bool Curl_compareheader (char *headerline, const char *header, const char *content)
CURLcode Curl_proxyCONNECT (struct connectdata *conn, int sockindex, char *hostname, int remote_port)
CURLcode Curl_http_connect (struct connectdata *conn, bool *done)
CURLcode Curl_https_connecting (struct connectdata *conn, bool *done)
CURLcode Curl_http_done (struct connectdata *conn, CURLcode status, bool premature)
static CURLcode expect100 (struct SessionHandle *data, send_buffer *req_buffer)
CURLcode Curl_http (struct connectdata *conn, bool *done)


Define Documentation

#define _MPRINTF_REPLACE

Definition at line 101 of file http.c.

#define SELECT_ERROR   1

Referenced by Curl_proxyCONNECT().

#define SELECT_OK   0

Referenced by Curl_proxyCONNECT().

#define SELECT_TIMEOUT   2

Referenced by Curl_proxyCONNECT().


Typedef Documentation

typedef struct send_buffer send_buffer

Definition at line 825 of file http.c.


Function Documentation

static CURLcode add_buffer ( send_buffer in,
const void *  inptr,
size_t  size 
) [static]

static send_buffer* add_buffer_init ( void   )  [static]

Definition at line 836 of file http.c.

References malloc, and NULL.

Referenced by Curl_http(), and Curl_proxyCONNECT().

static CURLcode add_buffer_send ( send_buffer in,
struct connectdata conn,
long *  bytes_written,
size_t  included_body_bytes,
int  socketindex 
) [static]

static CURLcode add_bufferf ( send_buffer in,
const char *  fmt,
  ... 
) [static]

static CURLcode add_custom_headers ( struct connectdata conn,
send_buffer req_buffer 
) [static]

static char* checkheaders ( struct SessionHandle data,
const char *  thisheader 
) [static]

bool Curl_compareheader ( char *  headerline,
const char *  header,
const char *  content 
)

Definition at line 1054 of file http.c.

References FALSE, ISSPACE, strnequal, and TRUE.

Referenced by Curl_http(), Curl_proxyCONNECT(), and Curl_readwrite().

CURLcode Curl_http ( struct connectdata conn,
bool done 
)

Definition at line 1716 of file http.c.

References connectdata::dynamically_allocated_data::accept_encoding, add_buffer(), add_buffer_init(), add_buffer_send(), add_bufferf(), add_custom_headers(), connectdata::allocptr, UrlState::authhost, ConnectBits::authneg, UrlState::authproxy, connectdata::bits, UrlState::buffer, BUFSIZE, SessionHandle::change, checkheaders(), UserDefined::cookie, connectdata::dynamically_allocated_data::cookiehost, SessionHandle::cookies, count, Curl_compareheader(), Curl_cookie_freelist(), Curl_cookie_getlist(), Curl_formclean(), Curl_formconvert(), Curl_FormInit(), Curl_formpostheader(), Curl_FormReader(), Curl_getFormData(), Curl_http_output_auth(), CURL_HTTP_VERSION_1_0, CURL_LOCK_ACCESS_SINGLE, CURL_LOCK_DATA_COOKIE, Curl_month, Curl_pgrsSetUploadSize(), Curl_safefree(), Curl_setup_transfer(), Curl_share_lock(), Curl_share_unlock(), curl_strequal(), CURL_TIMECOND_IFMODSINCE, CURL_TIMECOND_IFUNMODSINCE, CURL_TIMECOND_LASTMOD, Curl_wkday, CURLE_HTTP_POST_ERROR, CURLE_OK, CURLE_OUT_OF_MEMORY, CURLE_PARTIAL_FILE, CURLE_READ_ERROR, UserDefined::customrequest, connectdata::data, DEBUGASSERT, hostname::dispname, UserDefined::encoding, expect100(), UrlState::expect100header, failf, FALSE, UrlState::first_host, FIRSTSOCKET, HTTP::form, FORMAT_OFF_T, connectdata::fread, UserDefined::fread, connectdata::fread_in, free, connectdata::dynamically_allocated_data::host, connectdata::host, HandleData::http, UserDefined::httppost, ConnectBits::httpproxy, UserDefined::httpreq, HTTPREQ_GET, HTTPREQ_HEAD, HTTPREQ_LAST, HTTPREQ_NONE, HTTPREQ_POST, HTTPREQ_POST_FORM, HTTPREQ_PUT, UserDefined::httpversion, UserDefined::in, UserDefined::infilesize, SessionHandle::info, ConnectBits::ipv6_ip, ISSPACE, malloc, MAX_INITIAL_POST_SIZE, auth::multi, Cookie::name, hostname::name, Cookie::next, ConnectBits::no_body, NULL, HTTP::p_accept, HTTP::p_pragma, HandleData::path, PORT_HTTP, PORT_HTTPS, HTTP::postdata, UserDefined::postfields, UserDefined::postfieldsize, HTTP::postsize, PROT_FTP, PROT_HTTP, PROT_HTTPS, HandleData::proto, connectdata::protocol, connectdata::dynamically_allocated_data::proxyuserpwd, HandleData::range, connectdata::dynamically_allocated_data::rangeline, HTTP::readbytecount, readmoredata(), connectdata::dynamically_allocated_data::ref, DynamicStatic::referer, connectdata::remote_port, SessionHandle::reqdata, PureInfo::request_size, HandleData::resume_from, HTTP::sending, HTTP::sendit, SessionHandle::set, SessionHandle::state, UrlState::this_is_a_follow, UserDefined::timecondition, UserDefined::timevalue, TINY_INITIAL_POST_SIZE, TRUE, ConnectBits::tunnel_proxy, connectdata::dynamically_allocated_data::uagent, UserDefined::upload, ConnectBits::upload_chunky, DynamicStatic::url, DynamicStatic::url_alloc, HandleData::use_range, UserDefined::useragent, connectdata::dynamically_allocated_data::userpwd, Cookie::value, and HTTP::writebytecount.

Referenced by CreateConnection().

CURLcode Curl_http_auth_act ( struct connectdata conn  ) 

CURLcode Curl_http_connect ( struct connectdata conn,
bool done 
)

CURLcode Curl_http_done ( struct connectdata conn,
CURLcode  status,
bool  premature 
)

CURLcode Curl_http_input_auth ( struct connectdata conn,
int  httpcode,
char *  header 
)

static CURLcode Curl_http_output_auth ( struct connectdata conn,
char *  request,
char *  path,
bool  proxytunnel 
) [static]

Curl_http_output_auth() setups the authentication headers for the host/proxy and the correct authentication method. conn->data->state.authdone is set to TRUE when authentication is done.

Parameters:
conn all information about the current connection
request pointer to the request keyword
path pointer to the requested path
proxytunnel boolean if this is the request setting up a "proxy tunnel"
Returns:
CURLcode

Definition at line 386 of file http.c.

References UrlState::authhost, UrlState::authproxy, connectdata::bits, checkheaders(), Curl_output_basic(), Curl_output_digest(), Curl_output_ntlm(), curl_strequal(), CURLAUTH_BASIC, CURLAUTH_DIGEST, CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, CURLE_OK, connectdata::data, DEBUGASSERT, auth::done, FALSE, UrlState::first_host, connectdata::host, UserDefined::http_disable_hostname_check_before_authentication, ConnectBits::httpproxy, infof, auth::multi, hostname::name, ConnectBits::netrc, NULL, auth::picked, ConnectBits::proxy_user_passwd, connectdata::proxyuser, SessionHandle::set, SessionHandle::state, UrlState::this_is_a_follow, TRUE, ConnectBits::tunnel_proxy, connectdata::user, ConnectBits::user_passwd, and auth::want.

Referenced by Curl_http(), and Curl_proxyCONNECT().

int Curl_http_should_fail ( struct connectdata conn  ) 

Curl_http_should_fail() determines whether an HTTP response has gotten us into an error state or not.

Parameters:
conn all information about the current connection
Return values:
0 communications should continue
1 communications should not continue

Definition at line 678 of file http.c.

References UrlState::authproblem, connectdata::bits, connectdata::data, DEBUGASSERT, UserDefined::http_fail_on_error, Curl_transfer_keeper::httpcode, UserDefined::httpreq, HTTPREQ_GET, infof, HandleData::keep, HandleData::newurl, ConnectBits::proxy_user_passwd, SessionHandle::reqdata, HandleData::resume_from, SessionHandle::set, SessionHandle::state, TRUE, and ConnectBits::user_passwd.

Referenced by Curl_http_auth_act(), and Curl_readwrite().

CURLcode Curl_https_connecting ( struct connectdata conn,
bool done 
)

static CURLcode Curl_output_basic ( struct connectdata conn,
bool  proxy 
) [static]

CURLcode Curl_proxyCONNECT ( struct connectdata conn,
int  sockindex,
char *  hostname,
int  remote_port 
)

static CURLcode expect100 ( struct SessionHandle data,
send_buffer req_buffer 
) [static]

static CURLcode perhapsrewind ( struct connectdata conn  )  [static]

static bool pickoneauth ( struct auth pick  )  [static]

static size_t readmoredata ( char *  buffer,
size_t  size,
size_t  nitems,
void *  userp 
) [static]


Generated on Sun May 25 00:20:06 2008 by  doxygen 1.5.6