-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit for issue#39 #83
Conversation
Added the server-side validation. If a client is new joinee,he can create a new chatroom by sending NEW command or validate by CHKUSR command. The chatroom are generated at a single point,hence the disperancy coming in earlier case is resolved.
fix for issue #39. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of changes hail from #84. Please look at the suggestions I have provided there and work accordingly.
@@ -9,6 +9,7 @@ | |||
|
|||
sess = PromptSession() | |||
sepr = chr(969696) | |||
websocket = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid such cross-type object initialization as far as possible.
@@ -29,7 +30,7 @@ def decrjson(self, data): | |||
return self.suit.decrypt(data.encode("utf8")).decode("utf8") | |||
|
|||
|
|||
async def consumer_handler(cphrsuit, websocket, username, chatroom, servaddr): | |||
async def consumer_handler(cphrsuit, username, chatroom, servaddr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The websocket object must be passed here as a parameter.
@@ -46,7 +47,7 @@ async def consumer_handler(cphrsuit, websocket, username, chatroom, servaddr): | |||
pass | |||
|
|||
|
|||
async def producer_handler(cphrsuit, websocket, username, chatroom, servaddr): | |||
async def producer_handler(cphrsuit, username, chatroom, servaddr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The websocket object must be passed here as a parameter.
Hi, I have added my justification for using this way, there. Please look that and reply what I should do? |
Added the server-side validation.
If a client is new joinee,he can create a new chatroom by sending NEW command
or validate by CHKUSR command. The chatroom are generated at a single point,hence
the disperancy coming in earlier case is resolved.