• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/programs/libcprops/http.h

Go to the documentation of this file.
00001 #ifndef _CP_HTTP_H
00002 #define _CP_HTTP_H
00003 
00004 /**
00005  * @addtogroup cp_socket
00006  */
00007 /** @{ */
00008 /**
00009  * @file
00010  * basic http feature implementations. the intention is to offer a simple way
00011  * of providing services to http based clients. 
00012  */
00013 
00014 #include "config.h"
00015 #include "common.h"
00016 
00017 #ifdef _WINDOWS
00018 #include <Winsock2.h>
00019 #endif
00020 
00021 __BEGIN_DECLS
00022 
00023 #include "hashtable.h"
00024 #include "trie.h"
00025 #include "vector.h"
00026 #include "socket.h"
00027 #include "str.h"
00028 
00029 #include <string.h>
00030 #include <time.h>
00031 
00032 /* HTTP 1.1 defines these methods (rfc 2616)
00033  * 
00034  *     Method         = "OPTIONS"
00035  *                    | "GET"   
00036  *                    | "HEAD"  
00037  *                    | "POST"  
00038  *                    | "PUT"   
00039  *                    | "DELETE"
00040  *                    | "TRACE" 
00041  *                    | "CONNECT"
00042  *
00043  *     general-header = Cache-Control     
00044  *                    | Connection        
00045  *                    | Date              
00046  *                    | Pragma            
00047  *                    | Trailer           
00048  *                    | Transfer-Encoding 
00049  *                    | Upgrade           
00050  *                    | Via               
00051  *                    | Warning           
00052  *
00053  *
00054  * 
00055  *     request-header = Accept             
00056  *                    | Accept-Charset     
00057  *                    | Accept-Encoding    
00058  *                    | Accept-Language    
00059  *                    | Authorization      
00060  *                    | Expect             
00061  *                    | From               
00062  *                    | Host               
00063  *                    | If-Match           
00064  *                    | If-Modified-Since  
00065  *                    | If-None-Match      
00066  *                    | If-Range           
00067  *                    | If-Unmodified-Since
00068  *                    | Max-Forwards       
00069  *                    | Proxy-Authorization
00070  *                    | Range              
00071  *                    | Referer            
00072  *                    | TE                 
00073  *                    | User-Agent         
00074  *
00075  *
00076  *     entity-header  = Allow              
00077  *                    | Content-Encoding   
00078  *                    | Content-Language   
00079  *                    | Content-Length     
00080  *                    | Content-Location   
00081  *                    | Content-MD5        
00082  *                    | Content-Range      
00083  *                    | Content-Type       
00084  *                    | Expires            
00085  *                    | Last-Modified      
00086  *
00087  *
00088  *     Status-Code    = "100"  : Continue
00089  *                    | "101"  : Switching Protocols
00090  *                    | "200"  : OK
00091  *                    | "201"  : Created
00092  *                    | "202"  : Accepted
00093  *                    | "203"  : Non-Authoritative Information
00094  *                    | "204"  : No Content
00095  *                    | "205"  : Reset Content
00096  *                    | "206"  : Partial Content
00097  *                    | "300"  : Multiple Choices
00098  *                    | "301"  : Moved Permanently
00099  *                    | "302"  : Found
00100  *                    | "303"  : See Other
00101  *                    | "304"  : Not Modified
00102  *                    | "305"  : Use Proxy
00103  *                    | "307"  : Temporary Redirect
00104  *                    | "400"  : Bad Request
00105  *                    | "401"  : Unauthorized
00106  *                    | "402"  : Payment Required
00107  *                    | "403"  : Forbidden
00108  *                    | "404"  : Not Found
00109  *                    | "405"  : Method Not Allowed
00110  *                    | "406"  : Not Acceptable
00111  *                    | "407"  : Proxy Authentication Required
00112  *                    | "408"  : Request Time-out
00113  *                    | "409"  : Conflict
00114  *                    | "410"  : Gone
00115  *                    | "411"  : Length Required
00116  *                    | "412"  : Precondition Failed
00117  *                    | "413"  : Request Entity Too Large
00118  *                    | "414"  : Request-URI Too Large
00119  *                    | "415"  : Unsupported Media Type
00120  *                    | "416"  : Requested range not satisfiable
00121  *                    | "417"  : Expectation Failed
00122  *                    | "500"  : Internal Server Error
00123  *                    | "501"  : Not Implemented
00124  *                    | "502"  : Bad Gateway
00125  *                    | "503"  : Service Unavailable
00126  *                    | "504"  : Gateway Time-out
00127  *                    | "505"  : HTTP Version not supported
00128  *
00129  * 
00130  *
00131  *    response-header = Accept-Ranges           ; Section 14.5
00132  *                    | Age                     ; Section 14.6
00133  *                    | ETag                    ; Section 14.19
00134  *                    | Location                ; Section 14.30
00135  *                    | Proxy-Authenticate      ; Section 14.33
00136  *                    | Retry-After             ; Section 14.37
00137  *                    | Server                  ; Section 14.38
00138  *                    | Vary                    ; Section 14.44
00139  *                    | WWW-Authenticate        ; Section 14.47
00140  *
00141  */
00142 
00143 /** HTTP request types */
00144 typedef CPROPS_DLL enum 
00145 { 
00146         OPTIONS, 
00147         GET, 
00148         HEAD, 
00149         POST, 
00150         PUT, 
00151 #ifndef _WINDOWS
00152         DELETE, 
00153 #endif
00154         TRACE, 
00155         CONNECT 
00156 } cp_http_request_type;
00157 
00158 CPROPS_DLL
00159 char *get_http_request_type_lit(cp_http_request_type type);
00160 
00161 /** HTTP versions */
00162 typedef CPROPS_DLL enum { HTTP_1_0, HTTP_1_1} cp_http_version;
00163 
00164 /** HTTP status codes */
00165 typedef CPROPS_DLL enum 
00166 {
00167         HTTP_NULL_STATUS = -1,
00168         HTTP_100_CONTINUE = 100,
00169         HTTP_101_SWITCHING_PROTOCOLS = 101,
00170         HTTP_200_OK = 200,
00171         HTTP_201_CREATED = 201,
00172         HTTP_202_ACCEPTED = 202,
00173         HTTP_203_NON_AUTHORITATIVE_INFORMATION = 203,
00174         HTTP_204_NO_CONTENT = 204,
00175         HTTP_205_RESET_CONTENT = 205,
00176         HTTP_206_PARTIAL_CONTENT = 206,
00177         HTTP_300_MULTIPLE_CHOICES = 300,
00178         HTTP_301_MOVED_PERMANENTLY = 301,
00179         HTTP_302_FOUND = 302,
00180         HTTP_303_SEE_OTHER = 303,
00181         HTTP_304_NOT_MODIFIED = 304,
00182         HTTP_305_USE_PROXY = 305,
00183         HTTP_307_TEMPORARY_REDIRECT = 307,
00184         HTTP_400_BAD_REQUEST = 400,
00185         HTTP_401_UNAUTHORIZED = 401,
00186         HTTP_402_PAYMENT_REQUIRED = 402,
00187         HTTP_403_FORBIDDEN = 403,
00188         HTTP_404_NOT_FOUND = 404,
00189         HTTP_405_METHOD_NOT_ALLOWED = 405,
00190         HTTP_406_NOT_ACCEPTABLE = 406,
00191         HTTP_407_PROXY_AUTHENTICATION_REQUIRED = 407,
00192         HTTP_408_REQUEST_TIME_OUT = 408,
00193         HTTP_409_CONFLICT = 409,
00194         HTTP_410_GONE = 410,
00195         HTTP_411_LENGTH_REQUIRED = 411,
00196         HTTP_412_PRECONDITION_FAILED = 412,
00197         HTTP_413_REQUEST_ENTITY_TOO_LARGE = 413,
00198         HTTP_414_REQUEST_URI_TOO_LARGE = 414,
00199         HTTP_415_UNSUPPORTED_MEDIA_TYPE = 415,
00200         HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
00201         HTTP_417_EXPECTATION_FAILED = 417,
00202         HTTP_500_INTERNAL_SERVER_ERROR = 500,
00203         HTTP_501_NOT_IMPLEMENTED = 501,
00204         HTTP_502_BAD_GATEWAY = 502,
00205         HTTP_503_SERVICE_UNAVAILABLE = 503,
00206         HTTP_504_GATEWAY_TIME_OUT = 504,
00207         HTTP_505_HTTP_VERSION_NOT_SUPPORTED = 505
00208 } cp_http_status_code;
00209 
00210 /** 
00211  * connection handling policy. HTTP_CONNECTION_POLICY_DEFAULT defaults to 
00212  * HTTP_CONNECTION_POLICY_CLOSE for HTTP/1.0 and to 
00213  * HTTP_CONNECTION_POLICY_KEEP_ALIVE for HTTP/1.1.
00214  */
00215 typedef CPROPS_DLL enum
00216 { 
00217         HTTP_CONNECTION_POLICY_DEFAULT,
00218         HTTP_CONNECTION_POLICY_CLOSE, 
00219         HTTP_CONNECTION_POLICY_KEEP_ALIVE
00220 } connection_policy;
00221 
00222 typedef CPROPS_DLL enum
00223 {
00224         TEXT,
00225         HTML,
00226         JPEG
00227 } cp_http_content_type;
00228 
00229 #define DEFAULT_SERVER_NAME "libcprops-0.1.8"
00230 
00231 #define DEFAULT_KEEPALIVE 300
00232 
00233 #ifndef HTTP_KEEPALIVE
00234 #define HTTP_KEEPALIVE DEFAULT_KEEPALIVE
00235 #endif
00236 
00237 #ifndef MAX_URL_LENGTH
00238 #define MAX_URL_LENGTH   0x400
00239 #endif
00240 
00241 /** recommended to call before using cp_httpsocket api */
00242 CPROPS_DLL
00243 int cp_http_init();
00244 
00245 /** call to perform cleanup after using cp_httpsocket api */
00246 CPROPS_DLL
00247 void cp_http_shutdown();
00248 
00249 #ifdef CP_USE_COOKIES
00250 
00251 #ifndef MAX_COOKIE_LENGTH
00252 #define MAX_COOKIE_LENGTH   0x1000
00253 #endif /* MAX_COOKIE_LENGTH */
00254 
00255 /* Wdy, DD-Mon-YYYY HH:MM:SS GMT */
00256 #define COOKIE_TIME_FMT "a, 0-b-Y H:M: GMT"
00257 #endif /* CP_USE_COOKIES */
00258 
00259 #ifdef CP_USE_HTTP_SESSIONS
00260 
00261 #define CP_HTTP_SESSION_PRM "CPSID"
00262 #define CP_HTTP_SESSION_MARKER "CPSID="
00263 #define CP_HTTP_SESSION_MARKER_LEN 6
00264 
00265 #define DEFAULT_SESSION_VALIDITY 86400 /* 24 hours */
00266 
00267 /** 
00268  * call from signal handler to stop sockets in waiting select() and close all 
00269  * connections
00270  */
00271 CPROPS_DLL
00272 void cp_httpsocket_stop_all();
00273 
00274 /** 
00275  * cp_http_sessions are implemented with cookies if configured to use them and
00276  * supported by client or with url rewriting otherwise. 
00277  */
00278 typedef CPROPS_DLL enum 
00279 { 
00280 #ifdef CP_USE_COOKIES
00281         SESSION_TYPE_COOKIE = 1, 
00282 #endif /* CP_USE_COOKIES */
00283         SESSION_TYPE_URLREWRITE = 2 
00284 } cp_http_session_type;
00285 
00286 typedef CPROPS_DLL struct _cp_http_session
00287 {
00288         char *sid;                                      /**< reasonably unique session id          */
00289         cp_http_session_type type;      /**< session handling scheme               */
00290         time_t created;                         /**< creation time                         */
00291         time_t access;                          /**< last access                           */
00292         long validity;                          /**< validity period in seconds            */
00293         short renew_on_access;      /**< validity calculated from last access? */
00294         cp_hashtable *key;                      /**< session data table                    */
00295         short valid;                            /**< currently valid                       */
00296         short fresh;                            /**< newly created                         */
00297         int refcount;                           /**< reference count                       */
00298 } cp_http_session;
00299 
00300 /** retrieve the value stored on the session under the given key */
00301 CPROPS_DLL
00302 void *cp_http_session_get(cp_http_session *session, char *key);
00303 /** set a (key, value) pair */
00304 CPROPS_DLL
00305 void *cp_http_session_set(cp_http_session *session, 
00306                                  char *key, void *value);
00307 /** set a (key, value) pair with a given destructor function for the value */
00308 CPROPS_DLL
00309 void *cp_http_session_set_dtr(cp_http_session *session, 
00310                                       char *key, void *value, 
00311                                                           cp_destructor_fn dtr);
00312 /** set validity period in seconds */
00313 CPROPS_DLL
00314 void cp_http_session_set_validity(cp_http_session *session, long sec);
00315 /** session has not yet been joined by client */
00316 CPROPS_DLL
00317 short cp_http_session_is_fresh(cp_http_session *session);
00318 /** (internal) deallocate an http session descriptor */
00319 CPROPS_DLL
00320 void cp_http_session_delete(cp_http_session *session);
00321 
00322 #endif /* CP_USE_HTTP_SESSIONS */
00323 
00324 
00325 struct CPROPS_DLL _cp_httpsocket;
00326                 
00327 /** http request descriptor */
00328 typedef CPROPS_DLL struct _cp_http_request
00329 {
00330         cp_http_request_type type;              /**< GET, POST etc                     */
00331         cp_http_version version;                /**< HTTP_1_0, HTTP_1_1                */
00332         char *uri;                                              /**< request uri                       */
00333         cp_hashtable *header;                   /**< table of headers                  */
00334         char *query_string;             /**< raw query string                  */
00335         cp_hashtable *prm;                              /**< table of GET/POST parameters      */
00336         cp_vector *prm_name;                    /**< parameter vector                  */
00337 #ifdef CP_USE_COOKIES
00338         cp_vector *cookie;                              /**< cookies                           */
00339 #endif
00340         char *content;                                  /**< request content                   */
00341         struct _cp_httpsocket *owner;   /**< owning socket                     */
00342         cp_connection_descriptor *connection; /**< connection descriptor       */
00343 #ifdef CP_USE_HTTP_SESSIONS
00344         cp_http_session *session;               /**< http session descriptor           */
00345 #endif
00346 } cp_http_request;
00347 
00348 /** parse an http request */
00349 CPROPS_DLL
00350 cp_http_request *cp_http_request_parse(struct _cp_httpsocket *owner, 
00351                                                char *request, 
00352                                        int *err);
00353 /** deallocate an http request descriptor */
00354 CPROPS_DLL
00355 void cp_http_request_delete(cp_http_request *request);
00356 /** return value of specified header or NULL if none */
00357 CPROPS_DLL
00358 char *cp_http_request_get_header(cp_http_request *request, char *name);
00359 /** return a newly allocated array of header names */
00360 CPROPS_DLL
00361 char **cp_http_request_get_headers(cp_http_request *request);
00362 /** return a single parameter with the specified name */
00363 CPROPS_DLL
00364 char *cp_http_request_get_parameter(cp_http_request *request, char *name);
00365 /** return vector of GET or POST parameters with specified name */
00366 CPROPS_DLL
00367 cp_vector *cp_http_request_get_param_vector(cp_http_request *request, char *name);
00368 /** return all GET or POST parameters for given request */
00369 CPROPS_DLL
00370 cp_vector *cp_http_request_get_params(cp_http_request *request);
00371 #ifdef CP_USE_HTTP_SESSIONS
00372 /** return existing or create cp_http_session for given request */
00373 CPROPS_DLL
00374 cp_http_session *cp_http_request_get_session(cp_http_request *request, 
00375                                                      int create);
00376 #endif
00377 /** dump a cp_http_request descriptor (uses cp_info) */
00378 CPROPS_DLL
00379 void cp_http_request_dump(cp_http_request *req);
00380 
00381 /** http response holder */
00382 typedef CPROPS_DLL struct _cp_http_response
00383 {
00384         cp_http_version version;                        /**< HTTP_1_0, HTTP_1_1            */
00385         cp_http_status_code status;                     /**< http return code (rfc 2616)   */
00386         cp_http_request *request;                       /**< originating request           */
00387         char *servername;                                       /**< Server header                 */
00388         connection_policy connection;           /**< Keep-Alive, Close             */
00389         cp_hashtable *header;                           /**< headers                       */
00390 #ifdef CP_USE_COOKIES
00391         cp_vector *cookie;                                      /**< cookies                       */
00392 #endif
00393         cp_http_content_type content_type;      /**< deprecated                    */
00394         char *content_type_lit;                         /**< content type string           */
00395         char *body;                                             /**< deprecated                    */
00396         cp_string *content;                                     /**< content                       */
00397         int len;                                                        
00398         short skip;                                                     /**< skip flag                     */
00399         char *status_lit;                   /**< remote server code literal    */
00400 } cp_http_response;
00401 
00402 /** (internal) create a new response descriptor */
00403 CPROPS_DLL
00404 cp_http_response *cp_http_response_create(cp_http_request *request);
00405 /** (internal) deallocate a response descriptor */
00406 CPROPS_DLL
00407 void cp_http_response_delete(cp_http_response *res);
00408 /** deallocate a response descriptor */
00409 CPROPS_DLL
00410 void cp_http_response_destroy(cp_http_response *res);
00411 /** (internal) output an http response on given connection */
00412 CPROPS_DLL
00413 int cp_http_response_write(cp_connection_descriptor *cdesc, 
00414                                                    cp_http_response *res);
00415 
00416 /** set the status code on an http response */
00417 CPROPS_DLL
00418 void cp_http_response_set_status(cp_http_response *response, 
00419                                                 cp_http_status_code code);
00420 /** get the status code of an http response */
00421 CPROPS_DLL
00422 cp_http_status_code cp_http_response_get_status(cp_http_response *response);
00423 /** deprecated - use cp_http_response_set_content_type_string */
00424 CPROPS_DLL
00425 void cp_http_response_set_content_type(cp_http_response *response, 
00426                                        cp_http_content_type type);
00427 /** set the Content-Type header on an http response */
00428 CPROPS_DLL
00429 void cp_http_response_set_content_type_string(cp_http_response *response,
00430                                               char *content_type_lit);
00431 /** get the Content-Type header value for an http response */
00432 CPROPS_DLL
00433 char *cp_http_response_get_content_type(cp_http_response *response);
00434 /** set an arbitrary header on an http response */
00435 CPROPS_DLL
00436 void cp_http_response_set_header(cp_http_response *response, 
00437                                                 char *name, char *value);
00438 /** retrieve header content for one header */
00439 CPROPS_DLL
00440 char *cp_http_response_get_header(cp_http_response *response, char *name);
00441 /** returns a vector containing header names */
00442 CPROPS_DLL
00443 cp_vector *cp_http_response_get_header_names(cp_http_response *response);
00444 /** deprecated - use cp_http_response_set_content instead */
00445 CPROPS_DLL
00446 void cp_http_response_set_body(cp_http_response *response, 
00447                                           char *body);
00448 /** set the (possibly binary) content on an http response */
00449 CPROPS_DLL
00450 void cp_http_response_set_content(cp_http_response *response, 
00451                                                  cp_string *content);
00452 /** get the content of an http response */
00453 CPROPS_DLL
00454 cp_string *cp_http_response_get_content(cp_http_response *response);
00455 
00456 /** set the Connection header on a cp_http_response descriptor */
00457 CPROPS_DLL
00458 void cp_http_response_set_connection_policy(cp_http_response *response, 
00459                                                     connection_policy policy);
00460 
00461 #ifdef CP_USE_COOKIES
00462 /** add a Set-Cookie header to a cp_http_response descriptor */
00463 CPROPS_DLL
00464 int cp_http_response_set_cookie(cp_http_response *response, char *name, 
00465                 char *content, char *host, char *path, long validity, int secure);
00466 #endif
00467 
00468 /** 
00469  * sets the 'skip' flag on an http response, which prevents the response being
00470  * deserialized and written to the client by the http framework. this is 
00471  * needed if the service function writes directly to the underlying socket.
00472  */
00473 CPROPS_DLL
00474 void cp_http_response_skip(cp_http_response *response);
00475 
00476 /** set up a response reporting an error */
00477 CPROPS_DLL
00478 void cp_http_response_report_error(cp_http_response *response, 
00479                                            cp_http_status_code code, 
00480                                                                    char *message);
00481 
00482 /** service function prototype */
00483 typedef int (*cp_http_service_callback)(cp_http_request *request, 
00484                                                                             cp_http_response *response);
00485 
00486 /** http server socket */
00487 typedef CPROPS_DLL struct _cp_httpsocket
00488 {
00489         int id;                                 /**< system assigned id                        */
00490         cp_socket *sock;                /**< underlying socket                         */
00491         int keepalive;                  /**< keep-alive in seconds                     */
00492 #ifdef CP_USE_HTTP_SESSIONS
00493         cp_hashlist *session;   /**< active session table                      */
00494         cp_hashlist *pending;   /**< pending response list                     */
00495 #endif
00496         cp_trie *service;               /**< registered services (excluding default)   */
00497         cp_http_service_callback default_service;       /**< default service       */
00498         char *server_name;              /**< server name                               */
00499 } cp_httpsocket;
00500 
00501 
00502 /** 
00503  * http service descriptor
00504  */
00505 typedef CPROPS_DLL struct _cp_http_service
00506 {
00507         char *name;                                             /**< descriptive name */
00508         char *path;                                                     /**< base uri         */
00509         cp_http_service_callback service;   /**< service function */
00510 } cp_http_service;
00511 
00512 CPROPS_DLL
00513 void *cp_http_thread_fn(void *prm);
00514 
00515 /** create a cp_http_socket with the specified default cp_http_service */
00516 CPROPS_DLL
00517 cp_httpsocket *
00518     cp_httpsocket_create(int port, cp_http_service_callback default_service);
00519 #ifdef CP_USE_SSL
00520 /** 
00521  * create an ssl enabled cp_httpsocket structure. certificate_file and key_file
00522  * are paths to certificate and key in pem format.
00523  */
00524 CPROPS_DLL
00525 cp_httpsocket *
00526     cp_httpsocket_create_ssl(int port, 
00527                                          cp_http_service_callback default_service,
00528                                                          char *certificate_file, 
00529                                                          char *key_file, 
00530                                                          int verification_mode);
00531 #endif
00532 /** deallocate a cp_httpsocket structure */
00533 CPROPS_DLL
00534 void cp_httpsocket_delete(cp_httpsocket *svc);
00535 
00536 /** set value for Keep-Alive header */
00537 CPROPS_DLL
00538 void cp_httpsocket_set_keepalive(cp_httpsocket *socket, int sec);
00539 /** set value for Server header */
00540 CPROPS_DLL
00541 void cp_httpsocket_set_server_name(cp_httpsocket *socket, char *name);
00542 /** 
00543  * set maximal number of queued requests before accept() starts refusing
00544  * connections
00545  */
00546 CPROPS_DLL
00547 void cp_httpsocket_set_backlog(cp_httpsocket *socket, int backlog);
00548 /** set time to block in accept */
00549 CPROPS_DLL
00550 void cp_httpsocket_set_delay(cp_httpsocket *socket, struct timeval delay);
00551 /* set sec. to block in accept() */
00552 CPROPS_DLL
00553 void cp_httpsocket_set_delay_sec(cp_httpsocket *socket, long sec);
00554 /** set micro sec. to block in accept() */
00555 CPROPS_DLL
00556 void cp_httpsocket_set_delay_usec(cp_httpsocket *socket, long usec);
00557 /** set lower limit on thread pool size */
00558 CPROPS_DLL
00559 void cp_httpsocket_set_poolsize_min(cp_httpsocket *socket, int min);
00560 /** set upper limit on thread pool size */
00561 CPROPS_DLL
00562 void cp_httpsocket_set_poolsize_max(cp_httpsocket *socket, int max);
00563 
00564 /** called when closing a socket */
00565 CPROPS_DLL
00566 void *cp_httpsocket_add_shutdown_callback(cp_httpsocket *socket, 
00567                                                                                   void (*cb)(void *),
00568                                                                                   void *prm);
00569 
00570 /** puts socket in listening mode */
00571 CPROPS_DLL
00572 int cp_httpsocket_listen(cp_httpsocket *sock);
00573 
00574 /** 
00575  * create a new cp_http_service descriptor. client requests for uris beginning
00576  * with 'path' will be delegated to this service once registered on a listening
00577  * socket.
00578  */
00579 CPROPS_DLL
00580 cp_http_service *cp_http_service_create(char *name, 
00581                                                                         char *path, 
00582                                                                         cp_http_service_callback service);
00583 /** deallocate a cp_http_service descriptor */
00584 CPROPS_DLL
00585 void cp_http_service_delete(cp_http_service *svc);
00586 
00587 /** register a service on a socket */
00588 CPROPS_DLL
00589 int cp_httpsocket_register_service(cp_httpsocket *server, cp_http_service *service);
00590 /** unregister a service on a socket */
00591 CPROPS_DLL
00592 void *cp_httpsocket_unregister_service(cp_httpsocket *server, cp_http_service *service);
00593 
00594 /** called when shutting down http layer */
00595 CPROPS_DLL
00596 void *cp_http_add_shutdown_callback(void (*cb)(void *), void *prm);
00597 
00598 __END_DECLS
00599 /** @} */
00600 
00601 #endif
00602 

Generated on Fri Oct 22 2010 11:02:22 for SST by  doxygen 1.7.1