2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3
Copyright (C) 2005- The University of Notre Dame
4
This software is distributed under the GNU General Public License.
5
See the file COPYING for details.
8
#include "catalog_query.h"
9
#include "catalog_server.h"
11
#include "http_query.h"
14
#include "stringtools.h"
16
#define QUERY "GET HTTP/1.0 /query.text\n\n"
18
struct catalog_query {
22
struct catalog_query * catalog_query_create( const char *host, int port, time_t stoptime )
24
struct catalog_query *q = xxmalloc(sizeof(*q));
27
if(!host) host = CATALOG_HOST;
28
if(!port) port = CATALOG_PORT;
30
sprintf(url,"http://%s:%d/query.text",host,port);
32
q->link = http_query(url,"GET",stoptime);
41
struct nvpair * catalog_query_read( struct catalog_query *q, time_t stoptime )
43
struct nvpair *nv = nvpair_create();
47
while(link_readline(q->link,line,sizeof(line),stoptime)) {
50
nvpair_parse(nv,line);
62
void catalog_query_delete( struct catalog_query *q )