Skip to content

There is a bug in function Server::recvall #28

Description

@lsw29475

In the function Server::recvall line 5, the code is

int RetnCheck = recv(connections[ID]->socket, data, totalbytes - bytesreceived, NULL); //Try to recv remaining bytes

,There is pass the buffer as the argv to the recv function directly, If only call the recv funciont one time, it's no problem, but when called the recv funcion twice or more, the buffer pass to the recv function will be overwrite and lost data, there should pass the buffer add the bytesreceived to the recv function, like this:

int RetnCheck = recv(connections[ID]->socket, data + bytesreceived, totalbytes - bytesreceived, NULL); //Try to recv remaining bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions