Artifacts Associated With Ticket ca6a9e5659
Ticket change [de31b0b65a] (rid 156844) by anonymous on 2017-09-29 20:17:17:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
When the server and client are run through two different processes, I cannot flush one line of data through a socket with zlib compression. For example, when we have:<br> <b>server.tcl</b><br> <code>proc server {sock ip port} {<br> fconfigure $sock -buffering none -blocking 1<br> zlib push deflate $sock<br> puts $sock "qwertyuiop"<br> chan configure $sock -flush sync<br> flush $sock<br> puts "done!"<br> } socket -server server 1501 vwait die</code> <b>and client.tcl</b><br> <code>set sock [socket "127.0.0.1" 1501]<br> fconfigure $sock -buffering none -blocking 1<br> zlib push inflate $sock<br> puts "reading.."<br> puts [gets $sock]<br> close $sock</code> If you start server.tcl and then start client.tcl, you will find that "qwertyuiop" from server.tcl never gets flushed. Client.tcl will simply wait to read in a line from the socket even though we see that server.tcl has indicated, "done!" If you remove the compression, we do not see this issue. Here are the same server.tcl and client.tcl files with no compression. <b>server.tcl</b><br> <code>proc server {sock ip port} {<br> fconfigure $sock -buffering none -blocking 1<br> puts $sock "qwertyuiop"<br> flush $sock<br> puts "done!"<br> } socket -server server 1501 vwait die</code> <b>and client.tcl</b><br> <code>set sock [socket "127.0.0.1" 1501]<br> fconfigure $sock -buffering none -blocking 1<br> puts "reading.."<br> puts [gets $sock]<br> close $sock</code> If you start this new server.tcl and then the new start client.tcl, you will see that the client.tcl prints "qwertyuiop" correctly, indicating that it was flushed correctly. This is how I know that this issue is specific to zlib compression. During my individual testing, I found that I could force the flush to happen correctly by increasing the number of "puts" operations in server.tcl. If I ran "puts $sock "qwertyuiop" 1000 times in server.tcl, I could read "qwertyuiop" correctly in client.tcl. The bug here is that flush does not appear to be working correctly for one line with zlib compression on a socket. - foundin initialized to: "8.6.6"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "8077d0425af928b423525be2baa2a339c588525d"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "57. zlib"
- title initialized to:
Can't flush one line through a socket when using zlib compression/decompression
- type initialized to: "Bug"