Just an update, I changed if(str_line > 0)
to if(str_line[0] > 0) But I have concerns about this transport and I am wondering if anyone is actually using it? Not only the things I mentioned below, but in addition there is a possibility of buffer overflows if one reads in more than 32000 bytes, in addition to inefficiencies in how data is read and moved into the buffer. Yes, once I get things ported and working, I will be working on this and other things, but I thought I would point these out. Nadir Amra Integrated Web Services for IBM i Operating System Internet: [email protected] Nadir Amra/Rochester/i...@ibmus wrote on 05/20/2010 07:24:59 PM: > [image removed] > > Porting problems > > Nadir Amra > > to: > > Apache AXIS C Developers List > > 05/20/2010 07:25 PM > > Please respond to "Apache AXIS C Developers List" > > While porting to IBM i (aka OS/400), found the following problem which I > want to verify with developers since I really do not understand how this > works... > > In file src\core\transport\tcp\receiver\simple_tcp_svr_conn.c, there is > the routine at the bottom. > > My compile fails due to the line > > if(str_line > 0) > > which I do not understand. Can anyone explain? The other thing I > question about this routine is the returning of a buffer that basically > declared in automatic storage. See statement: > > svr_conn->buffer = str_line; > > ==================== > > AXIS2_EXTERN axis2_char_t *AXIS2_CALL > axis2_simple_tcp_svr_conn_read_request( > axis2_simple_tcp_svr_conn_t * svr_conn, > const axutil_env_t * env) > { > int size = 32000; > axis2_char_t str_line[32000]; > axis2_char_t tmp_buf[32000]; > int read = -1; > > AXIS2_ENV_CHECK(env, NULL); > > memset(str_line, 0, size); > while((read = axutil_stream_peek_socket(svr_conn->stream, env, > tmp_buf, size - 1)) > 0) > { > tmp_buf[read] = '\0'; > if(read > 0) > { > read = axutil_stream_read(svr_conn->stream, env, tmp_buf, size > - 1); > if(read > 0) > { > tmp_buf[read] = '\0'; > strcat(str_line, tmp_buf); > break; > } > else > { > break; > } > } > } > if(str_line > 0) > { > svr_conn->buffer = str_line; > } > return svr_conn->buffer; > } > > > > > Nadir Amra > Integrated Web Services for IBM i Operating System > Internet: [email protected] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
