#include "gcli.h"
int golf_client (gg_cli *req, char *connection, char *method, char *app_path, char *request, char *url_params);
int golf_client (gg_cli *req, char *connection, char *method, char *app_path, char *request, char *url_params)
{
memset ((char*)req, 0, sizeof(gg_cli));
req->server = connection;
req->req_method = method;
req->app_path = app_path;
req->req = request;
req->url_params = url_params;
return gg_cli_request (req);
}
void main ()
{
int i;
char dir[GG_MAX_OS_UDIR_LEN];
gg_dir (GG_DIR_SOCKFILE, dir, sizeof(dir), "hello", NULL);
for (i = 0; i < 100000; i++)
{
gg_cli req;
int res = golf_client (&req, dir, "GET", "/hello", "/srv", "/");
if (res != GG_OKAY) printf("Request failed [%d] [%s]\n", res, req.errm);
else printf("%s", gg_cli_data(&req));
gg_cli_delete(&req);
}
}
Copied!