File: HTTPP.h

package info (click to toggle)
xmhtml 1.1.7-18
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 6,576 kB
  • sloc: ansic: 68,174; makefile: 438; sh: 158; perl: 36
file content (95 lines) | stat: -rw-r--r-- 2,942 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*****
* HTTPP.h : Private HTTP.c header file.
*
* This file Version	$Revision: 1.1 $
*
* Creation date:		Tue Oct 21 01:57:37 GMT+0100 1997
* Last modification: 	$Date: 1997/10/23 00:28:29 $
* By:					$Author: newt $
* Current State:		$State: Exp $
*
* Author:				Richard Offer
*
* Copyright (C) 1994-1997 by Richard Offer <offer@sgi.com>
* All Rights Reserved
*
* This file is part of insert_program_name_here
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****/
/*****
* $Source: /usr/local/rcs/Newt/XmHTML/RCS/HTTPP.h,v $
*****/
/*****
* ChangeLog 
* $Log: HTTPP.h,v $
* Revision 1.1  1997/10/23 00:28:29  newt
* Initial Revision
*
*****/ 

#ifndef _HTTPP_h_
#define _HTTPP_h_

#include <http/HTTP.h>

#define HTTP_VERSION_09 900
#define HTTP_VERSION_10 1000
#define HTTP_VERSION_11 1100

#define DEFAULT_TIMEOUT		5	/* default connect() and select() timeout	*/
#define DEFAULT_RETRY		0	/* default retry if select() fails			*/

#define GET_METHOD			"GET "
#define POST_METHOD			"POST "
#define HEAD_METHOD			"HEAD "
#define META_METHOD			"META "
#define HTTPVERSIONHDR " HTTP/1.0\r\n"
#define NEWLINE "\r\n"
#define CONTENT_LEN "Content-Length: "
#define CONTENT_TYPE "Content-Type: text/plain"

/* makes the HTTP header for the cookieList, it is the string returned from 
 * this function that should be sent across the wire 
 * The user is responsible for freeing the space. 
 */
char *makeCookie(HTTPCookieList *cookieList);

/* parse str, make a cookie and add it to the req->setCooke list, type is 
 * SetCookie or SetCookie2, host is the host url (used as default for domain) 
 */
void setCookie(HTTPCookieRequest *req, int type, char *str, char *host);

/*****
* This is the strlen of the Content-length of the form data.
* 10 => forms with up to 100000000 bytes of data.
*****/
#define MAX_FORM_LEN 10

/* read request size increment */
#define CHUNKSIZE 65536

/* HTTP server response definition */
typedef struct _HTTPResponse {
	unsigned char *data;			/* message						*/
	int http_version;				/* server version				*/
	HTTPRequestReturn status_code;	/* request succeeded?			*/
	HTTPNamedValues *headers;		/* array of returned headers	*/
	int num_headers;				/* no of headers				*/
} HTTPResponse;

/* Don't add anything after this endif! */
#endif /* _HTTPP_h_ */