Created
April 16, 2019 14:03
-
-
Save Cranc/4ee997ad9c1884afff6d5741fb194394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
short * sendrequest_1_svc(param *para, struct svc_req *req){ | |
char* req_addr = inet_ntoa(req->rq_xprt->xp_raddr.sin_addr); | |
l_sub* ptr = sub_list; | |
while(ptr != NULL){ | |
if(strcmp(ptr.ip,req_addr)){ | |
if(check_session(ptr,para)!=1){ | |
response = INVALID_SESSION; | |
return &response; | |
} | |
break; | |
} | |
ptr = ptr->next; | |
} | |
switch(para->arg.topic_or_message){ | |
case 0://topic | |
return set_channel_1_svc(¶->arg.argument_u.t,req); | |
break; | |
case 1://message | |
return publish_1_svc(¶->arg.argument_u.m, req); | |
break; | |
default: break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment