FACT++  1.0
int web_start_read ( int  conn_id,
int  size 
)

Definition at line 149 of file webTcpip.c.

References ast_read_h(), DNA_CONNECTION::buffer, DNA_CONNECTION::buffer_size, DNA_CONNECTION::busy, DNA_CONNECTION::curr_buffer, DNA_CONNECTION::curr_size, DIM_ERROR, DIMTCPRDERR, Dna_conns, dna_report_error(), DNA_CONNECTION::full_size, size, tcpip_failure(), Tcpip_max_io_data_read, and tcpip_start_read().

Referenced by ast_conn_h().

150 {
151  register DNA_CONNECTION *dna_connp = &Dna_conns[conn_id];
152  register int tcpip_code, read_size;
153  int max_io_data;
154 
155  if(!dna_connp->busy)
156  {
157  return(0);
158  }
159 
160  dna_connp->curr_size = size;
161  dna_connp->full_size = size;
162  if(size > dna_connp->buffer_size)
163  {
164  dna_connp->buffer =
165  (int *) realloc(dna_connp->buffer, (size_t)size);
166  memset(dna_connp->buffer, 0, (size_t)size);
167  dna_connp->buffer_size = size;
168  }
169  dna_connp->curr_buffer = (char *) dna_connp->buffer;
170  max_io_data = Tcpip_max_io_data_read;
171  read_size = (size > max_io_data) ? max_io_data : size ;
172 
173  tcpip_code = tcpip_start_read(conn_id, dna_connp->curr_buffer,
174  read_size, ast_read_h);
175  if(tcpip_failure(tcpip_code)) {
176  dna_report_error(conn_id, tcpip_code,
177  "Reading from", DIM_ERROR, DIMTCPRDERR);
178 
179  return(0);
180  }
181 
182  return(1);
183 }
int Tcpip_max_io_data_read
Definition: webTcpip.c:9
int busy
Definition: dim.h:381
#define DIMTCPRDERR
Definition: dim_common.h:293
int curr_size
Definition: dim.h:387
int tcpip_start_read(int conn_id, char *buffer, int size, void(*ast_routine)())
Definition: tcpip.c:949
void dna_report_error(int conn_id, int code, char *routine_name, int severity, int errcode)
Definition: dna.c:903
int size
Definition: db_dim_server.c:17
DllExp DIM_NOSHARE DNA_CONNECTION * Dna_conns
Definition: conn_handler.c:31
int full_size
Definition: dim.h:388
int * buffer
Definition: dim.h:384
static void ast_read_h(int conn_id, int status, int size)
Definition: webTcpip.c:70
int buffer_size
Definition: dim.h:385
int tcpip_failure(int code)
Definition: tcpip.c:1540
char * curr_buffer
Definition: dim.h:386

+ Here is the call graph for this function:

+ Here is the caller graph for this function: