Ejemplo n.º 1
0
static LargeByteString	*
NewLinkData(void)
{
	LargeByteString *linkdata;
	size_t size;

	if (ThisEnv->linkrec != NULL) {
		linkdata = NewLBS();
		size = NativeSizeValue(NULL,ThisEnv->linkrec->value);
		LBS_ReserveSize(linkdata,size,FALSE);
		NativePackValue(NULL,LBS_Body(linkdata),ThisEnv->linkrec->value);
	} else {
		linkdata = NULL;
	}
	return linkdata;
}
Ejemplo n.º 2
0
static PacketClass SYSDB_RequestCommon(NETFILE *fp, PacketClass pc,
                                       ValueStruct *val) {
  PacketClass rc;
  LargeByteString *buf;
  rc = SESSION_CONTROL_NG;
  buf = NewLBS();
  LBS_ReserveSize(buf, NativeSizeValue(NULL, val), FALSE);
  NativePackValue(NULL, LBS_Body(buf), val);
  SendPacketClass(fp, SYSDATA_SYSDB);
  ON_IO_ERROR(fp, badio);
  SendPacketClass(fp, pc);
  ON_IO_ERROR(fp, badio);
  SendLBS(fp, buf);
  ON_IO_ERROR(fp, badio);
  rc = RecvPacketClass(fp);
  RecvLBS(fp, buf);
  NativeUnPackValue(NULL, LBS_Body(buf), val);
badio:
  FreeLBS(buf);
  return rc;
}
Ejemplo n.º 3
0
static	SessionData	*
InitAPISession(
	char *user,
	char *ldname,
	char *wname,
	char *host)
{
	SessionData		*data;
	LD_Node			*ld;
	RecordStruct	*rec;
	size_t			size;
	uuid_t			u;

ENTER_FUNC;
	data = NewSessionData();
	data->type = SESSION_TYPE_API;
	uuid_generate(u);
	uuid_unparse(u,data->hdr->uuid);
	strcpy(data->hdr->window,wname);
	strcpy(data->hdr->user,user);
	strcpy(data->host,host);
	data->fInProcess = TRUE;
	if ((ld = g_hash_table_lookup(APS_Hash, ldname)) != NULL) {
		data->ld = ld;
		data->linkdata = NULL;
		data->cWindow = ld->info->cWindow;
		data->scrdata = NULL;
		data->hdr->puttype = SCREEN_NULL;
		rec = GetWindow(wname);
		size = NativeSizeValue(NULL,rec->value);
		LBS_ReserveSize(data->apidata->rec, size,FALSE);
		NativePackValue(NULL,LBS_Body(data->apidata->rec),rec->value);
	} else {
		Warning("[%s] session fail LD [%s] not found.",data->hdr->uuid,ldname);
		data = NULL;
	}
LEAVE_FUNC;
	return	(data);
}