YAZ 5.37.0
http.c
Go to the documentation of this file.
1/* This file is part of the YAZ toolkit.
2 * Copyright (C) Index Data
3 * See the file LICENSE for details.
4 */
9#if HAVE_CONFIG_H
10#include <config.h>
11#endif
12
13#include "odr-priv.h"
14#include <yaz/yaz-version.h>
15#include <yaz/yaz-iconv.h>
16#include <yaz/matchstr.h>
17#include <yaz/zgdu.h>
18#include <yaz/base64.h>
19#include <yaz/comstack.h>
20#include <yaz/snprintf.h>
21
22static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
23 char **content_buf, int *content_len)
24{
25 int i = off;
26 int chunked = 0;
27 const char *buf = o->op->buf;
28 int size = o->op->size;
29
30 *headers = 0;
31 while (i < size-1 && buf[i] == '\n')
32 {
33 int po;
34 i++;
35 if (buf[i] == '\r' && i < size-1 && buf[i+1] == '\n')
36 {
37 i++;
38 break;
39 }
40 if (buf[i] == '\n')
41 break;
42 for (po = i; ; i++)
43 {
44 if (i == size)
45 {
46 o->error = OHTTP;
47 return 0;
48 }
49 else if (buf[i] == ':')
50 break;
51 }
52 *headers = (Z_HTTP_Header *) odr_malloc(o, sizeof(**headers));
53 (*headers)->name = odr_strdupn(o, buf + po, i - po);
54 i++;
55 while (i < size-1 && buf[i] == ' ')
56 i++;
57 for (po = i; i < size-1 && !strchr("\r\n", buf[i]); i++)
58 ;
59
60 (*headers)->value = odr_strdupn(o, buf + po, i - po);
61 if (!yaz_strcasecmp((*headers)->name, "Transfer-Encoding")
62 &&
63 !yaz_strcasecmp((*headers)->value, "chunked"))
64 chunked = 1;
65 headers = &(*headers)->next;
66 if (i < size-1 && buf[i] == '\r')
67 i++;
68 }
69 *headers = 0;
70 if (buf[i] != '\n')
71 {
72 o->error = OHTTP;
73 return 0;
74 }
75 i++;
76
77 if (chunked)
78 {
79 int off = 0;
80
81 /* we know buffer will be smaller than o->size - i*/
82 *content_buf = (char*) odr_malloc(o, size - i);
83
84 while (1)
85 {
86 /* chunk length .. */
87 int chunk_len = 0;
88 for (; i < size-2; i++)
89 if (yaz_isdigit(buf[i]))
90 chunk_len = chunk_len * 16 +
91 (buf[i] - '0');
92 else if (yaz_isupper(buf[i]))
93 chunk_len = chunk_len * 16 +
94 (buf[i] - ('A'-10));
95 else if (yaz_islower(buf[i]))
96 chunk_len = chunk_len * 16 +
97 (buf[i] - ('a'-10));
98 else
99 break;
100 /* chunk extension ... */
101 while (buf[i] != '\r' && buf[i+1] != '\n')
102 {
103 if (i >= size-2)
104 {
105 o->error = OHTTP;
106 return 0;
107 }
108 i++;
109 }
110 i += 2; /* skip CRLF */
111 if (chunk_len == 0)
112 break;
113 if (chunk_len < 0 || off + chunk_len > size)
114 {
115 o->error = OHTTP;
116 return 0;
117 }
118 /* copy chunk .. */
119 memcpy (*content_buf + off, buf + i, chunk_len);
120 i += chunk_len + 2; /* skip chunk+CRLF */
121 off += chunk_len;
122 }
123 if (!off)
124 *content_buf = 0;
125 *content_len = off;
126 }
127 else
128 {
129 if (i > size)
130 {
131 o->error = OHTTP;
132 return 0;
133 }
134 else if (i == size)
135 {
136 *content_buf = 0;
137 *content_len = 0;
138 }
139 else
140 {
141 *content_len = size - i;
142 *content_buf = odr_strdupn(o, buf + i, *content_len);
143 }
144 }
145 return 1;
146}
147
149 const char *content_type,
150 const char *charset)
151{
152 const char *l = "Content-Type";
153 if (charset)
154 {
155 char *ctype = nmem_printf(odr_getmem(o), "%s; charset=%s",
156 content_type, charset);
157 z_HTTP_header_add(o, hp, l, ctype);
158 }
159 else
160 z_HTTP_header_add(o, hp, l, content_type);
161
162}
163
164/*
165 * HTTP Basic authentication is described at:
166 * http://tools.ietf.org/html/rfc1945#section-11.1
167 */
169 const char *username, const char *password)
170{
171 char *tmp, *buf;
172
173 if (username == 0)
174 return;
175 if (password == 0)
176 password = "";
177
178 tmp = nmem_printf(odr_getmem(o), "%s:%s", username, password);
179 buf = (char *) odr_malloc(o, strlen(tmp) * 8/6 + 12);
180 strcpy(buf, "Basic ");
181 yaz_base64encode(tmp, &buf[strlen(buf)]);
182 z_HTTP_header_set(o, hp, "Authorization", buf);
183}
184
185void z_HTTP_header_add(ODR o, Z_HTTP_Header **hp, const char *n,
186 const char *v)
187{
188 while (*hp)
189 hp = &(*hp)->next;
190 *hp = (Z_HTTP_Header *) odr_malloc(o, sizeof(**hp));
191 (*hp)->name = odr_strdup(o, n);
192 (*hp)->value = odr_strdup(o, v);
193 (*hp)->next = 0;
194}
195
196void z_HTTP_header_set(ODR o, Z_HTTP_Header **hp, const char *n,
197 const char *v)
198{
199 while (*hp)
200 {
201 if (!yaz_strcasecmp((*hp)->name, n))
202 {
203 (*hp)->value = odr_strdup(o, v);
204 return;
205 }
206 hp = &(*hp)->next;
207 }
208 *hp = (Z_HTTP_Header *) odr_malloc(o, sizeof(**hp));
209 (*hp)->name = odr_strdup(o, n);
210 (*hp)->value = odr_strdup(o, v);
211 (*hp)->next = 0;
212}
213
214const char *z_HTTP_header_remove(Z_HTTP_Header **hp, const char *n)
215{
216 while (*hp)
217 {
218 if (!yaz_strcasecmp((*hp)->name, n))
219 {
220 const char *v = (*hp)->value;
221 *hp = (*hp)->next;
222 return v;
223 }
224 hp = &(*hp)->next;
225 }
226 return 0;
227}
228
229const char *z_HTTP_header_lookup(const Z_HTTP_Header *hp, const char *n)
230{
231 for (; hp; hp = hp->next)
232 if (!yaz_strcasecmp(hp->name, n))
233 return hp->value;
234 return 0;
235}
236
237
239{
240 Z_GDU *p = (Z_GDU *) odr_malloc(o, sizeof(*p));
241 Z_HTTP_Request *hreq;
242
244 p->u.HTTP_Request = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hreq));
245 hreq = p->u.HTTP_Request;
246 hreq->headers = 0;
247 hreq->content_len = 0;
248 hreq->content_buf = 0;
249 hreq->version = "1.1";
250 hreq->method = "POST";
251 hreq->path = "/";
252 z_HTTP_header_add(o, &hreq->headers, "User-Agent", "YAZ/" YAZ_VERSION);
253 return p;
254}
255
256
258 const char *host,
259 const char *path)
260{
262
263 p->u.HTTP_Request->path = odr_strdup(odr, path);
264
265 if (host)
266 {
267 const char *cp0 = strstr(host, "://");
268 const char *cp1 = 0;
269 if (cp0)
270 cp0 = cp0+3;
271 else
272 cp0 = host;
273
274 cp1 = strchr(cp0, '/');
275 if (!cp1)
276 cp1 = cp0+strlen(cp0);
277
278 if (cp0 && cp1)
279 {
280 char *h = odr_strdupn(odr, cp0, cp1 - cp0);
281 z_HTTP_header_add(odr, &p->u.HTTP_Request->headers, "Host", h);
282 }
283 }
284 return p;
285}
286
287Z_GDU *z_get_HTTP_Request_uri(ODR odr, const char *uri, const char *args,
288 int use_full_uri)
289{
291 const char *cp0 = strstr(uri, "://");
292 const char *cp1 = 0;
293 if (cp0)
294 cp0 = cp0+3;
295 else
296 cp0 = uri;
297
298 cp1 = strchr(cp0, '/');
299 if (!cp1)
300 cp1 = cp0+strlen(cp0);
301
302 if (cp0 && cp1)
303 {
304 char *h = odr_strdupn(odr, cp0, cp1 - cp0);
305 z_HTTP_header_add(odr, &p->u.HTTP_Request->headers, "Host", h);
306 }
307
308 if (!args)
309 {
310 if (*cp1)
311 args = cp1 + 1;
312 else
313 args = "";
314 }
315 p->u.HTTP_Request->path = odr_malloc(odr, cp1 - uri + strlen(args) + 2);
316 if (use_full_uri)
317 {
318 memcpy(p->u.HTTP_Request->path, uri, cp1 - uri);
319 strcpy(p->u.HTTP_Request->path + (cp1 - uri), "/");
320 }
321 else
322 strcpy(p->u.HTTP_Request->path, "/");
323 strcat(p->u.HTTP_Request->path, args);
324 return p;
325}
326
327Z_GDU *z_get_HTTP_Response_server(ODR o, int code, const char *details,
328 const char *server, const char *server_url)
329{
330 Z_GDU *p = (Z_GDU *) odr_malloc(o, sizeof(*p));
331 Z_HTTP_Response *hres;
332
334 p->u.HTTP_Response = (Z_HTTP_Response *) odr_malloc(o, sizeof(*hres));
335 hres = p->u.HTTP_Response;
336 hres->headers = 0;
337 hres->content_len = 0;
338 hres->content_buf = 0;
339 hres->code = code;
340 hres->version = "1.1";
341 z_HTTP_header_add(o, &hres->headers, "Server", server);
342 if (code != 200)
343 {
344 const char *http_err = z_HTTP_errmsg(code);
345 size_t sz = 400 + strlen(http_err) + (details ?
346 strlen(details) : 0);
347 hres->content_buf = (char*) odr_malloc(o, sz);
348 yaz_snprintf(hres->content_buf, sz,
349 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
350 " \"http://www.w3.org/TR/html4/strict.dtd\">\n"
351 "<HTML>\n"
352 " <HEAD>\n"
353 " <TITLE>%s</TITLE>\n"
354 " </HEAD>\n"
355 " <BODY>\n"
356 " <P><A HREF=\"%s\">%s</A></P>\n"
357 " <P>Error: %d</P>\n"
358 " <P>Description: %s</P>\n", server, server_url, server,
359 code, http_err);
360 if (details)
361 {
362 yaz_snprintf(hres->content_buf + strlen(hres->content_buf),
363 sz - strlen(hres->content_buf),
364 "<P>Details: %s</P>\n", details);
365 }
366 yaz_snprintf(hres->content_buf + strlen(hres->content_buf),
367 sz - strlen(hres->content_buf),
368 " </BODY>\n"
369 "</HTML>\n");
370 hres->content_len = strlen(hres->content_buf);
371 z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/html");
372 }
373 return p;
374}
375
376Z_GDU *z_get_HTTP_Response_details(ODR o, int code, const char *details)
377{
378 return z_get_HTTP_Response_server(o, code, details, "YAZ/" YAZ_VERSION,
379 "http://www.indexdata.com/yaz");
380}
381
383{
384 return z_get_HTTP_Response_details(o, code, 0);
385}
386
387const char *z_HTTP_errmsg(int code)
388{
389 switch (code)
390 {
391 case 100:
392 return "Continue";
393 case 101:
394 return "Switching Protocols";
395 case 200:
396 return "OK";
397 case 201:
398 return "Created";
399 case 202:
400 return "Accepted";
401 case 203:
402 return "Non-Authoritative Information";
403 case 204:
404 return "No Content";
405 case 205:
406 return "Reset Content";
407 case 206:
408 return "Partial Content";
409 case 300:
410 return "Multiple Choices";
411 case 301:
412 return "Moved Permenently";
413 case 302:
414 return "Found";
415 case 303:
416 return "See Other";
417 case 304:
418 return "Not Modified";
419 case 305:
420 return "Use Proxy";
421 case 307:
422 return "Temporary Redirect";
423 case 400:
424 return "Bad Request";
425 case 404:
426 return "Not Found";
427 case 405:
428 return "Method Not Allowed";
429 case 406:
430 return "Not Acceptable";
431 case 407:
432 return "Proxy Authentication Required";
433 case 408:
434 return "Request Timeout";
435 case 409:
436 return "Conflict";
437 case 410:
438 return "Gone";
439 case 411:
440 return "Length Required";
441 case 412:
442 return "Precondition Failed";
443 case 413:
444 return "Request Entity Too Large";
445 case 414:
446 return "Request-URI Too Long";
447 case 415:
448 return "Unsupported Media Type";
449 case 416:
450 return "Requested Range Not Satisfiable";
451 case 417:
452 return "Expectation Failed";
453 case 500:
454 return "Internal Error";
455 case 501:
456 return "Not Implemented";
457 case 502:
458 return "Bad Gateway";
459 case 503:
460 return "Service Unavailable";
461 case 504:
462 return "Gateway Timeout";
463 case 505:
464 return "HTTP Version Not Supported";
465 default:
466 return "Unknown Error";
467 }
468}
469
471{
472 int i, po;
473 Z_HTTP_Response *hr = (Z_HTTP_Response *) odr_malloc(o, sizeof(*hr));
474 const char *buf = o->op->buf;
475 int size = o->op->size;
476
477 *hr_p = hr;
478 hr->content_buf = 0;
479 hr->content_len = 0;
480
481 po = i = 5;
482 while (i < size-2 && !strchr(" \r\n", buf[i]))
483 i++;
484 hr->version = odr_strdupn(o, buf + po, i - po);
485 if (buf[i] != ' ')
486 {
487 o->error = OHTTP;
488 return 0;
489 }
490 i++;
491 hr->code = 0;
492 while (i < size-2 && buf[i] >= '0' && buf[i] <= '9')
493 {
494 hr->code = hr->code*10 + (buf[i] - '0');
495 i++;
496 }
497 while (i < size-1 && buf[i] != '\n')
498 i++;
499 return decode_headers_content(o, i, &hr->headers,
500 &hr->content_buf, &hr->content_len);
501}
502
504{
505 int i, po;
506 Z_HTTP_Request *hr = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hr));
507 const char *buf = o->op->buf;
508 int size = o->op->size;
509 int lspace = 0;
510
511 *hr_p = hr;
512 hr->method = 0;
513 hr->version = 0;
514 hr->path = 0;
515 hr->headers = 0;
516 hr->content_buf = 0;
517 hr->content_len = 0;
518 /* method .. */
519 for (i = 0; buf[i] != ' '; i++)
520 if (i >= size-5 || i > 30)
521 {
522 o->error = OHTTP;
523 return 0;
524 }
525 hr->method = odr_strdupn(o, buf, i);
526 po = ++i;
527 while (i < size && !strchr("\r\n", buf[i]))
528 {
529 if (buf[i] == ' ')
530 lspace = i;
531 i++;
532 }
533 if (!lspace || i >= size || lspace >= size - 5 ||
534 memcmp(buf + lspace + 1, "HTTP/", 5))
535 {
536 o->error = OHTTP;
537 return 0;
538 }
539 hr->path = odr_strdupn(o, buf + po, lspace - po);
540 hr->version = odr_strdupn(o, buf + lspace + 6, i - (lspace + 6));
541 if (i < size-1 && buf[i] == '\r')
542 i++;
543 if (buf[i] != '\n')
544 {
545 o->error = OHTTP;
546 return 0;
547 }
548 /* headers */
549 return decode_headers_content(o, i, &hr->headers,
550 &hr->content_buf, &hr->content_len);
551}
552
553static void dump_http_package(ODR o, const char *buf, size_t len)
554{
555 int i, limit = 8192;
556 for (i = 0; ; i++)
557 {
558 if (i == len)
559 {
560 o->op->stream_write(o, o->op->print, ODR_VISIBLESTRING, buf, i);
561 break;
562 }
563 else if (i >= limit)
564 {
565 o->op->stream_write(o, o->op->print, ODR_VISIBLESTRING, buf, i);
566 odr_printf(o, "(truncated from %ld to %d\n", (long) len, i);
567 break;
568 }
569 else if (buf[i] == 0)
570 {
571 o->op->stream_write(o, o->op->print, ODR_VISIBLESTRING, buf, i);
572 odr_printf(o, "(binary data)\n", (long) len);
573 break;
574 }
575 }
576}
577
579{
580 char sbuf[80];
581 Z_HTTP_Header *h;
582 int top0 = o->op->top;
583
584 yaz_snprintf(sbuf, sizeof(sbuf), "HTTP/%s %d %s\r\n", hr->version,
585 hr->code,
586 z_HTTP_errmsg(hr->code));
587 odr_write(o, sbuf, strlen(sbuf));
588 /* use content_len for Content-Length */
589 yaz_snprintf(sbuf, sizeof(sbuf), "Content-Length: %d\r\n", hr->content_len);
590 odr_write(o, sbuf, strlen(sbuf));
591 for (h = hr->headers; h; h = h->next)
592 {
593 if (yaz_strcasecmp(h->name, "Content-Length")
594 && yaz_strcasecmp(h->name, "Transfer-Encoding"))
595 { /* skip Content-Length if given. content_len rules */
596 odr_write(o, h->name, strlen(h->name));
597 odr_write(o, ": ", 2);
598 odr_write(o, h->value, strlen(h->value));
599 odr_write(o, "\r\n", 2);
600 }
601 }
602 odr_write(o, "\r\n", 2);
603 if (hr->content_buf)
604 odr_write(o, hr->content_buf, hr->content_len);
605 if (o->direction == ODR_PRINT)
606 {
607 odr_printf(o, "-- HTTP response:\n");
608 dump_http_package(o, o->op->buf + top0, o->op->top - top0);
609 odr_printf(o, "--\n");
610 }
611 return 1;
612}
613
615{
616 Z_HTTP_Header *h;
617 char *cp;
618 int top0 = o->op->top;
619
620 if (!hr->method || !hr->path)
621 return 0;
622 odr_write(o, hr->method, strlen(hr->method));
623 odr_write(o, " ", 1);
624 cp = strchr(hr->path, '#');
625 odr_write(o, hr->path, cp ? (cp - hr->path) : strlen(hr->path));
626 odr_write(o, " HTTP/", 6);
627 odr_write(o, hr->version, strlen(hr->version));
628 odr_write(o, "\r\n", 2);
629 if (hr->content_len &&
631 "Content-Length"))
632 {
633 char lstr[60];
634 yaz_snprintf(lstr, sizeof(lstr), "Content-Length: %d\r\n",
635 hr->content_len);
636 odr_write(o, lstr, strlen(lstr));
637 }
638 for (h = hr->headers; h; h = h->next)
639 {
640 if (yaz_strcasecmp(h->name, "Transfer-Encoding") == 0)
641 continue;
642 odr_write(o, h->name, strlen(h->name));
643 odr_write(o, ": ", 2);
644 odr_write(o, h->value, strlen(h->value));
645 odr_write(o, "\r\n", 2);
646 }
647 odr_write(o, "\r\n", 2);
648 if (hr->content_buf)
649 odr_write(o, hr->content_buf, hr->content_len);
650 if (o->direction == ODR_PRINT)
651 {
652 odr_printf(o, "-- HTTP request:\n");
653 dump_http_package(o, o->op->buf + top0, o->op->top - top0);
654 odr_printf(o, "--\n");
655 }
656 return 1;
657}
658
659const char *yaz_check_location(ODR odr, const char *uri, const char *location,
660 int *host_change)
661{
662 if (*location == '/')
663 { /* relative location */
664 char *args = 0;
665 char *nlocation = (char *) odr_malloc(odr, strlen(location)
666 + strlen(uri) + 3);
667 strcpy(nlocation, uri);
668 cs_get_host_args(nlocation, (const char **) &args);
669 if (!args || !*args)
670 args = nlocation + strlen(nlocation);
671 else
672 args--;
673 strcpy(args, location);
674 *host_change = 0;
675 return nlocation;
676 }
677 else
678 {
679 /* we don't check if host is the same as before - yet */
680 *host_change = 1;
681 return location;
682 }
683}
684
685/*
686 * Local variables:
687 * c-basic-offset: 4
688 * c-file-style: "Stroustrup"
689 * indent-tabs-mode: nil
690 * End:
691 * vim: shiftwidth=4 tabstop=8 expandtab
692 */
693
void yaz_base64encode(const char *in, char *out)
encodes Base64 string
Definition base64.c:16
Header for Base64 utilities.
void cs_get_host_args(const char *type_and_host, const char **args)
Definition comstack.c:48
Header for COMSTACK.
int yaz_decode_http_request(ODR o, Z_HTTP_Request **hr_p)
Definition http.c:503
Z_GDU * z_get_HTTP_Response_details(ODR o, int code, const char *details)
Definition http.c:376
int yaz_encode_http_request(ODR o, Z_HTTP_Request *hr)
Definition http.c:614
void z_HTTP_header_add_basic_auth(ODR o, Z_HTTP_Header **hp, const char *username, const char *password)
Definition http.c:168
int yaz_decode_http_response(ODR o, Z_HTTP_Response **hr_p)
Definition http.c:470
Z_GDU * z_get_HTTP_Request_host_path(ODR odr, const char *host, const char *path)
Definition http.c:257
void z_HTTP_header_set(ODR o, Z_HTTP_Header **hp, const char *n, const char *v)
Definition http.c:196
Z_GDU * z_get_HTTP_Response(ODR o, int code)
Definition http.c:382
Z_GDU * z_get_HTTP_Request(ODR o)
Definition http.c:238
Z_GDU * z_get_HTTP_Response_server(ODR o, int code, const char *details, const char *server, const char *server_url)
Definition http.c:327
static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers, char **content_buf, int *content_len)
Definition http.c:22
int yaz_encode_http_response(ODR o, Z_HTTP_Response *hr)
Definition http.c:578
const char * z_HTTP_errmsg(int code)
Definition http.c:387
const char * yaz_check_location(ODR odr, const char *uri, const char *location, int *host_change)
Definition http.c:659
const char * z_HTTP_header_remove(Z_HTTP_Header **hp, const char *n)
Definition http.c:214
static void dump_http_package(ODR o, const char *buf, size_t len)
Definition http.c:553
const char * z_HTTP_header_lookup(const Z_HTTP_Header *hp, const char *n)
Definition http.c:229
Z_GDU * z_get_HTTP_Request_uri(ODR odr, const char *uri, const char *args, int use_full_uri)
Definition http.c:287
void z_HTTP_header_add(ODR o, Z_HTTP_Header **hp, const char *n, const char *v)
Definition http.c:185
void z_HTTP_header_add_content_type(ODR o, Z_HTTP_Header **hp, const char *content_type, const char *charset)
Definition http.c:148
int yaz_strcasecmp(const char *s1, const char *s2)
ala strcasecmp - no locale
Definition matchstr.c:21
Header for YAZ iconv interface.
char * nmem_printf(NMEM nmem, const char *fmt,...)
formats and prints a string into NMEM allocated memory
Definition nmemsdup.c:145
Internal ODR definitions.
void odr_printf(ODR o, const char *fmt,...)
Definition odr.c:288
#define OHTTP
Definition odr.h:162
#define ODR_VISIBLESTRING
Definition odr.h:89
#define odr_getmem(o)
Definition odr.h:216
struct odr * ODR
Definition odr.h:121
#define ODR_PRINT
Definition odr.h:97
void * odr_malloc(ODR o, size_t size)
Definition odr_mem.c:31
char * odr_strdupn(ODR o, const char *str, size_t n)
Definition odr_mem.c:46
char * odr_strdup(ODR o, const char *str)
Definition odr_mem.c:36
int odr_write(ODR o, const char *buf, int bytes)
Definition odr_mem.c:98
void yaz_snprintf(char *buf, size_t size, const char *fmt,...)
Definition snprintf.c:31
Header for config file reading utilities.
char * buf
Definition odr-priv.h:84
void(* stream_write)(ODR o, void *handle, int type, const char *buf, int len)
Definition odr-priv.h:102
FILE * print
Definition odr-priv.h:113
Definition zgdu.h:68
Z_HTTP_Request * HTTP_Request
Definition zgdu.h:72
int which
Definition zgdu.h:69
Z_HTTP_Response * HTTP_Response
Definition zgdu.h:73
union Z_GDU::@057307356220171136236350364324260103365227025100 u
char * name
Definition zgdu.h:43
Z_HTTP_Header * next
Definition zgdu.h:45
char * value
Definition zgdu.h:44
Z_HTTP_Header * headers
Definition zgdu.h:52
char * content_buf
Definition zgdu.h:53
char * path
Definition zgdu.h:51
char * version
Definition zgdu.h:50
char * method
Definition zgdu.h:49
int content_len
Definition zgdu.h:54
char * content_buf
Definition zgdu.h:61
Z_HTTP_Header * headers
Definition zgdu.h:60
char * version
Definition zgdu.h:59
int content_len
Definition zgdu.h:62
Definition odr.h:125
struct Odr_private * op
Definition odr.h:132
int error
Definition odr.h:128
int direction
Definition odr.h:126
Header for YAZ iconv interface.
#define yaz_islower(x)
Definition yaz-iconv.h:91
#define yaz_isdigit(x)
Definition yaz-iconv.h:86
#define yaz_isupper(x)
Definition yaz-iconv.h:89
Defines YAZ version.
#define YAZ_VERSION
YAZ version as string.
Definition yaz-version.h:36
Header for the Z_GDU (HTTP or Z39.50 package).
#define Z_GDU_HTTP_Response
Definition zgdu.h:67
#define Z_GDU_HTTP_Request
Definition zgdu.h:66