- Timestamp:
- Sep 27, 2010 8:35:08 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/include/pjlib-util/http_client.h
r3227 r3321 50 50 51 51 /** 52 * HTTP header representation. 53 */ 54 typedef struct pj_http_header_elmt 55 { 56 pj_str_t name; /**< Header name */ 57 pj_str_t value; /**< Header value */ 58 } pj_http_header_elmt; 59 60 /** 52 61 * This structure describes http request/response headers. 53 62 * Application should call #pj_http_headers_add_elmt() to … … 56 65 typedef struct pj_http_headers 57 66 { 58 unsigned count; /**< Number of header fields */ 59 struct pj_http_header_elmt 60 { 61 pj_str_t name; 62 pj_str_t value; 63 } header[PJ_HTTP_HEADER_SIZE]; /**< Header elements/fields */ 67 /**< Number of header fields */ 68 unsigned count; 69 70 /** Header elements/fields */ 71 pj_http_header_elmt header[PJ_HTTP_HEADER_SIZE]; 64 72 } pj_http_headers; 73 74 /** 75 * Structure to save HTTP authentication credential. 76 */ 77 typedef struct pj_http_auth_cred 78 { 79 /** 80 * Specify specific authentication schemes to be responded. Valid values 81 * are "basic" and "digest". If this field is not set, any authentication 82 * schemes will be responded. 83 * 84 * Default is empty. 85 */ 86 pj_str_t scheme; 87 88 /** 89 * Specify specific authentication realm to be responded. If this field 90 * is set, only 401/407 response with matching realm will be responded. 91 * If this field is not set, any realms will be responded. 92 * 93 * Default is empty. 94 */ 95 pj_str_t realm; 96 97 /** 98 * Specify authentication username. 99 * 100 * Default is empty. 101 */ 102 pj_str_t username; 103 104 /** 105 * The type of password in \a data field. Currently only 0 is 106 * supported, meaning the \a data contains plain-text password. 107 * 108 * Default is 0. 109 */ 110 unsigned data_type; 111 112 /** 113 * Specify authentication password. The encoding of the password depends 114 * on the value of \a data_type field above. 115 * 116 * Default is empty. 117 */ 118 pj_str_t data; 119 120 } pj_http_auth_cred; 121 65 122 66 123 /** … … 126 183 /**< will be provided later */ 127 184 } reqdata; 185 186 /** 187 * Authentication credential needed to respond to 401/407 response. 188 */ 189 pj_http_auth_cred auth_cred; 190 128 191 } pj_http_req_param; 192 193 /** 194 * HTTP authentication challenge, parsed from WWW-Authenticate header. 195 */ 196 typedef struct pj_http_auth_chal 197 { 198 pj_str_t scheme; /**< Auth scheme. */ 199 pj_str_t realm; /**< Realm for the challenge. */ 200 pj_str_t domain; /**< Domain. */ 201 pj_str_t nonce; /**< Nonce challenge. */ 202 pj_str_t opaque; /**< Opaque value. */ 203 int stale; /**< Stale parameter. */ 204 pj_str_t algorithm; /**< Algorithm parameter. */ 205 pj_str_t qop; /**< Quality of protection. */ 206 } pj_http_auth_chal; 129 207 130 208 /** … … 137 215 pj_str_t reason; /**< Reason phrase */ 138 216 pj_http_headers headers; /**< Response headers */ 139 /** 140 * The value of content-length header field. -1 if not 141 * specified. 142 */ 143 pj_int32_t content_length; 217 pj_http_auth_chal auth_chal; /**< Parsed WWW-Authenticate header, if 218 any. */ 219 pj_int32_t content_length; /**< The value of content-length header 220 field. -1 if not specified. */ 144 221 void *data; /**< Data received */ 145 222 pj_size_t size; /**< Data size */ … … 151 228 typedef struct pj_http_url 152 229 { 230 pj_str_t username; /**< Username part */ 231 pj_str_t passwd; /**< Password part */ 153 232 pj_str_t protocol; /**< Protocol used */ 154 233 pj_str_t host; /**< Host name */
Note: See TracChangeset
for help on using the changeset viewer.