buffer_add(tmp_buf,arg);
buffer_add(tmp_buf,buffer->buf);
arg = (char*) apr_pstrdup(p, tmp_buf->buf);
+ // arg = buffer_data(tmp_buf);;
buffer_free(tmp_buf);
} else {
arg = (char*) apr_pstrdup(p, buffer->buf);
+ // arg = buffer_data(buffer);
}
buffer_free(buffer);
}
+ debug_handler("params args are %s", arg);
+
if( ! arg || !arg[0] ) { /* we received no request */
warning_handler("No Args");
char* argcopy = (char*) apr_pstrdup(p, arg);
- while( argcopy && (val = ap_getword(p, &argcopy, '&'))) {
+ while( argcopy && (val = ap_getword(p, (const char**) &argcopy, '&'))) {
+
+ //const char* val2 = val;
- key = ap_getword(r->pool,&val, '=');
+ key = ap_getword(r->pool, (const char**) &val, '=');
if(!key || !key[0])
break;
}
osrf_app_session_request_finish( session, req_id );
+ debug_handler("gateway process message successfully");
return OK;
if( req->payload ) {
osrf_message_free( req->payload );
}
+
/*
osrf_message* cur_msg = req->result;
while( cur_msg != NULL ) {
*/
free( req );
+ debug_handler("after request free");
}
/** Pushes the given message onto the list of 'responses' to this request */
debug_handler("Removing request [%d] from session [%s] [%s]",
req->request_id, session->remote_service, session->session_id );
+
osrf_app_request* first = session->request_queue;
if(first->request_id == req->request_id) {
- if(first->next == NULL) { /* only one in the list */
+ session->request_queue = first->next;
+ return;
+ /*
+ if(first->next == NULL) {
session->request_queue = NULL;
} else {
osrf_app_request* tmp = first->next;
session->request_queue = tmp;
}
+ */
}
osrf_app_request* lead = first->next;
while( lead != NULL ) {
if(lead->request_id == req->request_id) {
- osrf_app_request* tmp = lead->next;
- first->next = tmp;
+ first->next = lead->next;
return;
}
first = lead;
osrf_message* _do_server( osrf_app_session*, osrf_message* );
int osrf_stack_process( transport_client* client, int timeout ) {
+ debug_handler("osrf_stack_process going into client_recv");
transport_message* msg = client_recv( client, timeout );
+ debug_handler("osrf_stack_process after client_recv");
if(msg == NULL) return 0;
debug_handler( "Received message from transport code from %s", msg->sender );
int status = osrf_stack_transport_handler( msg );
void grab_incoming( void * session, char* data ) {
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }
+ debug_handler("Parsing incoming XML chunk");
xmlParseChunk(ses->parser_ctxt, data, strlen(data), 0);
+ debug_handler("Completed parsing incoming XML chunk");
}
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }
+ debug_handler("transport_session: startElementHandler");
+
if( strcmp( name, "message" ) == 0 ) {
ses->state_machine->in_message = 1;
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }
+ debug_handler("transport_session: endElementHandler");
+
if( strcmp( name, "message" ) == 0 ) {
/* pass off the message info the callback */
strncpy( data, (char*) ch, len );
data[len] = 0;
+ debug_handler("transport_session: characterElementHandler");
+
//printf( "Handling characters: %s\n", data );
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }