Changes in uspace/srv/hid/remcons/user.c [8820544:fab2746] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/remcons/user.c
r8820544 rfab2746 44 44 #include <fibril_synch.h> 45 45 #include <task.h> 46 #include <net/in.h> 47 #include <net/inet.h> 48 #include <net/socket.h> 46 #include <inet/tcp.h> 49 47 #include <io/console.h> 50 48 #include <inttypes.h> … … 58 56 /** Create new telnet user. 59 57 * 60 * @param socket Socket the user communicates through.58 * @param conn Incoming connection. 61 59 * @return New telnet user or NULL when out of memory. 62 60 */ 63 telnet_user_t *telnet_user_create( int socket)61 telnet_user_t *telnet_user_create(tcp_conn_t *conn) 64 62 { 65 63 static int telnet_user_id_counter = 0; … … 78 76 } 79 77 80 user-> socket = socket;78 user->conn = conn; 81 79 user->service_id = (service_id_t) -1; 82 80 prodcons_initialize(&user->in_events); … … 193 191 /* No more buffered data? */ 194 192 if (user->socket_buffer_len <= user->socket_buffer_pos) { 195 int recv_length = recv(user->socket, user->socket_buffer, BUFFER_SIZE, 0); 196 if ((recv_length == 0) || (recv_length == ENOTCONN)) { 193 int rc; 194 size_t recv_length; 195 196 rc = tcp_conn_recv_wait(user->conn, user->socket_buffer, 197 BUFFER_SIZE, &recv_length); 198 if (rc != EOK) 199 return rc; 200 201 if (recv_length == 0) { 197 202 user->socket_closed = true; 198 203 user->srvs.aborted = true; 199 204 return ENOENT; 200 205 } 201 if (recv_length < 0) { 202 return recv_length; 203 } 206 204 207 user->socket_buffer_len = recv_length; 205 208 user->socket_buffer_pos = 0; … … 359 362 360 363 361 int rc = send(user->socket, converted, converted_size, 0);364 int rc = tcp_conn_send(user->conn, converted, converted_size); 362 365 free(converted); 363 366
Note:
See TracChangeset
for help on using the changeset viewer.