Changeset bbf159a in mainline for uspace/srv/net/tl/tcp/ucall.c
- Timestamp:
- 2011-12-13T17:06:25Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a8c1c4e
- Parents:
- 0d29e0cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/ucall.c
r0d29e0cd rbbf159a 121 121 } 122 122 123 if (conn->snd_buf_fin) 123 fibril_mutex_lock(&conn->snd_buf_lock); 124 125 if (conn->snd_buf_fin) { 126 fibril_mutex_unlock(&conn->snd_buf_lock); 124 127 return TCP_ECLOSING; 128 } 125 129 126 130 while (size > 0) { 127 131 buf_free = conn->snd_buf_size - conn->snd_buf_used; 128 132 while (buf_free == 0 && !conn->reset) { 129 tcp_tqueue_new_data(conn); 133 log_msg(LVL_DEBUG, "%s: buf_free == 0, waiting.", 134 conn->name); 135 fibril_condvar_wait(&conn->snd_buf_cv, 136 &conn->snd_buf_lock); 130 137 buf_free = conn->snd_buf_size - conn->snd_buf_used; 131 138 } 132 139 133 if (conn->reset) 140 if (conn->reset) { 141 fibril_mutex_unlock(&conn->snd_buf_lock); 134 142 return TCP_ERESET; 143 } 135 144 136 145 xfer_size = min(size, buf_free); … … 141 150 conn->snd_buf_used += xfer_size; 142 151 size -= xfer_size; 143 } 144 152 153 fibril_mutex_unlock(&conn->snd_buf_lock); 154 tcp_tqueue_new_data(conn); 155 fibril_mutex_lock(&conn->snd_buf_lock); 156 } 157 158 fibril_mutex_unlock(&conn->snd_buf_lock); 145 159 tcp_tqueue_new_data(conn); 146 160
Note:
See TracChangeset
for help on using the changeset viewer.