Changeset 132ab5d1 in mainline for uspace/srv/net/tcp/service.c
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/srv/net/tcp/service.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/service.c
r8bfb163 r132ab5d1 37 37 #include <async.h> 38 38 #include <errno.h> 39 #include <str_error.h> 39 40 #include <inet/endpoint.h> 40 41 #include <inet/inet.h> … … 432 433 * @param rconn_id Place to store ID of new connection 433 434 * 434 * @return EOK on success or negativeerror code435 * @return EOK on success or an error code 435 436 */ 436 437 static int tcp_conn_create_impl(tcp_client_t *client, inet_ep2_t *epp, … … 506 507 * @param rlst_id Place to store ID of new listener 507 508 * 508 * @return EOK on success or negativeerror code509 * @return EOK on success or an error code 509 510 */ 510 511 static int tcp_listener_create_impl(tcp_client_t *client, inet_ep_t *ep, … … 577 578 * @param conn_id Connection ID 578 579 * 579 * @return EOK on success or negativeerror code580 * @return EOK on success or an error code 580 581 */ 581 582 static int tcp_conn_send_fin_impl(tcp_client_t *client, sysarg_t conn_id) … … 602 603 * @param conn_id Connection ID 603 604 * 604 * @return EOK on success or negativeerror code605 * @return EOK on success or an error code 605 606 */ 606 607 static int tcp_conn_push_impl(tcp_client_t *client, sysarg_t conn_id) … … 627 628 * @param conn_id Connection ID 628 629 * 629 * @return EOK on success or negativeerror code630 * @return EOK on success or an error code 630 631 */ 631 632 static int tcp_conn_reset_impl(tcp_client_t *client, sysarg_t conn_id) … … 653 654 * @param size Data size in bytes 654 655 * 655 * @return EOK on success or negativeerror code656 * @return EOK on success or an error code 656 657 */ 657 658 static int tcp_conn_send_impl(tcp_client_t *client, sysarg_t conn_id, … … 660 661 tcp_cconn_t *cconn; 661 662 int rc; 663 tcp_error_t trc; 662 664 663 665 rc = tcp_cconn_get(client, conn_id, &cconn); … … 665 667 return rc; 666 668 667 rc = tcp_uc_send(cconn->conn, data, size, 0);668 if ( rc !=EOK)669 return rc;669 trc = tcp_uc_send(cconn->conn, data, size, 0); 670 if (trc != TCP_EOK) 671 return EIO; 670 672 671 673 return EOK; … … 682 684 * @param nrecv Place to store actual number of bytes received 683 685 * 684 * @return EOK on success or negativeerror code686 * @return EOK on success or an error code 685 687 */ 686 688 static int tcp_conn_recv_impl(tcp_client_t *client, sysarg_t conn_id, … … 690 692 xflags_t xflags; 691 693 int rc; 694 tcp_error_t trc; 692 695 693 696 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_impl()"); … … 699 702 } 700 703 701 rc = tcp_uc_receive(cconn->conn, data, size, nrecv, &xflags);702 if ( rc !=EOK) {703 switch ( rc) {704 trc = tcp_uc_receive(cconn->conn, data, size, nrecv, &xflags); 705 if (trc != TCP_EOK) { 706 switch (trc) { 704 707 case TCP_EAGAIN: 705 708 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_impl() - EAGAIN"); … … 709 712 return EOK; 710 713 default: 711 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_impl() - trc=%d", rc);714 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_impl() - trc=%d", trc); 712 715 return EIO; 713 716 } … … 1095 1098 rc = tcp_conn_recv_impl(client, conn_id, data, size, &rsize); 1096 1099 if (rc != EOK) { 1097 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv - recv_impl failed rc=% d", rc);1100 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv - recv_impl failed rc=%s", str_error_name(rc)); 1098 1101 async_answer_0(callid, rc); 1099 1102 async_answer_0(iid, rc); … … 1241 1244 /** Initialize TCP service. 1242 1245 * 1243 * @return EOK on success or negativeerror code.1246 * @return EOK on success or an error code. 1244 1247 */ 1245 1248 int tcp_service_init(void)
Note:
See TracChangeset
for help on using the changeset viewer.
