19 #ifndef __PROXYREQ_H__
20 #define __PROXYREQ_H__
106 #define PROXYREQ_MAXSIZE 1024 * 1024 * 4096 // 4MB
288 #define PROXY_REQUEST_LOCKED(soap,mobjid,mutex) { \
289 struct proxyreq *_pr; \
291 _pr = (struct proxyreq *)(soap)->user; \
293 verror("no proxyreq state!\n"); \
294 pthread_mutex_unlock(mutex); \
297 if (_pr->state == PROXYREQ_STATE_NEW) { \
298 _pr->state = PROXYREQ_STATE_BUFFERED; \
299 _rc = proxyreq_attach_objid(_pr,mobjid); \
300 if (_rc != SOAP_OK) { \
301 pthread_mutex_unlock(mutex); \
304 _pr->objtype_mutex = mutex; \
313 else if (_pr->state == PROXYREQ_STATE_PROCESSING) { \
314 _pr->state = PROXYREQ_STATE_SERVING; \
318 _pr->objtype_mutex = mutex; \
322 _pr->len = _pr->bufsiz = _pr->bufidx = 0; \
324 if (_pr->orig_fclose) { \
325 _pr->soap->fclose = _pr->orig_fclose; \
326 _pr->orig_fclose = NULL; \
331 verror("unexpected proxyreq state %d; bug?!\n",_pr->state); \
332 pthread_mutex_unlock(mutex); \
337 #define PROXY_REQUEST_HANDLE_STOP(soap) { \
338 struct proxyreq *_pr; \
339 _pr = (struct proxyreq *)(soap)->user; \
341 if (((soap)->error = proxyreq_send_request(_pr)) != SOAP_OK) { \
342 verror("proxyreq_send_request error %d\n",retval); \
344 if (_pr->objtype_mutex) \
345 pthread_mutex_unlock(_pr->objtype_mutex); \
struct proxyreq * proxyreq_create(struct soap *soap)
void proxyreq_detach_soap(struct proxyreq *pr)
int proxyreq_attach_objid(struct proxyreq *pr, int objid)
int proxyreq_send_response(struct proxyreq *pr)
int(* orig_fsend)(struct soap *soap, const char *s, size_t n)
int(* orig_fclose)(struct soap *soap)
int proxyreq_send_request(struct proxyreq *pr)
pthread_mutex_t * objtype_mutex
int proxyreq_attach_new_objid(struct proxyreq *pr, int objid, struct monitor *monitor)
size_t(* orig_frecv)(struct soap *soap, char *s, size_t n)
int proxyreq_recv_request(struct monitor *monitor, struct monitor_msg *msg)
int proxyreq_recv_response(struct monitor *monitor, struct monitor_msg *msg)
struct proxyreq * proxyreq_create_proxied(int objid, char *buf, int buflen)
void proxyreq_free_buffer(struct proxyreq *pr)
void proxyreq_free(struct proxyreq *pr)
int proxyreq_handle_request(struct soap *soap, char *svc_name)