Ignore:
Timestamp:
May 13, 2014, 11:39:04 AM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update trunk to 3.6.23

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/lib/tsocket/tsocket_bsd.c

    r745 r862  
    655655        void *event_ptr;
    656656        struct tevent_fd *fde;
     657        bool optimize_recvfrom;
    657658
    658659        void *readable_private;
     
    661662        void (*writeable_handler)(void *private_data);
    662663};
     664
     665bool tdgram_bsd_optimize_recvfrom(struct tdgram_context *dgram,
     666                                  bool on)
     667{
     668        struct tdgram_bsd *bsds =
     669                talloc_get_type(_tdgram_context_data(dgram),
     670                struct tdgram_bsd);
     671        bool old;
     672
     673        if (bsds == NULL) {
     674                /* not a bsd socket */
     675                return false;
     676        }
     677
     678        old = bsds->optimize_recvfrom;
     679        bsds->optimize_recvfrom = on;
     680
     681        return old;
     682}
    663683
    664684static void tdgram_bsd_fde_handler(struct tevent_context *ev,
     
    838858        }
    839859
     860
    840861        /*
    841862         * this is a fast path, not waiting for the
     
    843864         * about 10%-20% performance in benchmark tests.
    844865         */
    845         tdgram_bsd_recvfrom_handler(req);
    846         if (!tevent_req_is_in_progress(req)) {
    847                 goto post;
     866        if (bsds->optimize_recvfrom) {
     867                /*
     868                 * We only do the optimization on
     869                 * recvfrom if the caller asked for it.
     870                 *
     871                 * This is needed because in most cases
     872                 * we preferr to flush send buffers before
     873                 * receiving incoming requests.
     874                 */
     875                tdgram_bsd_recvfrom_handler(req);
     876                if (!tevent_req_is_in_progress(req)) {
     877                        goto post;
     878                }
    848879        }
    849880
     
    14011432        void *event_ptr;
    14021433        struct tevent_fd *fde;
     1434        bool optimize_readv;
    14031435
    14041436        void *readable_private;
     
    14071439        void (*writeable_handler)(void *private_data);
    14081440};
     1441
     1442bool tstream_bsd_optimize_readv(struct tstream_context *stream,
     1443                                bool on)
     1444{
     1445        struct tstream_bsd *bsds =
     1446                talloc_get_type(_tstream_context_data(stream),
     1447                struct tstream_bsd);
     1448        bool old;
     1449
     1450        if (bsds == NULL) {
     1451                /* not a bsd socket */
     1452                return false;
     1453        }
     1454
     1455        old = bsds->optimize_readv;
     1456        bsds->optimize_readv = on;
     1457
     1458        return old;
     1459}
    14091460
    14101461static void tstream_bsd_fde_handler(struct tevent_context *ev,
     
    16201671         * about 10%-20% performance in benchmark tests.
    16211672         */
    1622         tstream_bsd_readv_handler(req);
    1623         if (!tevent_req_is_in_progress(req)) {
    1624                 goto post;
     1673        if (bsds->optimize_readv) {
     1674                /*
     1675                 * We only do the optimization on
     1676                 * readv if the caller asked for it.
     1677                 *
     1678                 * This is needed because in most cases
     1679                 * we preferr to flush send buffers before
     1680                 * receiving incoming requests.
     1681                 */
     1682                tstream_bsd_readv_handler(req);
     1683                if (!tevent_req_is_in_progress(req)) {
     1684                        goto post;
     1685                }
    16251686        }
    16261687
Note: See TracChangeset for help on using the changeset viewer.