diff options
Diffstat (limited to 'serf.h')
-rw-r--r-- | serf.h | 43 |
1 files changed, 37 insertions, 6 deletions
@@ -82,6 +82,21 @@ typedef struct serf_request_t serf_request_t; * http-compliant syntax. */ #define SERF_ERROR_BAD_HTTP_RESPONSE (APR_OS_START_USERERR + \ SERF_ERROR_RANGE + 5) +/* The server sent less data than what was announced. */ +#define SERF_ERROR_TRUNCATED_HTTP_RESPONSE (APR_OS_START_USERERR + \ + SERF_ERROR_RANGE + 6) +/* The proxy server returned an error while setting up the SSL tunnel. */ +#define SERF_ERROR_SSLTUNNEL_SETUP_FAILED (APR_OS_START_USERERR + \ + SERF_ERROR_RANGE + 7) +/* The server unexpectedly closed the connection prematurely. */ +#define SERF_ERROR_ABORTED_CONNECTION (APR_OS_START_USERERR + \ + SERF_ERROR_RANGE + 8) + +/* SSL certificates related errors */ +#define SERF_ERROR_SSL_CERT_FAILED (APR_OS_START_USERERR + SERF_ERROR_RANGE + 70) + +/* SSL communications related errors */ +#define SERF_ERROR_SSL_COMM_FAILED (APR_OS_START_USERERR + SERF_ERROR_RANGE + 71) /* General authentication related errors */ #define SERF_ERROR_AUTHN_FAILED (APR_OS_START_USERERR + SERF_ERROR_RANGE + 90) @@ -99,7 +114,8 @@ typedef struct serf_request_t serf_request_t; /* This macro groups errors potentially raised when reading a http response. */ #define SERF_BAD_RESPONSE_ERROR(status) ((status) \ && ((SERF_ERROR_DECOMPRESSION_FAILED == (status)) \ - ||(SERF_ERROR_BAD_HTTP_RESPONSE == (status)))) + ||(SERF_ERROR_BAD_HTTP_RESPONSE == (status)) \ + ||(SERF_ERROR_TRUNCATED_HTTP_RESPONSE == (status)))) /** * Return a string that describes the specified error code. @@ -366,9 +382,10 @@ typedef apr_status_t (*serf_credentials_callback_t)( /** * Create a new connection associated with the @a ctx serf context. * - * A connection will be created to (eventually) connect to the address - * specified by @a address. The address must live at least as long as - * @a pool (thus, as long as the connection object). + * If no proxy server is configured, a connection will be created to + * (eventually) connect to the address specified by @a address. The address must + * live at least as long as @a pool (thus, as long as the connection object). + * If a proxy server is configured, @address will be ignored. * * The connection object will be allocated within @a pool. Clearing or * destroying this pool will close the connection, and terminate any @@ -556,6 +573,20 @@ serf_request_t *serf_connection_priority_request_create( serf_request_setup_t setup, void *setup_baton); + +/** Returns detected network latency for the @a conn connection. Negative + * value means that latency is unknwon. + */ +apr_interval_time_t serf_connection_get_latency(serf_connection_t *conn); + +/** Check if a @a request has been completely written. + * + * Returns APR_SUCCESS if the request was written completely on the connection. + * Returns APR_EBUSY if the request is not yet or partially written. + */ +apr_status_t serf_request_is_written( + serf_request_t *request); + /** * Cancel the request specified by the @a request object. * @@ -1030,8 +1061,8 @@ void serf_debug__bucket_alloc_check( /* Version info */ #define SERF_MAJOR_VERSION 1 -#define SERF_MINOR_VERSION 1 -#define SERF_PATCH_VERSION 0 +#define SERF_MINOR_VERSION 2 +#define SERF_PATCH_VERSION 1 /* Version number string */ #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ |