Ignore:
Timestamp:
10/18/17 13:54:41 (7 years ago)
Author:
tbretz
Message:
Updated to v20r20 - This also includes some minor fixes, I requested.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/dim/src/dna.c

    r15282 r18920  
    1616#define DNA
    1717#include <dim.h>
     18#include <time.h>
    1819
    1920/* global definitions */
     
    353354        tcpip_code = dna_write_bytes(conn_id, &test_pkt, READ_HEADER_SIZE,0);
    354355        if(tcpip_failure(tcpip_code)) {
    355                  /* Connection lost. Signal upper layer ? */
     356/* Connection lost. Signal upper layer ? No -> creates a deadlock in the Timer Thread*/
     357/*
    356358                if(dna_connp->read_ast)
    357359                        dna_connp->read_ast(conn_id, NULL, 0, STA_DISC);
     360*/
    358361                return;
    359362        }
     
    624627        time_t oldest;
    625628        int oldesti = 0;
     629/*
    626630        extern time_t time();
     631*/
    627632
    628633        if(type == 0)
     
    822827        if (tcpip_failure(tcpip_code))
    823828        {
     829                if(src_type == SRC_DIS)
     830                        strcpy(src_type_str,"Server");
     831                else if(src_type == SRC_DIC)
     832                        strcpy(src_type_str,"Client");
     833                else
     834                        strcpy(src_type_str,"Unknown type");
    824835                dim_print_date_time();
    825                 printf(" Client Establishing Connection: Couldn't write to Conn %3d : Server %s@%s\n",conn_id,
    826                         Net_conns[conn_id].task, Net_conns[conn_id].node);
    827                 fflush(stdout);
     836                sprintf(str," %s Establishing Connection: Couldn't write to Conn %3d : Server %s@%s\n",
     837                                src_type_str, conn_id, Net_conns[conn_id].task, Net_conns[conn_id].node);
     838                if (!strcmp(server_task, "DIM_DNS"))
     839                        dna_report_error(conn_id, tcpip_code, str, DIM_ERROR, DIMDNSCNERR);
     840                else
     841                        dna_report_error(conn_id, tcpip_code, str, DIM_ERROR, DIMTCPCNERR);
    828842                dna_close(conn_id);
    829843                return(0);
     
    841855                    dna_report_error(conn_id, -1,
    842856                                     "Write timeout, disconnecting from", DIM_ERROR, DIMTCPWRTMO);
    843                         if(!find_pend_conn(Net_conns[conn_id].node, Net_conns[conn_id].task, 0, 0, 1))
     857                        if (!find_pend_conn(Net_conns[conn_id].node, Net_conns[conn_id].task, 0, 0, 1))
     858                        {
    844859                                ins_pend_conn(Net_conns[conn_id].node, Net_conns[conn_id].task, 0, 0, 1, time(NULL));
     860                        }
    845861                }
    846862                release_conn(conn_id);
Note: See TracChangeset for help on using the changeset viewer.