10000 emulation on host: fix UDP seek&peek by d-a-v · Pull Request #8827 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

emulation on host: fix UDP seek&peek #8827

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

Merged
merged 5 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mock: cleaning
  • Loading branch information
d-a-v committed Jan 23, 2023
commit e1deea56b72c8481d611b5ada51c70184a44b57b
17 changes: 0 additions & 17 deletions tests/host/common/UdpContextSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,23 +187,6 @@ size_t mockUDPPeekBytes(int sock, char* dst, size_t offset, size_t usersize, int
return retsize;
}

/*
void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize)
{
// poor man buffer
memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
ccinbufsize -= copied;
}

size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf,
size_t& ccinbufsize)
{
size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
mockUDPSwallow(copied, ccinbuf, ccinbufsize);
return copied;
}
*/

size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4,
uint16_t port)
{
Expand Down
3 changes: 0 additions & 3 deletions tests/host/common/mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,8 @@ size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& a
uint8_t addr[16], uint16_t& port);
size_t mockUDPPeekBytes(int sock, char* dst, size_t offset, size_t usersize, int timeout_ms, char* ccinbuf,
size_t& ccinbufsize);
//size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf,
// size_t& ccinbufsize);
size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4,
uint16_t port);
//void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);

class UdpContext;
void register_udp(int sock, UdpContext* udp = nullptr);
Expand Down
0