@@ -29,7 +29,7 @@ char *ApacheCookie_expires(ApacheCookie *c, char *time_str)
29
29
30
30
#define cookie_get_set (thing ,val ) \
31
31
retval = thing; \
32
- if(val) thing = ap_pstrdup (c->r->pool, val)
32
+ if(val) thing = apr_pstrdup (c->r->pool, val)
33
33
34
34
char * ApacheCookie_attr (ApacheCookie * c , char * key , char * val )
35
35
{
@@ -73,11 +73,11 @@ ApacheCookie *ApacheCookie_new(request_rec *r, ...)
73
73
va_list args ;
74
74
ApacheRequest req ;
75
75
ApacheCookie * c =
76
- ap_pcalloc (r -> pool , sizeof (ApacheCookie ));
76
+ apr_pcalloc (r -> pool , sizeof (ApacheCookie ));
77
77
78
78
req .r = r ;
79
79
c -> r = r ;
80
- c -> values = ap_make_array (r -> pool , 1 , sizeof (char * ));
80
+ c -> values = apr_array_make (r -> pool , 1 , sizeof (char * ));
81
81
c -> secure = 0 ;
82
82
c -> name = c -> expires = NULL ;
83
83
@@ -103,17 +103,17 @@ ApacheCookieJar *ApacheCookie_parse(request_rec *r, const char *data)
103
103
{
104
104
const char * pair ;
105
105
ApacheCookieJar * retval =
106
- ap_make_array (r -> pool , 1 , sizeof (ApacheCookie * ));
106
+ apr_array_make (r -> pool , 1 , sizeof (ApacheCookie * ));
107
107
108
108
if (!data )
109
- if (!(data = ap_table_get (r -> headers_in , "Cookie" )))
109
+ if (!(data = apr_table_get (r -> headers_in , "Cookie" )))
110
110
return retval ;
111
111
112
112
while (* data && (pair = ap_getword (r -> pool , & data , ';' ))) {
113
113
const char * key , * val ;
114
114
ApacheCookie * c ;
115
115
116
- while (ap_isspace (* data ))
116
+ while (apr_isspace (* data ))
117
117
++ data ;
118
118
119
119
key = ap_getword (r -> pool , & pair , '=' );
@@ -123,7 +123,7 @@ ApacheCookieJar *ApacheCookie_parse(request_rec *r, const char *data)
123
123
if (c -> values )
124
124
c -> values -> nelts = 0 ;
125
125
else
126
- c -> values = ap_make_array (r -> pool , 4 , sizeof (char * ));
126
+ c -> values = apr_array_make (r -> pool , 4 , sizeof (char * ));
127
127
128
128
if (!* pair )
129
129
ApacheCookieAdd (c , "" );
@@ -144,11 +144,11 @@ ApacheCookieJar *ApacheCookie_parse(request_rec *r, const char *data)
144
144
}
145
145
146
146
#define cookie_push_arr (arr , val ) \
147
- *(char **)ap_push_array (arr) = (char *)val
147
+ *(char **)apr_array_push (arr) = (char *)val
148
148
149
149
#define cookie_push_named (arr , name , val ) \
150
150
if(val && strlen(val) > 0) { \
151
- cookie_push_arr(arr, ap_pstrcat (p, name, "=", val, NULL)); \
151
+ cookie_push_arr(arr, apr_pstrcat (p, name, "=", val, NULL)); \
152
152
}
153
153
154
154
static char * escape_url (pool * p , char * val )
@@ -195,25 +195,25 @@ char *ApacheCookie_as_string(ApacheCookie *c)
195
195
if (!c -> name )
196
196
return "" ;
197
197
198
- values = ap_make_array (p , 6 , sizeof (char * ));
198
+ values = apr_array_make (p , 6 , sizeof (char * ));
199
199
cookie_push_named (values , "domain" , c -> domain );
200
200
cookie_push_named (values , "path" , c -> path );
201
201
cookie_push_named (values , "expires" , c -> expires );
202
202
if (c -> secure ) {
203
203
cookie_push_arr (values , "secure" );
204
204
}
205
205
206
- cookie = ap_pstrcat (p , escape_url (p , c -> name ), "=" , NULL );
206
+ cookie = apr_pstrcat (p , escape_url (p , c -> name ), "=" , NULL );
207
207
for (i = 0 ; i < c -> values -> nelts ; i ++ ) {
208
- cookie = ap_pstrcat (p , cookie ,
208
+ cookie = apr_pstrcat (p , cookie ,
209
209
escape_url (p , ((char * * )c -> values -> elts )[i ]),
210
210
(i < (c -> values -> nelts - 1 ) ? "&" : NULL ),
211
211
NULL );
212
212
}
213
213
214
214
retval = cookie ;
215
215
for (i = 0 ; i < values -> nelts ; i ++ ) {
216
- retval = ap_pstrcat (p , retval , "; " ,
216
+ retval = apr_pstrcat (p , retval , "; " ,
217
217
((char * * )values -> elts )[i ], NULL );
218
218
}
219
219
@@ -222,6 +222,6 @@ char *ApacheCookie_as_string(ApacheCookie *c)
222
222
223
223
void ApacheCookie_bake (ApacheCookie * c )
224
224
{
225
- ap_table_add (c -> r -> err_headers_out , "Set-Cookie" ,
225
+ apr_table_add (c -> r -> err_headers_out , "Set-Cookie" ,
226
226
ApacheCookie_as_string (c ));
227
227
}
0 commit comments