Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (46 loc) · 1.16 KB

File metadata and controls

53 lines (46 loc) · 1.16 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "app.h"
int main()
{
char recvbuf[256]={'0'};
char appid[8]={'0'};
char userid[8]={'0'};
char sendbuf[4096]={'0'};
freopen("/var/cloudos/cc/clickapp.log","w+",stdout);
freopen("/var/cloudos/cc/clickapp.log","a+",stderr);
char path[256];
if(getcwd(path,256) == NULL)
{
perror("getcwd error");
exit(EXIT_FAILURE);
}
cout<<"main:"<<path<<endl;
chdir("/var/cloudos/cc");
int sockfd;
sockfd=atoi(getenv("socket"));
if(send(sockfd,"ok",2,0)==-1)
{
perror("Send error!");
exit(EXIT_FAILURE);
}
if(recv(sockfd,recvbuf,sizeof(recvbuf),0)==-1)
{
perror("Recv error!");
exit(EXIT_FAILURE);
}
cout<<"recv:"<<recvbuf<<endl;
Translate(recvbuf,appid,userid);
cout<<"appid:"<<appid<<endl;
cout<<"userid:"<<userid<<endl;
// AppHandler(appid,userid,sendbuf);
//cout<<sendbuf<<endl;
//int sockfd=0;
// char sendbuf[1024]={'0'};
if(AppHandler(appid,userid,sockfd,sendbuf)<0)
{
send(sockfd,sendbuf,strlen(sendbuf),0);
cout<<"clickappERROR"<<endl;
return -1;
}
close(sockfd);
return 0;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.