1 /***** 2 * HTTPP.h : Private HTTP.c header file. 3 * 4 * This file Version $Revision$ 5 * 6 * Creation date: Tue Oct 21 01:57:37 GMT+0100 1997 7 * Last modification: $Date$ 8 * By: $Author$ 9 * Current State: $State$ 10 * 11 * Author: Richard Offer 12 * 13 * Copyright (C) 1994-1997 by Richard Offer <offer@sgi.com> 14 * All Rights Reserved 15 * 16 * This file is part of insert_program_name_here 17 * 18 * This library is free software; you can redistribute it and/or 19 * modify it under the terms of the GNU Library General Public 20 * License as published by the Free Software Foundation; either 21 * version 2 of the License, or (at your option) any later version. 22 * 23 * This library is distributed in the hope that it will be useful, 24 * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 * Library General Public License for more details. 27 * 28 * You should have received a copy of the GNU Library General Public 29 * License along with this library; if not, write to the Free 30 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 31 * 32 *****/ 33 /***** 34 * $Source$ 35 *****/ 36 /***** 37 * ChangeLog 38 * $Log$ 39 * Revision 1.1 2011/06/30 16:09:09 rwcox 40 * Cadd 41 * 42 * Revision 1.1 1997/10/23 00:28:29 newt 43 * Initial Revision 44 * 45 *****/ 46 47 #ifndef _HTTPP_h_ 48 #define _HTTPP_h_ 49 50 #include <http/HTTP.h> 51 52 #define HTTP_VERSION_09 900 53 #define HTTP_VERSION_10 1000 54 #define HTTP_VERSION_11 1100 55 56 #define DEFAULT_TIMEOUT 5 /* default connect() and select() timeout */ 57 #define DEFAULT_RETRY 0 /* default retry if select() fails */ 58 59 #define GET_METHOD "GET " 60 #define POST_METHOD "POST " 61 #define HEAD_METHOD "HEAD " 62 #define META_METHOD "META " 63 #define HTTPVERSIONHDR " HTTP/1.0\r\n" 64 #define NEWLINE "\r\n" 65 #define CONTENT_LEN "Content-Length: " 66 #define CONTENT_TYPE "Content-Type: text/plain" 67 68 /* makes the HTTP header for the cookieList, it is the string returned from 69 * this function that should be sent across the wire 70 * The user is responsible for freeing the space. 71 */ 72 char *makeCookie(HTTPCookieList *cookieList); 73 74 /* parse str, make a cookie and add it to the req->setCooke list, type is 75 * SetCookie or SetCookie2, host is the host url (used as default for domain) 76 */ 77 void setCookie(HTTPCookieRequest *req, int type, char *str, char *host); 78 79 /***** 80 * This is the strlen of the Content-length of the form data. 81 * 10 => forms with up to 100000000 bytes of data. 82 *****/ 83 #define MAX_FORM_LEN 10 84 85 /* read request size increment */ 86 #define CHUNKSIZE 65536 87 88 /* HTTP server response definition */ 89 typedef struct _HTTPResponse { 90 unsigned char *data; /* message */ 91 int http_version; /* server version */ 92 HTTPRequestReturn status_code; /* request succeeded? */ 93 HTTPNamedValues *headers; /* array of returned headers */ 94 int num_headers; /* no of headers */ 95 } HTTPResponse; 96 97 /* Don't add anything after this endif! */ 98 #endif /* _HTTPP_h_ */ 99