Changeset c3f7d37 in mainline for uspace/lib/c/generic/inet


Ignore:
Timestamp:
2015-06-07T12:36:44Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
048cd69
Parents:
5a5b087
Message:

Remove excessive debugging output.

Location:
uspace/lib/c/generic/inet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/inet/tcp.c

    r5a5b087 rc3f7d37  
    4141#include <stdlib.h>
    4242
    43 #include <stdio.h>
    44 
    4543static void tcp_cb_conn(ipc_callid_t, ipc_call_t *, void *);
    4644static int tcp_conn_fibril(void *);
     
    5654        async_exch_t *exch = async_exchange_begin(tcp->sess);
    5755
    58         printf("tcp_callback_create()\n");
    59 
    6056        aid_t req = async_send_0(exch, TCP_CALLBACK_CREATE, NULL);
    6157        int rc = async_connect_to_me(exch, 0, 0, 0, tcp_cb_conn, tcp);
     
    7672        service_id_t tcp_svcid;
    7773        int rc;
    78 
    79         printf("tcp_create()\n");
    8074
    8175        tcp = calloc(1, sizeof(tcp_t));
     
    129123        tcp_conn_t *conn;
    130124
    131         printf("tcp_conn_new()\n");
    132 
    133125        conn = calloc(1, sizeof(tcp_conn_t));
    134126        if (conn == NULL)
     
    157149        sysarg_t conn_id;
    158150
    159         printf("tcp_conn_create()\n");
    160 
    161151        exch = async_exchange_begin(tcp->sess);
    162152        aid_t req = async_send_0(exch, TCP_CONN_CREATE, &answer);
     
    192182        async_exch_t *exch;
    193183
    194         printf("tcp_conn_destroy()\n");
    195 
    196184        if (conn == NULL)
    197185                return;
     
    230218        tcp_listener_t *lst;
    231219        ipc_call_t answer;
    232 
    233         printf("tcp_listener_create()\n");
    234220
    235221        lst = calloc(1, sizeof(tcp_listener_t));
     
    274260{
    275261        async_exch_t *exch;
    276 
    277         printf("tcp_listener_destroy()\n");
    278262
    279263        if (lst == NULL)
     
    328312        sysarg_t rc;
    329313
    330         printf("tcp_conn_send()\n");
    331 
    332314        exch = async_exchange_begin(conn->tcp->sess);
    333315        aid_t req = async_send_1(exch, TCP_CONN_SEND, conn->id, NULL);
     
    355337        async_exch_t *exch;
    356338
    357         printf("tcp_conn_send_fin()\n");
    358 
    359339        exch = async_exchange_begin(conn->tcp->sess);
    360340        sysarg_t rc = async_req_1_0(exch, TCP_CONN_SEND_FIN, conn->id);
     
    368348        async_exch_t *exch;
    369349
    370         printf("tcp_conn_push()\n");
    371 
    372350        exch = async_exchange_begin(conn->tcp->sess);
    373351        sysarg_t rc = async_req_1_0(exch, TCP_CONN_PUSH, conn->id);
     
    381359        async_exch_t *exch;
    382360
    383         printf("tcp_conn_reset()\n");
    384 
    385361        exch = async_exchange_begin(conn->tcp->sess);
    386362        sysarg_t rc = async_req_1_0(exch, TCP_CONN_RESET, conn->id);
     
    395371        ipc_call_t answer;
    396372
    397         printf("tcp_conn_recv() bsize=%zu\n", bsize);
    398 
    399373        fibril_mutex_lock(&conn->lock);
    400374        if (!conn->data_avail) {
    401                 printf("returning EAGAIN\n");
    402375                fibril_mutex_unlock(&conn->lock);
    403376                return EAGAIN;
     
    410383
    411384        if (rc != EOK) {
    412                 printf("got rc = %d\n", rc);
    413385                async_forget(req);
    414386                fibril_mutex_unlock(&conn->lock);
     
    419391        async_wait_for(req, &retval);
    420392        if (retval != EOK) {
    421                 printf("got rc = %d\n", rc);
    422393                fibril_mutex_unlock(&conn->lock);
    423394                return retval;
     
    434405        ipc_call_t answer;
    435406
    436         printf("tcp_conn_recv_wait() bsize=%zu\n", bsize);
    437407again:
    438408        fibril_mutex_lock(&conn->lock);
    439409        while (!conn->data_avail) {
    440                 printf("wait for data to be avail\n");
    441410                fibril_condvar_wait(&conn->cv, &conn->lock);
    442411        }
    443412
    444         printf("tcp_conn_recv_wait - get data\n");
    445413        exch = async_exchange_begin(conn->tcp->sess);
    446414        aid_t req = async_send_1(exch, TCP_CONN_RECV_WAIT, conn->id, &answer);
    447415        int rc = async_data_read_start(exch, buf, bsize);
    448         printf("tcp_conn_recv_wait - rc = %d\n", rc);
    449         async_exchange_end(exch);
    450 
    451         if (rc != EOK) {
    452                 printf("got rc=%d\n", rc);
     416        async_exchange_end(exch);
     417
     418        if (rc != EOK) {
    453419                async_forget(req);
    454420                if (rc == EAGAIN) {
     
    464430        async_wait_for(req, &retval);
    465431        if (retval != EOK) {
    466                 printf("got retval != EOK\n");
    467432                if (rc == EAGAIN) {
    468                         printf("rc == EAGAIN\n");
    469433                        conn->data_avail = false;
    470434                }
     
    475439        *nrecv = IPC_GET_ARG1(answer);
    476440        fibril_mutex_unlock(&conn->lock);
    477         printf("tcp_conn_recv_wait: nrecv=%zu\n", *nrecv);
    478         printf("received: '");
    479         size_t i;
    480         for (i = 0; i < *nrecv; i++) {
    481                 putchar((char)((char *)buf)[i]);
    482         }
    483         printf("'\n");
    484441        return EOK;
    485442}
     
    491448        int rc;
    492449
    493         printf("tcp_ev_connected()\n");
    494450        conn_id = IPC_GET_ARG1(*icall);
    495451
    496452        rc = tcp_conn_get(tcp, conn_id, &conn);
    497453        if (rc != EOK) {
    498                 printf("conn ID %zu not found\n",
    499                     conn_id);
    500454                async_answer_0(iid, ENOENT);
    501455                return;
     
    516470        int rc;
    517471
    518         printf("tcp_ev_conn_failed()\n");
    519472        conn_id = IPC_GET_ARG1(*icall);
    520473
    521474        rc = tcp_conn_get(tcp, conn_id, &conn);
    522475        if (rc != EOK) {
    523                 printf("conn ID %zu not found\n",
    524                     conn_id);
    525476                async_answer_0(iid, ENOENT);
    526477                return;
     
    541492        int rc;
    542493
    543         printf("tcp_ev_conn_reset()\n");
    544494        conn_id = IPC_GET_ARG1(*icall);
    545495
    546496        rc = tcp_conn_get(tcp, conn_id, &conn);
    547497        if (rc != EOK) {
    548                 printf("conn ID %zu not found\n",
    549                     conn_id);
    550498                async_answer_0(iid, ENOENT);
    551499                return;
     
    566514        int rc;
    567515
    568         printf("tcp_ev_data()\n");
    569516        conn_id = IPC_GET_ARG1(*icall);
    570517
    571518        rc = tcp_conn_get(tcp, conn_id, &conn);
    572519        if (rc != EOK) {
    573                 printf("conn ID %zu not found\n",
    574                     conn_id);
    575520                async_answer_0(iid, ENOENT);
    576521                return;
     
    585530static void tcp_ev_urg_data(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
    586531{
    587         printf("tcp_ev_urg_data()\n");
    588532        async_answer_0(iid, ENOTSUP);
    589533}
     
    599543        int rc;
    600544
    601         printf("tcp_ev_new_conn()\n");
    602545        lst_id = IPC_GET_ARG1(*icall);
    603546        conn_id = IPC_GET_ARG2(*icall);
    604547
    605         printf("new conn: lst_id=%zu conn_id=%zu\n", lst_id, conn_id);
    606 
    607548        rc = tcp_listener_get(tcp, lst_id, &lst);
    608549        if (rc != EOK) {
    609                 printf("listener ID %zu not found\n",
    610                     lst_id);
    611550                async_answer_0(iid, ENOENT);
    612551                return;
     
    615554        rc = tcp_conn_new(tcp, conn_id, lst->cb, lst->cb_arg, &conn);
    616555        if (rc != EOK) {
    617                 printf("Failed creating new incoming connection.\n");
    618556                async_answer_0(iid, ENOMEM);
    619557                return;
     
    621559
    622560        if (lst->lcb != NULL && lst->lcb->new_conn != NULL) {
    623                 printf("Creating connection fibril\n");
    624561                cinfo = calloc(1, sizeof(tcp_in_conn_t));
    625562                if (cinfo == NULL) {
    626                         printf("Failed creating new incoming connection info.\n");
    627563                        async_answer_0(iid, ENOMEM);
    628564                        return;
     
    634570                fid = fibril_create(tcp_conn_fibril, cinfo);
    635571                if (fid == 0) {
    636                         printf("Error creating connection fibril.\n");
    637572                        async_answer_0(iid, ENOMEM);
    638573                }
     
    649584
    650585        async_answer_0(iid, EOK);
    651 
    652         printf("tcp_cb_conn()\n");
    653586
    654587        while (true) {
     
    656589                ipc_callid_t callid = async_get_call(&call);
    657590
    658                 printf("tcp_cb_conn() - msg %d\n",
    659                     (int)IPC_GET_IMETHOD(call));
    660591                if (!IPC_GET_IMETHOD(call)) {
    661592                        /* TODO: Handle hangup */
     
    694625        tcp_in_conn_t *cinfo = (tcp_in_conn_t *)arg;
    695626
    696         printf("tcp_conn_fibril: begin\n");
    697627        cinfo->lst->lcb->new_conn(cinfo->lst, cinfo->conn);
    698         printf("tcp_conn_fibril: end\n");
    699628        tcp_conn_destroy(cinfo->conn);
    700629
  • uspace/lib/c/generic/inet/udp.c

    r5a5b087 rc3f7d37  
    3636#include <inet/endpoint.h>
    3737#include <inet/udp.h>
    38 #include <io/log.h>
    3938#include <ipc/services.h>
    4039#include <ipc/udp.h>
     
    4847        async_exch_t *exch = async_exchange_begin(udp->sess);
    4948
    50         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_callback_create()");
    51 
    5249        aid_t req = async_send_0(exch, UDP_CALLBACK_CREATE, NULL);
    5350        int rc = async_connect_to_me(exch, 0, 0, 0, udp_cb_conn, udp);
     
    6865        service_id_t udp_svcid;
    6966        int rc;
    70 
    71         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_create()");
    7267
    7368        udp = calloc(1, sizeof(udp_t));
     
    122117        ipc_call_t answer;
    123118
    124         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_create()");
    125 
    126119        assoc = calloc(1, sizeof(udp_assoc_t));
    127120        if (assoc == NULL)
     
    164157        async_exch_t *exch;
    165158
    166         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_destroy()");
    167 
    168159        if (assoc == NULL)
    169160                return;
     
    184175        async_exch_t *exch;
    185176
    186         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_send_msg()");
    187 
    188177        exch = async_exchange_begin(assoc->udp->sess);
    189178        aid_t req = async_send_1(exch, UDP_ASSOC_SEND_MSG, assoc->id, NULL);
     
    228217        async_exch_t *exch;
    229218        ipc_call_t answer;
    230 
    231         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_read()");
    232219
    233220        exch = async_exchange_begin(rmsg->udp->sess);
     
    237224
    238225        if (rc != EOK) {
    239                 log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_read() - rc != EOK");
    240                 async_forget(req);
    241                 return rc;
    242         }
    243 
    244         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_read() - wait for req");
     226                async_forget(req);
     227                return rc;
     228        }
     229
    245230        sysarg_t retval;
    246231        async_wait_for(req, &retval);
    247232        if (retval != EOK) {
    248                 log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_read() - retval != EOK");
    249233                return retval;
    250234        }
    251235
    252         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_read() - OK");
    253236        return EOK;
    254237}
     
    274257        inet_ep_t ep;
    275258        ipc_call_t answer;
    276 
    277         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_info()");
    278259
    279260        exch = async_exchange_begin(udp->sess);
     
    303284        async_exch_t *exch;
    304285
    305         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_discard()");
    306 
    307286        exch = async_exchange_begin(udp->sess);
    308287        sysarg_t rc = async_req_0_0(exch, UDP_RMSG_DISCARD);
     
    330309        int rc;
    331310
    332         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_ev_data()");
    333 
    334311        while (true) {
    335312                rc = udp_rmsg_info(udp, &rmsg);
    336313                if (rc != EOK) {
    337                         log_msg(LOG_DEFAULT, LVL_NOTE, "Error getting message info");
    338314                        break;
    339315                }
     
    341317                rc = udp_assoc_get(udp, rmsg.assoc_id, &assoc);
    342318                if (rc != EOK) {
    343                         log_msg(LOG_DEFAULT, LVL_NOTE, "assoc ID %zu not found",
    344                             rmsg.assoc_id);
    345319                        continue;
    346320                }
     
    351325                rc = udp_rmsg_discard(udp);
    352326                if (rc != EOK) {
    353                         log_msg(LOG_DEFAULT, LVL_NOTE, "Error discarding message");
    354327                        break;
    355328                }
     
    364337
    365338        async_answer_0(iid, EOK);
    366 
    367         log_msg(LOG_DEFAULT, LVL_NOTE, "udp_cb_conn()");
    368339
    369340        while (true) {
     
    371342                ipc_callid_t callid = async_get_call(&call);
    372343
    373                 log_msg(LOG_DEFAULT, LVL_NOTE, "udp_cb_conn() - msg %d",
    374                     (int)IPC_GET_IMETHOD(call));
    375344                if (!IPC_GET_IMETHOD(call)) {
    376345                        /* TODO: Handle hangup */
Note: See TracChangeset for help on using the changeset viewer.