• Patch: Elm ME+ 2.5 PLalpha48 -> Elm ME+ 2.5 PLalpha49 [4/9] (4/5)

    From Kari Hurtta@21:1/5 to All on Thu Jan 3 16:42:46 2019
    [continued from previous message]

    ! fprintf(transaction_file," %02X",c);
    !
    ! if (c == 0x0A && i < n-1) {
    ! fprintf(transaction_file,
    ! "\n%d [%s] %02d:%02d:%02d %c<< [continue] ",
    ! getpid(),id,
    ! zz ? zz->tm_hour : 00,
    ! zz ? zz->tm_min : 00,
    ! zz ? zz->tm_sec : 00,
    ! ss->stack_len > 1 ? 'T' : '<');
    ! }
    ! }
    ! }
    ! if (q) {
    ! putc('"',transaction_file);
    }
    ! putc('\n',transaction_file);
    }

    - buffer -> read_len += n;
    - DPRINT(Debug,8,(&Debug,
    - "ReadFromStream: Read %d bytes (%d total)\n",
    - n,buffer->read_len));
    - }

    return n;
    }

    --- 1353,1438 ----
    struct Read_Buffer *buffer;
    int wanted;
    {
    ! int n = 0;

    + DPRINT(Debug,19,(&Debug,
    + "ReadFromStream: ss=%p\n",
    + ss));
    +
    if (ss->magic != SS_magic)
    panic("STREAMSCHED PANIC",__FILE__,__LINE__,"ReadFromStream",
    "Bad stream (magic)",0);

    ! if (ss->stack_len > 0) {
    !
    ! n = (*(ss -> this_stack[0].TYPE))->read_from_it(ss,0,buffer,wanted);

    ! if (n > 0) {
    !
    ! if (transaction_file) {
    ! time_t tmp = time(NULL);
    ! struct tm * zz = localtime(&tmp);
    ! int i;
    ! int q = 0;
    ! char * id = return_stream_ident(ss);

    ! fprintf(transaction_file,
    ! "%d [%s] %02d:%02d:%02d %c<< [len %4d] ",
    ! getpid(),id,
    ! zz ? zz->tm_hour : 00,
    ! zz ? zz->tm_min : 00,
    ! zz ? zz->tm_sec : 00,
    ! ss->stack_len > 1 ? 'T' : '<',
    ! n);
    !
    ! for (i = 0; i < n; i++) {
    ! unsigned char c =
    ! (unsigned char) buffer -> read_buffer[buffer -> read_len
    ! + i];
    !
    !