Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/service.c

    r258d77e rcde999a  
    3737#include <async.h>
    3838#include <errno.h>
     39#include <str_error.h>
    3940#include <inet/endpoint.h>
    4041#include <inet/inet.h>
     
    432433 * @param rconn_id Place to store ID of new connection
    433434 *
    434  * @return EOK on success or negative error code
     435 * @return EOK on success or an error code
    435436 */
    436437static int tcp_conn_create_impl(tcp_client_t *client, inet_ep2_t *epp,
     
    506507 * @param rlst_id Place to store ID of new listener
    507508 *
    508  * @return EOK on success or negative error code
     509 * @return EOK on success or an error code
    509510*/
    510511static int tcp_listener_create_impl(tcp_client_t *client, inet_ep_t *ep,
     
    577578 * @param conn_id Connection ID
    578579 *
    579  * @return EOK on success or negative error code
     580 * @return EOK on success or an error code
    580581 */
    581582static int tcp_conn_send_fin_impl(tcp_client_t *client, sysarg_t conn_id)
     
    602603 * @param conn_id Connection ID
    603604 *
    604  * @return EOK on success or negative error code
     605 * @return EOK on success or an error code
    605606 */
    606607static int tcp_conn_push_impl(tcp_client_t *client, sysarg_t conn_id)
     
    627628 * @param conn_id Connection ID
    628629 *
    629  * @return EOK on success or negative error code
     630 * @return EOK on success or an error code
    630631 */
    631632static int tcp_conn_reset_impl(tcp_client_t *client, sysarg_t conn_id)
     
    653654 * @param size    Data size in bytes
    654655 *
    655  * @return EOK on success or negative error code
     656 * @return EOK on success or an error code
    656657 */
    657658static int tcp_conn_send_impl(tcp_client_t *client, sysarg_t conn_id,
     
    660661        tcp_cconn_t *cconn;
    661662        int rc;
     663        tcp_error_t trc;
    662664
    663665        rc = tcp_cconn_get(client, conn_id, &cconn);
     
    665667                return rc;
    666668
    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;
    670672
    671673        return EOK;
     
    682684 * @param nrecv   Place to store actual number of bytes received
    683685 *
    684  * @return EOK on success or negative error code
     686 * @return EOK on success or an error code
    685687 */
    686688static int tcp_conn_recv_impl(tcp_client_t *client, sysarg_t conn_id,
     
    690692        xflags_t xflags;
    691693        int rc;
     694        tcp_error_t trc;
    692695
    693696        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_impl()");
     
    699702        }
    700703
    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) {
    704707                case TCP_EAGAIN:
    705708                        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_impl() - EAGAIN");
     
    709712                        return EOK;
    710713                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);
    712715                        return EIO;
    713716                }
     
    10951098        rc = tcp_conn_recv_impl(client, conn_id, data, size, &rsize);
    10961099        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));
    10981101                async_answer_0(callid, rc);
    10991102                async_answer_0(iid, rc);
     
    12411244/** Initialize TCP service.
    12421245 *
    1243  * @return EOK on success or negative error code.
     1246 * @return EOK on success or an error code.
    12441247 */
    12451248int tcp_service_init(void)
Note: See TracChangeset for help on using the changeset viewer.