1290001Sglebius/* 2290001Sglebius * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu> 3290001Sglebius * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson 4290001Sglebius * 5290001Sglebius * Redistribution and use in source and binary forms, with or without 6290001Sglebius * modification, are permitted provided that the following conditions 7290001Sglebius * are met: 8290001Sglebius * 1. Redistributions of source code must retain the above copyright 9290001Sglebius * notice, this list of conditions and the following disclaimer. 10290001Sglebius * 2. Redistributions in binary form must reproduce the above copyright 11290001Sglebius * notice, this list of conditions and the following disclaimer in the 12290001Sglebius * documentation and/or other materials provided with the distribution. 13290001Sglebius * 3. The name of the author may not be used to endorse or promote products 14290001Sglebius * derived from this software without specific prior written permission. 15290001Sglebius * 16290001Sglebius * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17290001Sglebius * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18290001Sglebius * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19290001Sglebius * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20290001Sglebius * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21290001Sglebius * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22290001Sglebius * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23290001Sglebius * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24290001Sglebius * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25290001Sglebius * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26290001Sglebius */ 27290001Sglebius#ifndef EVENT2_HTTP_COMPAT_H_INCLUDED_ 28290001Sglebius#define EVENT2_HTTP_COMPAT_H_INCLUDED_ 29290001Sglebius 30290001Sglebius/** @file event2/http_compat.h 31290001Sglebius 32290001Sglebius Potentially non-threadsafe versions of the functions in http.h: provided 33290001Sglebius only for backwards compatibility. 34290001Sglebius 35290001Sglebius */ 36290001Sglebius 37290001Sglebius#ifdef __cplusplus 38290001Sglebiusextern "C" { 39290001Sglebius#endif 40290001Sglebius 41290001Sglebius#include <event2/event-config.h> 42290001Sglebius#ifdef EVENT__HAVE_SYS_TYPES_H 43290001Sglebius#include <sys/types.h> 44290001Sglebius#endif 45290001Sglebius#ifdef EVENT__HAVE_SYS_TIME_H 46290001Sglebius#include <sys/time.h> 47290001Sglebius#endif 48290001Sglebius 49290001Sglebius/* For int types. */ 50290001Sglebius#include <event2/util.h> 51290001Sglebius 52290001Sglebius/** 53290001Sglebius * Start an HTTP server on the specified address and port 54290001Sglebius * 55290001Sglebius * @deprecated It does not allow an event base to be specified 56290001Sglebius * 57290001Sglebius * @param address the address to which the HTTP server should be bound 58290001Sglebius * @param port the port number on which the HTTP server should listen 59290001Sglebius * @return an struct evhttp object 60290001Sglebius */ 61290001Sglebiusstruct evhttp *evhttp_start(const char *address, unsigned short port); 62290001Sglebius 63290001Sglebius/** 64290001Sglebius * A connection object that can be used to for making HTTP requests. The 65290001Sglebius * connection object tries to establish the connection when it is given an 66290001Sglebius * http request object. 67290001Sglebius * 68290001Sglebius * @deprecated It does not allow an event base to be specified 69290001Sglebius */ 70290001Sglebiusstruct evhttp_connection *evhttp_connection_new( 71290001Sglebius const char *address, unsigned short port); 72290001Sglebius 73290001Sglebius/** 74290001Sglebius * Associates an event base with the connection - can only be called 75290001Sglebius * on a freshly created connection object that has not been used yet. 76290001Sglebius * 77290001Sglebius * @deprecated XXXX Why? 78290001Sglebius */ 79290001Sglebiusvoid evhttp_connection_set_base(struct evhttp_connection *evcon, 80290001Sglebius struct event_base *base); 81290001Sglebius 82290001Sglebius 83290001Sglebius/** Returns the request URI */ 84290001Sglebius#define evhttp_request_uri evhttp_request_get_uri 85290001Sglebius 86290001Sglebius#ifdef __cplusplus 87290001Sglebius} 88290001Sglebius#endif 89290001Sglebius 90290001Sglebius#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */ 91