X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=srwapps%2Fsrw-gateway.c;fp=srwapps%2Fsrw-gateway.c;h=aa0f458add2c3b601695f565f1b56a0b53a9f391;hb=c68c6c8dd7fb48b0e6ec82d580266470b2b62d7d;hp=77591dbd2aa098b6d1daf77fdf5d22e22355a950;hpb=b36a815a64cd481e0a74fc51b8010019b83e4cb1;p=yaz-moved-to-github.git diff --git a/srwapps/srw-gateway.c b/srwapps/srw-gateway.c index 77591db..aa0f458 100644 --- a/srwapps/srw-gateway.c +++ b/srwapps/srw-gateway.c @@ -1,4 +1,4 @@ -/* $Id: srw-gateway.c,v 1.1 2003-01-06 08:20:28 adam Exp $ +/* $Id: srw-gateway.c,v 1.2 2003-01-20 13:04:50 adam Exp $ Copyright (C) 2002-2003 Index Data Aps @@ -293,6 +293,15 @@ static void target_leave (struct target *l) myunlock(&target_mutex); } +#if USE_THREADS +static void *p_serve (void *p) +{ + struct soap *soap = p; + yaz_srw_serve(soap, searchRetrieve, explain); +} +#endif + + static void standalone(struct soap *soap, const char *host, int port, int max_thr, struct srw_prop *properties) { @@ -365,13 +374,12 @@ static void standalone(struct soap *soap, const char *host, int port, soap_thr[i]->user = properties; #if USE_THREADS if (max_thr <= 1) - yaz_srw_serve(soap_thr[i], properties, + yaz_srw_serve(soap_thr[i], searchRetrieve, explain); /* static mode .. */ else - pthread_create(&tid[i], 0, (void*(*)(void*))soap_serve, - soap_thr[i]); + pthread_create(&tid[i], 0, p_serve, soap_thr[i]); #else - yaz_srw_serve(soap_thr[i], properties, + yaz_srw_serve(soap_thr[i], searchRetrieve, explain); /* static mode .. */ #endif } @@ -419,7 +427,7 @@ int fetchone(struct soap *soap, struct srw_prop *properties, { return 65; } - if (!strcmp(schema, "MARC21")) + if (!strcmp(schema, "MARC21") || !strcmp(schema, "http://www.loc.gov/marcxml/")) { *rec_data = soap_malloc (soap, xml_len+1); memcpy (*rec_data, xml_rec, xml_len); @@ -819,7 +827,7 @@ int main(int argc, char **argv) yaz_log_init_file(arg); break; case 'V': - puts ("Version: $Id: srw-gateway.c,v 1.1 2003-01-06 08:20:28 adam Exp $" + puts ("Version: $Id: srw-gateway.c,v 1.2 2003-01-20 13:04:50 adam Exp $" #if SRW_DEBUG " DEBUG" #endif @@ -876,7 +884,7 @@ int main(int argc, char **argv) soap_init(&soap); soap.user = &properties; - yaz_srw_serve(&soap, &properties, searchRetrieve, explain); + yaz_srw_serve(&soap, searchRetrieve, explain); soap_end(&soap); yaz_log (LOG_LOG, "CGI end");