Changeset 1065

Show
Ignore:
Timestamp:
07/21/08 14:37:19 (6 months ago)
Author:
aj
Message:

Chaskiel Grundman:
This uncovered an issue in openct. namely, that eutron_recv doesn't wait
long enough. (my device sent a wtx request after 23 loops, but we abort
after 20). Also, eutron_recv returns short writes to its caller, even
though t1_xcv cannot deal with that at all.

This patch fixes those things, as well as changes a memcpy of overlapping
memory areas to a memmove.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/ifd/ifd-eutron.c

    r964 r1065  
    171171        /* move the data to the beginning of the buffer, so there's a big 
    172172         * contiguous chunk */ 
    173         memcpy(priv->readbuffer, &priv->readbuffer[priv->tail], 
     173        memmove(priv->readbuffer, &priv->readbuffer[priv->tail], 
    174174               priv->head - priv->tail); 
    175175        priv->head -= priv->tail; 
    176176        /* since we set tail=0 here, the rest of the function can ignore it */ 
    177177        priv->tail = 0; 
    178         for (c = 0; c < 20; c++) { 
     178        for (c = 0; c < 30; c++) { 
    179179                rbs = 499 - priv->head; 
    180180                if (rbs == 0) 
     
    194194        } 
    195195        if (len > priv->head) 
    196                 len = priv->head; 
     196                return -1; 
    197197        memcpy(buffer, priv->readbuffer, len); 
    198198        priv->tail += len;