#include <arpa/inet.h>
#include <string.h>
+#include "stg/common.h"
+#include "stg/netunit.h"
#include "request.h"
-#include "common.h"
-#include "netunit.h"
#define FN_LEN (512)
#define REQ_STR_LEN (300)
//-----------------------------------------------------------------------------
int Process(REQUEST * r)
{
-char errorMsg[MAX_ERR_STR_LEN];
int ret;
char str[2048];
if ((ret = nt.Connect()) != st_ok)
{
- strncpy(errorMsg, nt.GetError(), MAX_ERR_STR_LEN);
- printf("%s", errorMsg);
+ printf("%s\n", nt.GetError().c_str());
return ret;
}
if ((ret = nt.Transact(str)) != st_ok)
{
- strncpy(errorMsg, nt.GetError(), MAX_ERR_STR_LEN);
- printf("%s", errorMsg);
+ printf("%s\n", nt.GetError().c_str());
return ret;
}
if ((ret = nt.Disconnect()) != st_ok)
{
- strncpy(errorMsg, nt.GetError(), MAX_ERR_STR_LEN);
- printf("%s", errorMsg);
+ printf("%s\n", nt.GetError().c_str());
return ret;
}