_osrf_app_request_free( req );
}
+
+void osrf_app_session_request_reset_timeout( osrf_app_session* session, int req_id ) {
+ if(session == NULL) return;
+ debug_handler("Resetting timeout %d", req_id );
+ osrf_app_request* req = _osrf_app_session_get_request( session, req_id );
+ if(req == NULL) return;
+ req->reset_timeout = 1;
+}
+
/** Checks the receive queue for messages. If any are found, the first
* is popped off and returned. Otherwise, this method will wait at most timeout
* seconds for a message to appear in the receive queue. Once it arrives it is returned.
if( req->complete )
return NULL;
- remaining -= (int) (time(NULL) - start);
+ if(req->reset_timeout) {
+ remaining = (time_t) timeout;
+ req->reset_timeout = 0;
+ debug_handler("Recevied a timeout reset");
+ } else {
+ remaining -= (int) (time(NULL) - start);
+ }
}
debug_handler("Returning NULL from app_request_recv after timeout");
/** List of responses to our request */
osrf_message* result;
+ /* if set to true, then a call that is waiting on a response, will reset the
+ timeout and set this variable back to false */
+ int reset_timeout;
+
/** So we can be listified */
struct osrf_app_request_struct* next;
};
int _osrf_app_request_resend( osrf_app_request* req );
+/* tells the request to reset it's wait timeout */
+void osrf_app_session_request_reset_timeout( osrf_app_session* session, int req_id );
+
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Session functions
osrf_app_session_set_complete( session, msg->thread_trace );
return NULL;
+ case OSRF_STATUS_CONTINUE:
+ osrf_app_session_request_reset_timeout( session, msg->thread_trace );
+ return NULL;
+
case OSRF_STATUS_REDIRECTED:
osrf_app_session_reset_remote( session );
session->state = OSRF_SESSION_DISCONNECTED;