-
Notifications
You must be signed in to change notification settings - Fork 26
Андрей Смирдин, Лиза Василенко. Биржа Фрилансеров #35
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
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # tcp/message/src/message.cpp
|
|
||
| while (true) { | ||
| client.GetLine(line); | ||
| if (sscanf(line.c_str(), "a customer %s", arg)) { |
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.
Желательно указывать размер буфера arg, чтобы не произошло переполнение.
| } | ||
|
|
||
| bool Message::GetBody(std::string *body, size_t length, int sockfd) { | ||
| auto buf = new char[length]; |
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.
Зачем выделять buf, если можно было сразу передать body->data() в Get? Естественно, после resize.
| return status; | ||
| } | ||
|
|
||
| MarketServer::ClientStatus MarketServer::WorkWithFreelancer(Freelancer *freelancer, const Message &message) { |
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.
Достаточно большие функции, которые можно было бы разбить на несколько.
|
А так всё достаточно хорошо и красиво, молодцы. |
Задание 1 из дополнительной методички.
Лиза -- сервер, Андрей -- клиент