Commit 0da5727
committed
writeToClient() properly handles chunk splitting
In case there are larger amounts of data to be sent back to client they are normally split into up to 64K chunks (unless server exceeds "maxmemory" which causes it to send as much as possible). When writeToClient() returns and has pending replies to be sent - it is scheduled in event loop and when IOCP signals that the socket is writeable again - sendReplyToClient() handler is called and sends additional chunk via writeToClient(). This however behaves differently under Windows and in order to send the following pedning replies - we need to schedule sendReplyToClient() again. Furthermore when we are sending data too fast and receive WSAEWOULDBLOCK error/warning - we back off again and re-schedule sending.
Fixes #111 parent 2f87db0 commit 0da5727
1 file changed
+29
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
973 | 980 | | |
974 | 981 | | |
975 | 982 | | |
| |||
995 | 1002 | | |
996 | 1003 | | |
997 | 1004 | | |
998 | | - | |
| 1005 | + | |
999 | 1006 | | |
1000 | 1007 | | |
1001 | 1008 | | |
| |||
1007 | 1014 | | |
1008 | 1015 | | |
1009 | 1016 | | |
1010 | | - | |
| 1017 | + | |
1011 | 1018 | | |
1012 | 1019 | | |
1013 | 1020 | | |
| |||
1043 | 1050 | | |
1044 | 1051 | | |
1045 | 1052 | | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1046 | 1072 | | |
1047 | | - | |
| 1073 | + | |
1048 | 1074 | | |
1049 | 1075 | | |
1050 | 1076 | | |
| |||
0 commit comments