Created
August 16, 2019 10:45
-
-
Save wudi/23b2758e27888628a66140d356e87676 to your computer and use it in GitHub Desktop.
swoole-4.0.4 patch
This file contains hidden or 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
| diff --git a/src/network/ReactorThread.c b/src/network/ReactorThread.c | |
| index e3aac4f5..a9617ff3 100644 | |
| --- a/src/network/ReactorThread.c | |
| +++ b/src/network/ReactorThread.c | |
| @@ -197,14 +197,14 @@ static int swReactorThread_onPackage(swReactor *reactor, swEvent *event) | |
| { | |
| pkt.port = ntohs(info.addr.inet_v4.sin_port); | |
| pkt.addr.v4.s_addr = info.addr.inet_v4.sin_addr.s_addr; | |
| - task.data.info.fd = pkt.addr.v4.s_addr; | |
| + task.data.info.fd = pkt.port; | |
| } | |
| //IPv6 | |
| else if (socket_type == SW_SOCK_UDP6) | |
| { | |
| pkt.port = ntohs(info.addr.inet_v6.sin6_port); | |
| memcpy(&pkt.addr.v6, &info.addr.inet_v6.sin6_addr, sizeof(info.addr.inet_v6.sin6_addr)); | |
| - memcpy(&task.data.info.fd, &info.addr.inet_v6.sin6_addr, sizeof(task.data.info.fd)); | |
| + task.data.info.fd = pkt.port; | |
| } | |
| //Unix Dgram | |
| else |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git apply balance_udp_packet_dispath.patch // OR patch < balance_udp_packet_dispath.patch