Skip to content

Commit

Permalink
Fix "tcp socket share mutable state" bug
Browse files Browse the repository at this point in the history
  • Loading branch information
esstrifork committed Feb 4, 2014
1 parent 534eb5f commit 0bdfd52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/erjang/driver/tcp_inet/TCPINet.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ public TCPINet copy(EPID caller, InetSocket sock) {
copy.empty_out_q_subs = new ArrayList<EHandle>();
copy.active = ActiveType.PASSIVE;

copy.tcp_clear_input(); // Do not share mutable state!

final EDriverTask this_task = port().task();
EDriverTask driver = new EDriverTask(caller, copy) {
public EObject getName() {
Expand Down Expand Up @@ -2791,6 +2793,7 @@ private void tcp_clear_input() {
i_buf = null;
i_ptr_start = 0;
i_remain = 0;
http_state = new IntCell();
}

private int tcp_expand_buffer(int len) {
Expand Down

0 comments on commit 0bdfd52

Please sign in to comment.