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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
head 1.2;
access;
symbols
libshout-2_0:1.2
libshout-2_0b3:1.2
libshout-2_0b2:1.2
libshout_2_0b1:1.2
libogg2-zerocopy:1.1.1.1.0.2
start:1.1.1.1
xiph:1.1.1;
locks; strict;
comment @ * @;
1.2
date 2003.03.15.02.10.18; author msmith; state Exp;
branches;
next 1.1;
1.1
date 2001.09.10.02.28.49; author jack; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2001.09.10.02.28.49; author jack; state Exp;
branches;
next ;
desc
@@
1.2
log
@Brendan was getting pissed off about inconsistent indentation styles.
Convert all tabs to 4 spaces. All code must now use 4 space indents.
@
text
@#include <stdio.h>
#include <avl/avl.h>
#include "httpp.h"
int main(int argc, char **argv)
{
char buff[8192];
int readed;
http_parser_t parser;
avl_node *node;
http_var_t *var;
httpp_initialize(&parser, NULL);
readed = fread(buff, 1, 8192, stdin);
if (httpp_parse(&parser, buff, readed)) {
printf("Parse succeeded...\n\n");
printf("Request was ");
switch (parser.req_type) {
case httpp_req_none:
printf(" none\n");
break;
case httpp_req_unknown:
printf(" unknown\n");
break;
case httpp_req_get:
printf(" get\n");
break;
case httpp_req_post:
printf(" post\n");
break;
case httpp_req_head:
printf(" head\n");
break;
}
printf("Version was 1.%d\n", parser.version);
node = avl_get_first(parser.vars);
while (node) {
var = (http_var_t *)node->key;
if (var)
printf("Iterating variable(s): %s = %s\n", var->name, var->value);
node = avl_get_next(node);
}
} else {
printf("Parse failed...\n");
}
printf("Destroying parser...\n");
httpp_destroy(&parser);
return 0;
}
@
1.1
log
@Initial revision
@
text
@d9 5
a13 5
char buff[8192];
int readed;
http_parser_t parser;
avl_node *node;
http_var_t *var;
d15 1
a15 1
httpp_initialize(&parser, NULL);
d17 35
a51 35
readed = fread(buff, 1, 8192, stdin);
if (httpp_parse(&parser, buff, readed)) {
printf("Parse succeeded...\n\n");
printf("Request was ");
switch (parser.req_type) {
case httpp_req_none:
printf(" none\n");
break;
case httpp_req_unknown:
printf(" unknown\n");
break;
case httpp_req_get:
printf(" get\n");
break;
case httpp_req_post:
printf(" post\n");
break;
case httpp_req_head:
printf(" head\n");
break;
}
printf("Version was 1.%d\n", parser.version);
node = avl_get_first(parser.vars);
while (node) {
var = (http_var_t *)node->key;
if (var)
printf("Iterating variable(s): %s = %s\n", var->name, var->value);
node = avl_get_next(node);
}
} else {
printf("Parse failed...\n");
}
d53 2
a54 2
printf("Destroying parser...\n");
httpp_destroy(&parser);
d56 1
a56 1
return 0;
@
1.1.1.1
log
@move to cvs
@
text
@@
|