Loading...
Searching...
No Matches
globus_xio_http.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined GLOBUS_XIO_DRIVER_HTTP_H
#define GLOBUS_XIO_DRIVER_HTTP_H 1
#include "globus_xio.h"
#ifdef __cplusplus
extern "C" {
#endif
* @brief HTTP Header
* @ingroup globus_xio_http_driver
*/
typedef struct
{
char * name;
char * value;
}
globus_xio_http_header_t;
* HTTP driver specific cntls
* @ingroup globus_xio_http_driver_cntls
*/
typedef enum
{
* - A Content-Length header is not present
* - The HTTP version is set to "HTTP/1.0"
* - The Connection header is set to "close"
* Attempts to set this to "chunked" with an "HTTP/1.0" client will
* fail with a GLOBUS_XIO_ERROR_HTTP_INVALID_HEADER error.
* - Content-Length: 1*Digit
* - Provide a content length for the response message. If the
* "chunked" transfer encoding is being used, then this header
* will be silently ignored by the HTTP driver.
* - Connection: close
* - The HTTP connection will be closed after the end of the data
* response is written.
*
* @return This handle control function can fail with
* - GLOBUS_XIO_ERROR_MEMORY
* - GLOBUS_XIO_ERROR_PARAMETER
* - GLOBUS_XIO_ERROR_HTTP_INVALID_HEADER
*/
/* const char * header_name,
const char * header_value */
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HEADER,
*
* If this cntl is not called by a server, then
* the default value of 200 ("Ok") will be used. If this is called on the
* client-side of an HTTP connection, the handle control will fail with a
* GLOBUS_XIO_ERROR_PARAMETER error.
*
* @return This handle control function can fail with
* - GLOBUS_XIO_ERROR_PARAMETER
*/
/* int status */
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_STATUS_CODE,
/* const char * reason */
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_REASON_PHRASE,
* @param version
* The HTTP version to be used in the server response line.
*
* If this cntl is not called by a server, then the default of
* GLOBUS_XIO_HTTP_VERSION_1_1 will be used, though no HTTP/1.1 features
* (chunking, persistent connections, etc) will be
* assumed if the client request was an HTTP/1.0 request. If this is
* called on the client-side of an HTTP connection, the handle control
* will fail with GLOBUS_XIO_ERROR_PARAMETER.
*
* @return This handle control function can fail with
* - GLOBUS_XIO_ERROR_MEMORY
* - GLOBUS_XIO_ERROR_PARAMETER
*/
/* globus_xio_http_version_t version */
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HTTP_VERSION,
GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY,
GLOBUS_XIO_HTTP_HANDLE_SET_REQUEST_HEADER
}
globus_xio_http_handle_cmd_t;
typedef enum
{
/* const char * method */
GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_METHOD,
/* globus_xio_http_version_t version */
GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HTTP_VERSION,
/* const char * header_name,
* const char * header_value */
GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HEADER,
GLOBUS_XIO_HTTP_ATTR_DELAY_WRITE_HEADER,
/* char ** method,
char ** uri,
globus_xio_http_version_t * http_version,
globus_hashtable_t * headers */
GLOBUS_XIO_HTTP_GET_REQUEST,
/* int * status_code,
char ** reason_phrase,
globus_xio_http_version_t * http_version,
globus_hashtable_t * headers */
GLOBUS_XIO_HTTP_GET_RESPONSE
}
globus_xio_http_attr_cmd_t;
typedef enum
{
GLOBUS_XIO_HTTP_ERROR_INVALID_HEADER,
GLOBUS_XIO_HTTP_ERROR_PARSE,
GLOBUS_XIO_HTTP_ERROR_NO_ENTITY,
GLOBUS_XIO_HTTP_ERROR_EOF,
GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED
}
globus_xio_http_errors_t;
typedef enum
{
GLOBUS_XIO_HTTP_VERSION_UNSET,
GLOBUS_XIO_HTTP_VERSION_1_0,
GLOBUS_XIO_HTTP_VERSION_1_1
}
globus_xio_http_version_t;
#ifdef __cplusplus
}
#endif
#endif
globus_xio_http_attr_cmd_t
globus_xio_http_attr_cmd_t
Definition globus_xio_http.h:171
globus_xio_http_handle_cmd_t
globus_xio_http_handle_cmd_t
Definition globus_xio_http.h:146
GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_METHOD
@ GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_METHOD
Definition globus_xio_http.h:174
GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HEADER
@ GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HEADER
Definition globus_xio_http.h:180
GLOBUS_XIO_HTTP_GET_REQUEST
@ GLOBUS_XIO_HTTP_GET_REQUEST
Definition globus_xio_http.h:186
GLOBUS_XIO_HTTP_ATTR_DELAY_WRITE_HEADER
@ GLOBUS_XIO_HTTP_ATTR_DELAY_WRITE_HEADER
Definition globus_xio_http.h:183
GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HTTP_VERSION
@ GLOBUS_XIO_HTTP_ATTR_SET_REQUEST_HTTP_VERSION
Definition globus_xio_http.h:177
GLOBUS_XIO_HTTP_GET_RESPONSE
@ GLOBUS_XIO_HTTP_GET_RESPONSE
Definition globus_xio_http.h:189
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_STATUS_CODE
@ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_STATUS_CODE
Definition globus_xio_http.h:152
GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY
@ GLOBUS_XIO_HTTP_HANDLE_SET_END_OF_ENTITY
Definition globus_xio_http.h:161
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HEADER
@ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HEADER
Definition globus_xio_http.h:149
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HTTP_VERSION
@ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_HTTP_VERSION
Definition globus_xio_http.h:158
GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_REASON_PHRASE
@ GLOBUS_XIO_HTTP_HANDLE_SET_RESPONSE_REASON_PHRASE
Definition globus_xio_http.h:155
globus_xio_http_errors_t
globus_xio_http_errors_t
Definition globus_xio_http.h:199
GLOBUS_XIO_HTTP_ERROR_PARSE
@ GLOBUS_XIO_HTTP_ERROR_PARSE
Definition globus_xio_http.h:209
GLOBUS_XIO_HTTP_ERROR_NO_ENTITY
@ GLOBUS_XIO_HTTP_ERROR_NO_ENTITY
Definition globus_xio_http.h:213
GLOBUS_XIO_HTTP_ERROR_INVALID_HEADER
@ GLOBUS_XIO_HTTP_ERROR_INVALID_HEADER
Definition globus_xio_http.h:205
GLOBUS_XIO_HTTP_ERROR_EOF
@ GLOBUS_XIO_HTTP_ERROR_EOF
Definition globus_xio_http.h:217
GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED
@ GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED
Definition globus_xio_http.h:221
globus_xio_http_version_t
globus_xio_http_version_t
Definition globus_xio_http.h:232
GLOBUS_XIO_HTTP_VERSION_1_0
@ GLOBUS_XIO_HTTP_VERSION_1_0
Definition globus_xio_http.h:237
GLOBUS_XIO_HTTP_VERSION_1_1
@ GLOBUS_XIO_HTTP_VERSION_1_1
Definition globus_xio_http.h:241
globus_xio_http_header_t
HTTP Header.
Definition globus_xio_http.h:133
globus_xio_http_header_t::value
char * value
Definition globus_xio_http.h:137
globus_xio_http_header_t::name
char * name
Definition globus_xio_http.h:135