* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.218 2003-12-30 00:22:11 adam Exp $
+ * $Id: client.c,v 1.219 2003-12-31 00:14:00 adam Exp $
*/
#include <stdio.h>
char *buf_out;
int len_out;
int r;
- if (apdu_file && !z_GDU(print, &gdu, 0, 0))
- printf ("Failed to print outgoing APDU\n");
+ if (apdu_file)
+ {
+ if (!z_GDU(print, &gdu, 0, 0))
+ printf ("Failed to print outgoing APDU\n");
+ odr_reset(print);
+ }
buf_out = odr_getbuf(out, &len_out, 0);
/* we don't odr_reset(out), since we may need the buffer again */
odr_dumpBER(f, netbuffer, res);
fprintf(f, "---------\n");
if (apdu_file)
+ {
z_GDU(print, &gdu, 0, 0);
+ odr_reset(print);
+ }
if (conn && cs_more(conn))
continue;
break;
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.11 2003-12-30 00:29:53 adam Exp $
+ * $Id: seshigh.c,v 1.12 2003-12-31 00:14:01 adam Exp $
*/
/*
return;
}
req->request_mem = odr_extract_mem(assoc->decode);
- if (assoc->print && !z_GDU(assoc->print, &req->gdu_request, 0, 0))
- {
- yaz_log(LOG_WARN, "ODR print error: %s",
- odr_errmsg(odr_geterror(assoc->print)));
+ if (assoc->print)
+ {
+ if (!z_GDU(assoc->print, &req->gdu_request, 0, 0))
+ yaz_log(LOG_WARN, "ODR print error: %s",
+ odr_errmsg(odr_geterror(assoc->print)));
odr_reset(assoc->print);
}
request_enq(&assoc->incoming, req);
{
odr_setbuf(assoc->encode, req->response, req->size_response, 1);
- if (assoc->print && !z_GDU(assoc->print, &res, 0, 0))
+ if (assoc->print)
{
- yaz_log(LOG_WARN, "ODR print error: %s",
- odr_errmsg(odr_geterror(assoc->print)));
+ if (!z_GDU(assoc->print, &res, 0, 0))
+ yaz_log(LOG_WARN, "ODR print error: %s",
+ odr_errmsg(odr_geterror(assoc->print)));
odr_reset(assoc->print);
}
if (!z_GDU(assoc->encode, &res, 0, 0))
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.11 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.12 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
* Copyright (c) 2002-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: zgdu.c,v 1.4 2003-12-30 15:18:53 adam Exp $
+ * $Id: zgdu.c,v 1.5 2003-12-31 00:14:01 adam Exp $
*/
#include <yaz/odr.h>
if (!z_HTTP_header_lookup((*p)->u.HTTP_Response->headers,
"Content-Length"))
{
- char lstr[20];
- sprintf(lstr, "%d", (*p)->u.HTTP_Response->content_len);
- z_HTTP_header_add(o,
- &(*p)->u.HTTP_Response->headers,
- "Content-Length", lstr);
+ char lstr[60];
+ sprintf(lstr, "Content-Length: %d\r\n",
+ (*p)->u.HTTP_Response->content_len);
+ odr_write(o, (unsigned char *) lstr, strlen(lstr));
}
for (h = (*p)->u.HTTP_Response->headers; h; h = h->next)
{
!z_HTTP_header_lookup((*p)->u.HTTP_Request->headers,
"Content-Length"))
{
- char lstr[20];
- sprintf(lstr, "%d", (*p)->u.HTTP_Request->content_len);
- z_HTTP_header_add(o,
- &(*p)->u.HTTP_Request->headers,
- "Content-Length", lstr);
+ char lstr[60];
+ sprintf(lstr, "Content-Length: %d\r\n",
+ (*p)->u.HTTP_Request->content_len);
+ odr_write(o, (unsigned char *) lstr, strlen(lstr));
}
for (h = (*p)->u.HTTP_Request->headers; h; h = h->next)
{