Changeset 3abf0760 in mainline


Ignore:
Timestamp:
2013-05-16T12:25:06Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
89ac5513
Parents:
4510e06
Message:

Use two serialized sessions instead of one parallel to communicate with
the serial service.

This workarounds:

#508 Parallel sessions don't mix well with call forwarding

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/slip/slip.c

    r4510e06 r3abf0760  
    275275        service_id_t linksid;
    276276        category_id_t iplinkcid;
    277         async_sess_t *sess = NULL;
     277        async_sess_t *sess_in = NULL;
     278        async_sess_t *sess_out = NULL;
    278279        fid_t fid;
    279280        int rc;
     
    307308
    308309        /*
    309          * Create a parallel session because we will need to be able to both
    310          * read and write from the char_dev.
     310         * Create two sessions to allow to both read and write from the
     311         * char_dev at the same time.
    311312         */
    312         sess = loc_service_connect(EXCHANGE_PARALLEL, svcid, 0);
    313         if (!sess) {
     313        sess_out = loc_service_connect(EXCHANGE_SERIALIZE, svcid, 0);
     314        if (!sess_out) {
    314315                log_msg(LOG_DEFAULT, LVL_ERROR,
    315316                    "Failed to connect to service %s (ID=%d)",
     
    317318                return rc;
    318319        }
    319         slip_iplink.arg = sess;
     320        slip_iplink.arg = sess_out;
     321
     322        sess_in = loc_service_connect(EXCHANGE_SERIALIZE, svcid, 0);
     323        if (!sess_in) {
     324                log_msg(LOG_DEFAULT, LVL_ERROR,
     325                    "Failed to connect to service %s (ID=%d)",
     326                    svcstr, (int) svcid);
     327                goto fail;
     328        }
    320329
    321330        rc = loc_service_register(linkstr, &linksid);
     
    335344        }
    336345
    337         fid = fibril_create(slip_recv_fibril, sess);
     346        fid = fibril_create(slip_recv_fibril, sess_in);
    338347        if (!fid) {
    339348                log_msg(LOG_DEFAULT, LVL_ERROR,
     
    346355
    347356fail:
    348         if (sess)
    349                 async_hangup(sess);
     357        if (sess_out)
     358                async_hangup(sess_out);
     359        if (sess_in)
     360                async_hangup(sess_in);
    350361
    351362        /*
Note: See TracChangeset for help on using the changeset viewer.