TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
stdsoap2.cpp File Reference
#include "stdsoap2.h"
+ Include dependency graph for stdsoap2.cpp:

Macros

#define GSOAP_LIB_VERSION   20817
 
#define SOAP_UNKNOWN_CHAR   (127)
 
#define SOAP_LT   (soap_wchar)(-2) /* XML-specific '<' */
 
#define SOAP_TT   (soap_wchar)(-3) /* XML-specific '</' */
 
#define SOAP_GT   (soap_wchar)(-4) /* XML-specific '>' */
 
#define SOAP_QT   (soap_wchar)(-5) /* XML-specific '"' */
 
#define SOAP_AP   (soap_wchar)(-6) /* XML-specific ''' */
 
#define soap_blank(c)   ((c)+1 > 0 && (c) <= 32)
 
#define soap_notblank(c)   ((c) > 32)
 
#define soap_hash_ptr(p)   ((size_t)(((unsigned long)(p) >> 3) & (SOAP_PTRHASH-1)))
 
#define SOAP_TCP_SELECT_RCV   0x1
 
#define SOAP_TCP_SELECT_SND   0x2
 
#define SOAP_TCP_SELECT_ERR   0x4
 
#define SOAP_TCP_SELECT_ALL   0x7
 
#define SOAP_SOCKBLOCK(fd)   fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)&~O_NONBLOCK);
 
#define SOAP_SOCKNONBLOCK(fd)   fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)|O_NONBLOCK);
 
#define SOAP_CANARY   (0xC0DE)
 
#define SOAP_STR_PADDING   (soap_padding)
 
#define SOAP_STR_EOS   (soap_padding)
 
#define SOAP_NON_NULL   (soap_padding)
 

Functions

static void soap_init_logs (struct soap *)
 
static int soap_set_error (struct soap *, const char *, const char *, const char *, const char *, int)
 
static int soap_copy_fault (struct soap *, const char *, const char *, const char *, const char *)
 
static int soap_getattrval (struct soap *, char *, size_t, soap_wchar)
 
static void soap_free_ns (struct soap *soap)
 
static soap_wchar soap_char (struct soap *)
 
static soap_wchar soap_get_pi (struct soap *)
 
static int soap_isxdigit (int)
 
static void * fplugin (struct soap *, const char *)
 
static size_t soap_count_attachments (struct soap *soap)
 
static int soap_try_connect_command (struct soap *, int http_command, const char *endpoint, const char *action)
 
static int soap_has_copies (struct soap *, const char *, const char *)
 
static void soap_init_iht (struct soap *)
 
static void soap_free_iht (struct soap *)
 
static void soap_init_pht (struct soap *)
 
static void soap_free_pht (struct soap *)
 
static const char * soap_set_validation_fault (struct soap *, const char *, const char *)
 
static int soap_isnumeric (struct soap *, const char *)
 
static struct soap_nlistsoap_push_ns (struct soap *soap, const char *id, const char *ns, short utilized)
 
static void soap_utilize_ns (struct soap *soap, const char *tag)
 
static struct soap_multipartsoap_new_multipart (struct soap *, struct soap_multipart **, struct soap_multipart **, char *, size_t)
 
static int soap_putdimefield (struct soap *, const char *, size_t)
 
static char * soap_getdimefield (struct soap *, size_t)
 
static void soap_select_mime_boundary (struct soap *)
 
static int soap_valid_mime_boundary (struct soap *)
 
static void soap_resolve_attachment (struct soap *, struct soap_multipart *)
 
static const char * soap_decode (char *, size_t, const char *, const char *)
 
static soap_wchar soap_getchunkchar (struct soap *)
 
static const char * http_error (struct soap *, int)
 
static int http_get (struct soap *)
 
static int http_405 (struct soap *)
 
static int http_200 (struct soap *)
 
static int http_post (struct soap *, const char *, const char *, int, const char *, const char *, size_t)
 
static int http_send_header (struct soap *, const char *)
 
static int http_post_header (struct soap *, const char *, const char *)
 
static int http_response (struct soap *, int, size_t)
 
static int http_parse (struct soap *)
 
static int http_parse_header (struct soap *, const char *, const char *)
 
static int fsend (struct soap *, const char *, size_t)
 
static size_t frecv (struct soap *, char *, size_t)
 
static int tcp_init (struct soap *)
 
static const char * tcp_error (struct soap *)
 
static int tcp_gethost (struct soap *, const char *addr, struct in_addr *inaddr)
 
static SOAP_SOCKET tcp_connect (struct soap *, const char *endpoint, const char *host, int port)
 
static SOAP_SOCKET tcp_accept (struct soap *, SOAP_SOCKET, struct sockaddr *, int *)
 
static int tcp_select (struct soap *, SOAP_SOCKET, int, int)
 
static int tcp_disconnect (struct soap *)
 
static int tcp_closesocket (struct soap *, SOAP_SOCKET)
 
static int tcp_shutdownsocket (struct soap *, SOAP_SOCKET, int)
 
static const char * soap_strerror (struct soap *)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw (struct soap *soap, const char *s, size_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_flush (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_flush_raw (struct soap *soap, const char *s, size_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_send (struct soap *soap, const char *s)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_send2 (struct soap *soap, const char *s1, const char *s2)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_send3 (struct soap *soap, const char *s1, const char *s2, const char *s3)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_recv_raw (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_recv (struct soap *soap)
 
SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getchar (struct soap *soap)
 
SOAP_FMAC1 const struct
soap_code_map *SOAP_FMAC2 
soap_code (const struct soap_code_map *code_map, const char *str)
 
SOAP_FMAC1 long SOAP_FMAC2 soap_code_int (const struct soap_code_map *code_map, const char *str, long other)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_code_str (const struct soap_code_map *code_map, long code)
 
SOAP_FMAC1 long SOAP_FMAC2 soap_code_bits (const struct soap_code_map *code_map, const char *str)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_code_list (struct soap *soap, const struct soap_code_map *code_map, long code)
 
SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_get (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_move (struct soap *soap, size_t n)
 
SOAP_FMAC1 size_t SOAP_FMAC2 soap_tell (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_pututf8 (struct soap *soap, register unsigned long c)
 
SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getutf8 (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_puthex (struct soap *soap, const unsigned char *s, int n)
 
SOAP_FMAC1 unsigned char
*SOAP_FMAC2 
soap_gethex (struct soap *soap, int *n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_putbase64 (struct soap *soap, const unsigned char *s, int n)
 
SOAP_FMAC1 unsigned char
*SOAP_FMAC2 
soap_getbase64 (struct soap *soap, int *n, int malloc_flag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_xop_forward (struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_dime_forward (struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_strdup (struct soap *soap, const char *s)
 
SOAP_FMAC1 wchar_t *SOAP_FMAC2 soap_wstrdup (struct soap *soap, const wchar_t *s)
 
SOAP_FMAC1 struct soap_blist
*SOAP_FMAC2 
soap_new_block (struct soap *soap)
 
SOAP_FMAC1 void *SOAP_FMAC2 soap_push_block (struct soap *soap, struct soap_blist *b, size_t n)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_pop_block (struct soap *soap, struct soap_blist *b)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_update_pointers (struct soap *soap, char *start, char *end, char *p1, char *p2)
 
static int soap_has_copies (struct soap *soap, register const char *start, register const char *end)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_resolve (struct soap *soap)
 
SOAP_FMAC1 size_t SOAP_FMAC2 soap_size_block (struct soap *soap, struct soap_blist *b, size_t n)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_first_block (struct soap *soap, struct soap_blist *b)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_next_block (struct soap *soap, struct soap_blist *b)
 
SOAP_FMAC1 size_t SOAP_FMAC2 soap_block_size (struct soap *soap, struct soap_blist *b)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_end_block (struct soap *soap, struct soap_blist *b)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_save_block (struct soap *soap, struct soap_blist *b, char *p, int flag)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_putsize (struct soap *soap, const char *type, int size)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_putsizes (struct soap *soap, const char *type, const int *size, int dim)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_putsizesoffsets (struct soap *soap, const char *type, const int *size, const int *offset, int dim)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_putoffset (struct soap *soap, int offset)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_putoffsets (struct soap *soap, const int *offset, int dim)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_size (const int *size, int dim)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getoffsets (const char *attr, const int *size, int *offset, int dim)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getsize (const char *attr1, const char *attr2, int *j)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getsizes (const char *attr, int *size, int dim)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getposition (const char *attr, int *pos)
 
SOAP_FMAC1 struct soap_nlist
*SOAP_FMAC2 
soap_push_namespace (struct soap *soap, const char *id, const char *ns)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_pop_namespace (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_match_namespace (struct soap *soap, const char *id1, const char *id2, size_t n1, size_t n2)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_current_namespace (struct soap *soap, const char *tag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_tag_cmp (const char *s, const char *t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_match_tag (struct soap *soap, const char *tag1, const char *tag2)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_match_array (struct soap *soap, const char *type)
 
SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_bind (struct soap *soap, const char *host, int port, int backlog)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_poll (struct soap *soap)
 
SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_closesock (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_force_closesock (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_cleanup (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_done (struct soap *soap)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_get_header_attribute (struct soap *soap, const char *line, const char *key)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_decode_key (char *buf, size_t len, const char *val)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_decode_val (char *buf, size_t len, const char *val)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_response (struct soap *soap, int status)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_url (struct soap *soap, const char *s, const char *t)
 
SOAP_FMAC1 size_t SOAP_FMAC2 soap_encode_url (const char *s, char *t, size_t len)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_encode_url_string (struct soap *soap, const char *s)
 
SOAP_FMAC1 size_t SOAP_FMAC2 soap_hash (register const char *s)
 
SOAP_FMAC1 struct soap
*SOAP_FMAC2 soap_versioning() 
soap_new (soap_mode imode, soap_mode omode)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_free (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_del (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_embed (struct soap *soap, const void *p, const struct soap_array *a, int n, const char *tag, int type)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup (struct soap *soap, const void *p, int type, struct soap_plist **ppp)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter (struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup (struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_begin_count (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_end_count (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_begin_send (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_embedded (struct soap *soap, const void *p, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_reference (struct soap *soap, const void *p, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference (struct soap *soap, const void *p, const struct soap_array *a, int n, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_embedded_id (struct soap *soap, int id, const void *p, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_is_embedded (struct soap *soap, struct soap_plist *pp)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_is_single (struct soap *soap, struct soap_plist *pp)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_embedded (struct soap *soap, struct soap_plist *pp)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_attachment (struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, const char *aid, const char *atype, const char *aoptions, int n, const char *type, int t)
 
SOAP_FMAC1 struct soap_ilist
*SOAP_FMAC2 
soap_lookup (struct soap *soap, const char *id)
 
SOAP_FMAC1 struct soap_ilist
*SOAP_FMAC2 
soap_enter (struct soap *soap, const char *id)
 
SOAP_FMAC1 void *SOAP_FMAC2 soap_malloc (struct soap *soap, size_t n)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_dealloc (struct soap *soap, void *p)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_delete (struct soap *soap, void *p)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_delegate_deletion (struct soap *soap, struct soap *soap_to)
 
SOAP_FMAC1 struct soap_clist
*SOAP_FMAC2 
soap_link (struct soap *soap, void *p, int t, int n, int(*fdelete)(struct soap_clist *))
 
SOAP_FMAC1 int SOAP_FMAC2 soap_unlink (struct soap *soap, const void *p)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_lookup_type (struct soap *soap, const char *id)
 
SOAP_FMAC1 void *SOAP_FMAC2 soap_id_lookup (struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k)
 
SOAP_FMAC1 void *SOAP_FMAC2 soap_id_forward (struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
 
SOAP_FMAC1 void *SOAP_FMAC2 soap_id_enter (struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
 
SOAP_FMAC1 void SOAP_FMAC2 soap_fcopy (struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_end_send (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_end_send_flush (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_end_recv (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_open_logfile (struct soap *soap, int i)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_recv_logfile (struct soap *soap, const char *logfile)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_sent_logfile (struct soap *soap, const char *logfile)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_test_logfile (struct soap *soap, const char *logfile)
 
SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy (const struct soap *soap)
 
SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy_context (struct soap *copy, const struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_copy_stream (struct soap *copy, struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_free_stream (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_initialize (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2
soap_versioning() 
soap_init (struct soap *soap, soap_mode imode, soap_mode omode)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_begin (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_end (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_version (struct soap *soap, short version)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_set_namespaces (struct soap *soap, const struct Namespace *p)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces (struct soap *soap)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_tagsearch (const char *big, const char *little)
 
SOAP_FMAC1 struct soap_nlist
*SOAP_FMAC2 
soap_lookup_ns (struct soap *soap, const char *tag, size_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element (struct soap *soap, const char *tag, int id, const char *type)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_out (struct soap *soap, const char *tag, int id, const char *type)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_array_begin_out (struct soap *soap, const char *tag, int id, const char *type, const char *offset)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_start_end_out (struct soap *soap, const char *tag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_out (struct soap *soap, const char *tag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_ref (struct soap *soap, const char *tag, int id, int href)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_href (struct soap *soap, const char *tag, int id, const char *ref, const char *val)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_null (struct soap *soap, const char *tag, int id, const char *type)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_nil (struct soap *soap, const char *tag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_id (struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, int n, const char *type, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_result (struct soap *soap, const char *tag)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_check_result (struct soap *soap, const char *tag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_attribute (struct soap *soap, const char *name, const char *value)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_in (struct soap *soap, const char *tag, int nillable, const char *type)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_in (struct soap *soap, const char *tag)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_attr_value (struct soap *soap, const char *name, int flag)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_set_attr (struct soap *soap, const char *name, const char *value, int flag)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_clr_attr (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_store_lab (struct soap *soap, const char *s, size_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_append_lab (struct soap *soap, const char *s, size_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_peek_element (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_retry (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_revert (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_string_out (struct soap *soap, const char *s, int flag)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_string_in (struct soap *soap, int flag, long minlen, long maxlen)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wstring_out (struct soap *soap, const wchar_t *s, int flag)
 
SOAP_FMAC1 wchar_t *SOAP_FMAC2 soap_wstring_in (struct soap *soap, int flag, long minlen, long maxlen)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_int2s (struct soap *soap, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outint (struct soap *soap, const char *tag, int id, const int *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2int (struct soap *soap, const char *s, int *p)
 
SOAP_FMAC1 int *SOAP_FMAC2 soap_inint (struct soap *soap, const char *tag, int *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_long2s (struct soap *soap, long n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outlong (struct soap *soap, const char *tag, int id, const long *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2long (struct soap *soap, const char *s, long *p)
 
SOAP_FMAC1 long *SOAP_FMAC2 soap_inlong (struct soap *soap, const char *tag, long *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_LONG642s (struct soap *soap, LONG64 n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outLONG64 (struct soap *soap, const char *tag, int id, const LONG64 *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2LONG64 (struct soap *soap, const char *s, LONG64 *p)
 
SOAP_FMAC1 LONG64 *SOAP_FMAC2 soap_inLONG64 (struct soap *soap, const char *tag, LONG64 *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_byte2s (struct soap *soap, char n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outbyte (struct soap *soap, const char *tag, int id, const char *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2byte (struct soap *soap, const char *s, char *p)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_inbyte (struct soap *soap, const char *tag, char *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_short2s (struct soap *soap, short n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outshort (struct soap *soap, const char *tag, int id, const short *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2short (struct soap *soap, const char *s, short *p)
 
SOAP_FMAC1 short *SOAP_FMAC2 soap_inshort (struct soap *soap, const char *tag, short *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_float2s (struct soap *soap, float n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outfloat (struct soap *soap, const char *tag, int id, const float *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2float (struct soap *soap, const char *s, float *p)
 
SOAP_FMAC1 float *SOAP_FMAC2 soap_infloat (struct soap *soap, const char *tag, float *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_double2s (struct soap *soap, double n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outdouble (struct soap *soap, const char *tag, int id, const double *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2double (struct soap *soap, const char *s, double *p)
 
SOAP_FMAC1 double *SOAP_FMAC2 soap_indouble (struct soap *soap, const char *tag, double *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_unsignedByte2s (struct soap *soap, unsigned char n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedByte (struct soap *soap, const char *tag, int id, const unsigned char *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedByte (struct soap *soap, const char *s, unsigned char *p)
 
SOAP_FMAC1 unsigned char
*SOAP_FMAC2 
soap_inunsignedByte (struct soap *soap, const char *tag, unsigned char *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_unsignedShort2s (struct soap *soap, unsigned short n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedShort (struct soap *soap, const char *tag, int id, const unsigned short *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedShort (struct soap *soap, const char *s, unsigned short *p)
 
SOAP_FMAC1 unsigned short
*SOAP_FMAC2 
soap_inunsignedShort (struct soap *soap, const char *tag, unsigned short *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_unsignedInt2s (struct soap *soap, unsigned int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedInt (struct soap *soap, const char *tag, int id, const unsigned int *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedInt (struct soap *soap, const char *s, unsigned int *p)
 
SOAP_FMAC1 unsigned int *SOAP_FMAC2 soap_inunsignedInt (struct soap *soap, const char *tag, unsigned int *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_unsignedLong2s (struct soap *soap, unsigned long n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedLong (struct soap *soap, const char *tag, int id, const unsigned long *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedLong (struct soap *soap, const char *s, unsigned long *p)
 
SOAP_FMAC1 unsigned long
*SOAP_FMAC2 
soap_inunsignedLong (struct soap *soap, const char *tag, unsigned long *p, const char *type, int t)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_ULONG642s (struct soap *soap, ULONG64 n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outULONG64 (struct soap *soap, const char *tag, int id, const ULONG64 *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2ULONG64 (struct soap *soap, const char *s, ULONG64 *p)
 
SOAP_FMAC1 ULONG64 *SOAP_FMAC2 soap_inULONG64 (struct soap *soap, const char *tag, ULONG64 *p, const char *type, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2string (struct soap *soap, const char *s, char **t, long minlen, long maxlen)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2QName (struct soap *soap, const char *s, char **t, long minlen, long maxlen)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_QName2s (struct soap *soap, const char *s)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2wchar (struct soap *soap, const char *s, wchar_t **t, long minlen, long maxlen)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_wchar2s (struct soap *soap, const wchar_t *s)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outstring (struct soap *soap, const char *tag, int id, char *const *p, const char *type, int n)
 
SOAP_FMAC1 char **SOAP_FMAC2 soap_instring (struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outwstring (struct soap *soap, const char *tag, int id, wchar_t *const *p, const char *type, int n)
 
SOAP_FMAC1 wchar_t **SOAP_FMAC2 soap_inwstring (struct soap *soap, const char *tag, wchar_t **p, const char *type, int t, long minlen, long maxlen)
 
SOAP_FMAC1 time_t SOAP_FMAC2 soap_timegm (struct tm *T)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_dateTime2s (struct soap *soap, time_t n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outdateTime (struct soap *soap, const char *tag, int id, const time_t *p, const char *type, int n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_s2dateTime (struct soap *soap, const char *s, time_t *p)
 
SOAP_FMAC1 time_t *SOAP_FMAC2 soap_indateTime (struct soap *soap, const char *tag, time_t *p, const char *type, int t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outliteral (struct soap *soap, const char *tag, char *const *p, const char *type)
 
SOAP_FMAC1 char **SOAP_FMAC2 soap_inliteral (struct soap *soap, const char *tag, char **p)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_outwliteral (struct soap *soap, const char *tag, wchar_t *const *p, const char *type)
 
SOAP_FMAC1 wchar_t **SOAP_FMAC2 soap_inwliteral (struct soap *soap, const char *tag, wchar_t **p)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_value (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getline (struct soap *soap, char *s, int len)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_dime_option (struct soap *soap, unsigned short optype, const char *option)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_putdimehdr (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_putdime (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getdimehdr (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getdime (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getmimehdr (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_getmime (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_post_check_mime_attachments (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_check_mime_attachments (struct soap *soap)
 
SOAP_FMAC1 struct
soap_multipart *SOAP_FMAC2 
soap_get_mime_attachment (struct soap *soap, void *handle)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_match_cid (struct soap *soap, const char *s, const char *t)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_putmimehdr (struct soap *soap, struct soap_multipart *content)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_putmime (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_dime (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_mime (struct soap *soap, const char *boundary, const char *start)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_clr_dime (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_clr_mime (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_set_dime_attachment (struct soap *soap, char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_set_mime_attachment (struct soap *soap, char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description)
 
SOAP_FMAC1 struct
soap_multipart *SOAP_FMAC2 
soap_next_multipart (struct soap_multipart *content)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_begin_serve (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_begin_recv (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_out (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_out (struct soap *soap)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_get_http_body (struct soap *soap, size_t *len)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_in (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_in (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_out (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_out (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_in (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_in (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_recv_header (struct soap *soap)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_endpoint (struct soap *soap, const char *endpoint)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_connect (struct soap *soap, const char *endpoint, const char *action)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_connect_command (struct soap *soap, int http_command, const char *endpoints, const char *action)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_s2base64 (struct soap *soap, const unsigned char *s, char *t, int n)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_base642s (struct soap *soap, const char *s, char *t, size_t l, int *n)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_s2hex (struct soap *soap, const unsigned char *s, char *t, int n)
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_hex2s (struct soap *soap, const char *s, char *t, size_t l, int *n)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_puthttphdr (struct soap *soap, int status, size_t count)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_set_fault (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_send_fault (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_recv_fault (struct soap *soap, int check)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_send_empty_response (struct soap *soap, int httpstatuscode)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_recv_empty_response (struct soap *soap)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_set_sender_error (struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_set_receiver_error (struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault (struct soap *soap, const char *faultstring, const char *faultdetailXML)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault_subcode (struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault (struct soap *soap, const char *faultstring, const char *faultdetailXML)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault_subcode (struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault (struct soap *soap, FILE *fd)
 
SOAP_FMAC1 char *SOAP_FMAC2 soap_sprint_fault (struct soap *soap, char *buf, size_t len)
 
SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault_location (struct soap *soap, FILE *fd)
 
SOAP_FMAC1 int SOAP_FMAC2 soap_register_plugin_arg (struct soap *soap, int(*fcreate)(struct soap *, struct soap_plugin *, void *), void *arg)
 
SOAP_FMAC1 void *SOAP_FMAC2 soap_lookup_plugin (struct soap *soap, const char *id)
 

Variables

static const char soap_env1 [42] = "http://schemas.xmlsoap.org/soap/envelope/"
 
static const char soap_enc1 [42] = "http://schemas.xmlsoap.org/soap/encoding/"
 
static const char soap_env2 [40] = "http://www.w3.org/2003/05/soap-envelope"
 
static const char soap_enc2 [40] = "http://www.w3.org/2003/05/soap-encoding"
 
static const char soap_rpc [35] = "http://www.w3.org/2003/05/soap-rpc"
 
const union soap_double_nan soap_double_nan = {{0xFFFFFFFF, 0xFFFFFFFF}}
 
const char soap_base64o [65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 
const char soap_base64i [81] = "\76XXX\77\64\65\66\67\70\71\72\73\74\75XXXXXXX\00\01\02\03\04\05\06\07\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31XXXXXX\32\33\34\35\36\37\40\41\42\43\44\45\46\47\50\51\52\53\54\55\56\57\60\61\62\63"
 
static const char soap_indent [11] = "\n\t\t\t\t\t\t\t\t\t"
 
static const char soap_padding [4] = "\0\0\0"
 
static const struct soap_code_map html_entity_codes []
 
static const struct soap_code_map h_error_codes []
 
static const struct soap_code_map h_http_error_codes []
 
static const struct soap_code_map mime_codes []
 

Macro Definition Documentation

#define GSOAP_LIB_VERSION   20817
#define SOAP_AP   (soap_wchar)(-6) /* XML-specific ''' */
#define soap_blank (   c)    ((c)+1 > 0 && (c) <= 32)
#define SOAP_CANARY   (0xC0DE)
#define SOAP_GT   (soap_wchar)(-4) /* XML-specific '>' */
#define soap_hash_ptr (   p)    ((size_t)(((unsigned long)(p) >> 3) & (SOAP_PTRHASH-1)))
#define SOAP_LT   (soap_wchar)(-2) /* XML-specific '<' */
#define SOAP_NON_NULL   (soap_padding)
#define soap_notblank (   c)    ((c) > 32)
#define SOAP_QT   (soap_wchar)(-5) /* XML-specific '"' */
#define SOAP_SOCKBLOCK (   fd)    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)&~O_NONBLOCK);
#define SOAP_SOCKNONBLOCK (   fd)    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)|O_NONBLOCK);
#define SOAP_STR_EOS   (soap_padding)
#define SOAP_STR_PADDING   (soap_padding)
#define SOAP_TCP_SELECT_ALL   0x7
#define SOAP_TCP_SELECT_ERR   0x4
#define SOAP_TCP_SELECT_RCV   0x1
#define SOAP_TCP_SELECT_SND   0x2
#define SOAP_TT   (soap_wchar)(-3) /* XML-specific '</' */
#define SOAP_UNKNOWN_CHAR   (127)

Function Documentation

static void * fplugin ( struct soap soap,
const char *  id 
)
static
16934 { register struct soap_plugin *p;
16935  for (p = soap->plugins; p; p = p->next)
16936  if (p->id == id || !strcmp(p->id, id))
16937  return p->data;
16938  return NULL;
16939 }
struct soap_plugin * plugins
Definition: stdsoap2.h:1973
struct soap_plugin * next
Definition: stdsoap2.h:2251
arena_t NULL
Definition: jemalloc_internal.h:624
const char * id
Definition: stdsoap2.h:2252
Definition: stdsoap2.h:2250
void * data
Definition: stdsoap2.h:2253

+ Here is the caller graph for this function:

static size_t frecv ( struct soap soap,
char *  s,
size_t  n 
)
static
886 { register int r;
887  register int retries = 100; /* max 100 retries with non-blocking sockets */
888  SOAP_SOCKET sk;
889  soap->errnum = 0;
890 #if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
891  if (soap->is)
892  { if (soap->is->good())
893  return soap->is->read(s, (std::streamsize)n).gcount();
894  return 0;
895  }
896 #endif
897  sk = soap->recvsk;
898  if (!soap_valid_socket(sk))
899  sk = soap->socket;
900  if (soap_valid_socket(sk))
901  { for (;;)
902  {
903 #ifdef WITH_OPENSSL
904  register int err = 0;
905 #endif
906 #ifdef WITH_OPENSSL
907  if (soap->recv_timeout && !soap->ssl) /* SSL: sockets are nonblocking */
908 #else
909  if (soap->recv_timeout)
910 #endif
911  { for (;;)
913  if (r > 0)
914  break;
915  if (!r)
916  return 0;
917  r = soap->errnum;
918  if (r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK)
919  return 0;
920  }
921  }
922 #ifdef WITH_OPENSSL
923  if (soap->ssl)
924  { r = SSL_read(soap->ssl, s, (int)n);
925  if (r > 0)
926  return (size_t)r;
927  err = SSL_get_error(soap->ssl, r);
928  if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
929  return 0;
930  }
931  else if (soap->bio)
932  { r = BIO_read(soap->bio, s, (int)n);
933  if (r > 0)
934  return (size_t)r;
935  return 0;
936  }
937  else
938 #endif
939 #ifdef WITH_GNUTLS
940  if (soap->session)
941  { r = (int)gnutls_record_recv(soap->session, s, n);
942  if (r >= 0)
943  return (size_t)r;
944  }
945  else
946 #endif
947  {
948 #ifndef WITH_LEAN
949  if ((soap->omode & SOAP_IO_UDP))
950  { SOAP_SOCKLEN_T k = (SOAP_SOCKLEN_T)sizeof(soap->peer);
951  memset((void*)&soap->peer, 0, sizeof(soap->peer));
952  r = recvfrom(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
953  soap->peerlen = (size_t)k;
954 #ifndef WITH_IPV6
955  soap->ip = ntohl(soap->peer.sin_addr.s_addr);
956 #endif
957  }
958  else
959 #endif
960  r = recv(sk, s, (int)n, soap->socket_flags);
961 #ifdef PALM
962  /* CycleSyncDisplay(curStatusMsg); */
963 #endif
964  if (r >= 0)
965  return (size_t)r;
966  r = soap_socket_errno(sk);
967  if (r != SOAP_EINTR && r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK)
968  { soap->errnum = r;
969  return 0;
970  }
971  }
972 #if defined(WITH_OPENSSL)
973  if (soap->ssl && err == SSL_ERROR_WANT_WRITE)
974  r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
975  else
976 #elif defined(WITH_GNUTLS)
977  if (soap->session && gnutls_record_get_direction(soap->session))
978  r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
979  else
980 #endif
981  r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
982  if (!r && soap->recv_timeout)
983  return 0;
984  if (r < 0)
985  { r = soap->errnum;
986  if (r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK)
987  return 0;
988  }
989  if (retries-- <= 0)
990  return 0;
991 #ifdef PALM
992  r = soap_socket_errno(sk);
993  if (r != SOAP_EINTR && retries-- <= 0)
994  { soap->errnum = r;
995  return 0;
996  }
997 #endif
998  }
999  }
1000 #ifdef WITH_FASTCGI
1001  return fread(s, 1, n, stdin);
1002 #else
1003 #ifdef UNDER_CE
1004  return fread(s, 1, n, soap->recvfd);
1005 #else
1006 #ifdef WMW_RPM_IO
1007  if (soap->rpmreqid)
1008  r = httpBlockRead(soap->rpmreqid, s, n);
1009  else
1010 #endif
1011 #ifdef WIN32
1012  r = _read(soap->recvfd, s, (unsigned int)n);
1013 #else
1014  r = read(soap->recvfd, s, (unsigned int)n);
1015 #endif
1016  if (r >= 0)
1017  return (size_t)r;
1018  soap->errnum = soap_errno;
1019  return 0;
1020 #endif
1021 #endif
1022 }
#define soap_socket_errno(s)
Definition: stdsoap2.h:1002
#define soap_errno
Definition: stdsoap2.h:1001
#define SOAP_TCP_SELECT_SND
Definition: stdsoap2.cpp:241
void * is
Definition: stdsoap2.h:2046
int socket_flags
Definition: stdsoap2.h:1951
int recvfd
Definition: stdsoap2.h:2050
unsigned long ip
Definition: stdsoap2.h:2097
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
#define SOAP_EWOULDBLOCK
Definition: stdsoap2.h:984
#define SOAP_IO_UDP
Definition: stdsoap2.h:1348
#define SOAP_EAGAIN
Definition: stdsoap2.h:978
#define SOAP_TCP_SELECT_RCV
Definition: stdsoap2.cpp:240
void * bio
Definition: stdsoap2.h:2166
#define SOAP_SOCKET
Definition: stdsoap2.h:853
soap_mode omode
Definition: stdsoap2.h:1938
void * ssl
Definition: stdsoap2.h:2167
size_t peerlen
Definition: stdsoap2.h:2144
static int tcp_select(struct soap *, SOAP_SOCKET, int, int)
Definition: stdsoap2.cpp:4501
#define SOAP_WINSOCKINT
Definition: stdsoap2.h:716
struct sockaddr_in peer
Definition: stdsoap2.h:2141
int errnum
Definition: stdsoap2.h:2114
int recv_timeout
Definition: stdsoap2.h:1947
#define SOAP_SOCKLEN_T
Definition: stdsoap2.h:845
SOAP_SOCKET recvsk
Definition: stdsoap2.h:2040
SOAP_SOCKET socket
Definition: stdsoap2.h:2038
#define SOAP_TCP_SELECT_ERR
Definition: stdsoap2.cpp:242
void * session
Definition: stdsoap2.h:2169
#define SOAP_EINTR
Definition: stdsoap2.h:977

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int fsend ( struct soap soap,
const char *  s,
size_t  n 
)
static
538 { register int nwritten, err;
539  SOAP_SOCKET sk;
540 #if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
541  if (soap->os)
542  { soap->os->write(s, (std::streamsize)n);
543  if (soap->os->good())
544  return SOAP_OK;
545  soap->errnum = 0;
546  return SOAP_EOF;
547  }
548 #endif
549  sk = soap->sendsk;
550  if (!soap_valid_socket(sk))
551  sk = soap->socket;
552  while (n)
553  { if (soap_valid_socket(sk))
554  {
555  if (soap->send_timeout)
556  { for (;;)
557  { register int r;
558 #ifdef WITH_OPENSSL
559  if (soap->ssl)
560  r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
561  else
562 #endif
563 #ifdef WITH_GNUTLS
564  if (soap->session)
565  r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
566  else
567 #endif
569  if (r > 0)
570  break;
571  if (!r)
572  return SOAP_EOF;
573  err = soap->errnum;
574  if (!err)
575  return soap->error;
576  if (err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK)
577  return SOAP_EOF;
578  }
579  }
580 #ifdef WITH_OPENSSL
581  if (soap->ssl)
582  nwritten = SSL_write(soap->ssl, s, (int)n);
583  else if (soap->bio)
584  nwritten = BIO_write(soap->bio, s, (int)n);
585  else
586 #endif
587 #ifdef WITH_GNUTLS
588  if (soap->session)
589  nwritten = gnutls_record_send(soap->session, s, n);
590  else
591 #endif
592 #ifndef WITH_LEAN
593  if ((soap->omode & SOAP_IO_UDP))
594  { if (soap->peerlen)
595  nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
596  else
597  nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
598  /* retry and back-off algorithm */
599  /* TODO: this is not very clear from specs so verify and limit conditions under which we should loop (e.g. ENOBUFS) */
600  if (nwritten < 0)
601  { int udp_repeat;
602  int udp_delay;
603  if ((soap->connect_flags & SO_BROADCAST))
604  udp_repeat = 2; /* SOAP-over-UDP MULTICAST_UDP_REPEAT - 1 */
605  else
606  udp_repeat = 1; /* SOAP-over-UDP UNICAST_UDP_REPEAT - 1 */
607  udp_delay = ((unsigned int)soap_random % 201) + 50; /* UDP_MIN_DELAY .. UDP_MAX_DELAY */
608  do
609  { tcp_select(soap, sk, SOAP_TCP_SELECT_ERR, -1000 * udp_delay);
610  if (soap->peerlen)
611  nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
612  else
613  nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
614  udp_delay <<= 1;
615  if (udp_delay > 500) /* UDP_UPPER_DELAY */
616  udp_delay = 500;
617  }
618  while (nwritten < 0 && --udp_repeat > 0);
619  }
620  if (nwritten < 0)
621  { err = soap_socket_errno(sk);
622  if (err && err != SOAP_EINTR)
623  { soap->errnum = err;
624  return SOAP_EOF;
625  }
626  nwritten = 0; /* and call write() again */
627  }
628  }
629  else
630 #endif
631 #if !defined(PALM) && !defined(AS400)
632  nwritten = send(sk, s, (int)n, soap->socket_flags);
633 #else
634  nwritten = send(sk, (void*)s, n, soap->socket_flags);
635 #endif
636  if (nwritten <= 0)
637  {
638  register int r = 0;
639  err = soap_socket_errno(sk);
640 #ifdef WITH_OPENSSL
641  if (soap->ssl && (r = SSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE)
642  { soap->errnum = err;
643  return SOAP_EOF;
644  }
645 #endif
646 #ifdef WITH_GNUTLS
647  if (soap->session)
648  { if (nwritten == GNUTLS_E_INTERRUPTED)
649  err = SOAP_EINTR;
650  else if (nwritten == GNUTLS_E_AGAIN)
651  err = SOAP_EAGAIN;
652  }
653 #endif
654  if (err == SOAP_EWOULDBLOCK || err == SOAP_EAGAIN)
655  {
656 #if defined(WITH_OPENSSL)
657  if (soap->ssl && r == SSL_ERROR_WANT_READ)
658  r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
659  else
660 #elif defined(WITH_GNUTLS)
661  if (soap->session && !gnutls_record_get_direction(soap->session))
662  r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
663  else
664 #endif
665  r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000);
666  if (!r && soap->send_timeout)
667  return SOAP_EOF;
668  if (r < 0)
669  return SOAP_EOF;
670  }
671  else if (err && err != SOAP_EINTR)
672  { soap->errnum = err;
673  return SOAP_EOF;
674  }
675  nwritten = 0; /* and call write() again */
676  }
677  }
678  else
679  {
680 #ifdef WITH_FASTCGI
681  nwritten = fwrite((void*)s, 1, n, stdout);
682  fflush(stdout);
683 #else
684 #ifdef UNDER_CE
685  nwritten = fwrite(s, 1, n, soap->sendfd);
686 #else
687 #ifdef VXWORKS
688 #ifdef WMW_RPM_IO
689  if (soap->rpmreqid)
690  nwritten = (httpBlockPut(soap->rpmreqid, (char*)s, n) == 0) ? n : -1;
691  else
692 #endif
693  nwritten = fwrite(s, sizeof(char), n, fdopen(soap->sendfd, "w"));
694 #else
695 #ifdef WIN32
696  nwritten = _write(soap->sendfd, s, (unsigned int)n);
697 #else
698  nwritten = write(soap->sendfd, s, (unsigned int)n);
699 #endif
700 #endif
701 #endif
702 #endif
703  if (nwritten <= 0)
704  {
705 #ifndef WITH_FASTCGI
706  err = soap_errno;
707 #else
708  err = EOF;
709 #endif
710  if (err && err != SOAP_EINTR && err != SOAP_EWOULDBLOCK && err != SOAP_EAGAIN)
711  { soap->errnum = err;
712  return SOAP_EOF;
713  }
714  nwritten = 0; /* and call write() again */
715  }
716  }
717  n -= nwritten;
718  s += nwritten;
719  }
720  return SOAP_OK;
721 }
#define soap_socket_errno(s)
Definition: stdsoap2.h:1002
#define soap_errno
Definition: stdsoap2.h:1001
#define SOAP_TCP_SELECT_SND
Definition: stdsoap2.cpp:241
int socket_flags
Definition: stdsoap2.h:1951
int error
Definition: stdsoap2.h:2112
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
int sendfd
Definition: stdsoap2.h:2049
#define SOAP_EWOULDBLOCK
Definition: stdsoap2.h:984
#define SOAP_IO_UDP
Definition: stdsoap2.h:1348
#define SOAP_EAGAIN
Definition: stdsoap2.h:978
#define SOAP_TCP_SELECT_RCV
Definition: stdsoap2.cpp:240
void * bio
Definition: stdsoap2.h:2166
#define SOAP_SOCKET
Definition: stdsoap2.h:853
soap_mode omode
Definition: stdsoap2.h:1938
void * ssl
Definition: stdsoap2.h:2167
int send_timeout
Definition: stdsoap2.h:1948
size_t peerlen
Definition: stdsoap2.h:2144
static int tcp_select(struct soap *, SOAP_SOCKET, int, int)
Definition: stdsoap2.cpp:4501
#define SOAP_WINSOCKINT
Definition: stdsoap2.h:716
struct sockaddr_in peer
Definition: stdsoap2.h:2141
int errnum
Definition: stdsoap2.h:2114
#define SOAP_TCP_SELECT_ALL
Definition: stdsoap2.cpp:243
int connect_flags
Definition: stdsoap2.h:1952
#define soap_random
Definition: stdsoap2.h:2333
#define SOAP_OK
Definition: stdsoap2.h:1245
void * os
Definition: stdsoap2.h:2045
SOAP_SOCKET sendsk
Definition: stdsoap2.h:2039
#define SOAP_EOF
Definition: stdsoap2.h:1243
SOAP_SOCKET socket
Definition: stdsoap2.h:2038
#define SOAP_TCP_SELECT_ERR
Definition: stdsoap2.cpp:242
void * session
Definition: stdsoap2.h:2169
#define SOAP_EINTR
Definition: stdsoap2.h:977

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_200 ( struct soap soap)
static
5809 { return soap_send_empty_response(soap, 200);
5810 }
SOAP_FMAC1 int SOAP_FMAC2 soap_send_empty_response(struct soap *soap, int httpstatuscode)
Definition: stdsoap2.cpp:16564

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_405 ( struct soap soap)
static
5798 { (void)soap;
5799  return 405;
5800 }

+ Here is the caller graph for this function:

static const char * http_error ( struct soap soap,
int  status 
)
static
5768 { register const char *msg = SOAP_STR_EOS;
5769  (void)soap;
5770 #ifndef WITH_LEAN
5771  msg = soap_code_str(h_http_error_codes, status);
5772  if (!msg)
5773  msg = SOAP_STR_EOS;
5774 #endif
5775  return msg;
5776 }
static const struct soap_code_map h_http_error_codes[]
Definition: stdsoap2.cpp:453
SOAP_FMAC1 const char *SOAP_FMAC2 soap_code_str(const struct soap_code_map *code_map, long code)
Definition: stdsoap2.cpp:1388
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:322

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_get ( struct soap soap)
static
5786 { (void)soap;
5787  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP GET request\n"));
5788  return SOAP_GET_METHOD;
5789 }
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
#define SOAP_GET_METHOD
Definition: stdsoap2.h:1260

+ Here is the caller graph for this function:

static int http_parse ( struct soap soap)
static
5362 { char header[SOAP_HDRLEN], *s;
5363  unsigned short httpcmd = 0;
5364  int status = 0;
5365  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Waiting for HTTP request/response...\n"));
5366  *soap->endpoint = '\0';
5367 #ifdef WITH_NTLM
5368  if (!soap->ntlm_challenge)
5369 #endif
5370  { soap->userid = NULL;
5371  soap->passwd = NULL;
5372  soap->authrealm = NULL;
5373  }
5374 #ifdef WITH_NTLM
5375  soap->ntlm_challenge = NULL;
5376 #endif
5377  soap->proxy_from = NULL;
5378  do
5379  { soap->length = 0;
5380  soap->http_content = NULL;
5381  soap->action = NULL;
5382  soap->status = 0;
5383  soap->body = 1;
5384  if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
5385  { if (soap->error == SOAP_EOF)
5386  return SOAP_EOF;
5387  return soap->error = 414;
5388  }
5389  if ((s = strchr(soap->msgbuf, ' ')))
5390  { soap->status = (unsigned short)soap_strtoul(s, &s, 10);
5391  if (!soap_blank((soap_wchar)*s))
5392  soap->status = 0;
5393  }
5394  else
5395  soap->status = 0;
5396  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP status: %s\n", soap->msgbuf));
5397  for (;;)
5398  { if (soap_getline(soap, header, SOAP_HDRLEN))
5399  { if (soap->error == SOAP_EOF)
5400  { soap->error = SOAP_OK;
5401  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "EOF in HTTP header, continue anyway\n"));
5402  break;
5403  }
5404  return soap->error;
5405  }
5406  if (!*header)
5407  break;
5408  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP header: %s\n", header));
5409  s = strchr(header, ':');
5410  if (s)
5411  { char *t;
5412  *s = '\0';
5413  do s++;
5414  while (*s && *s <= 32);
5415  if (*s == '"')
5416  s++;
5417  t = s + strlen(s) - 1;
5418  while (t > s && *t <= 32)
5419  t--;
5420  if (t >= s && *t == '"')
5421  t--;
5422  t[1] = '\0';
5423  if ((soap->error = soap->fparsehdr(soap, header, s)))
5424  { if (soap->error < SOAP_STOP)
5425  return soap->error;
5426  status = soap->error;
5427  soap->error = SOAP_OK;
5428  }
5429  }
5430  }
5431  } while (soap->status == 100);
5432  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Finished HTTP header parsing, status = %d\n", soap->status));
5433  s = strstr(soap->msgbuf, "HTTP/");
5434  if (s && s[7] != '1')
5435  { if (soap->keep_alive == 1)
5436  soap->keep_alive = 0;
5437  if (soap->status == 0 && (soap->omode & SOAP_IO) == SOAP_IO_CHUNK) /* soap->status == 0 for HTTP request */
5438  soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE; /* HTTP 1.0 does not support chunked transfers */
5439  }
5440  if (soap->keep_alive < 0)
5441  soap->keep_alive = 1;
5442  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Keep alive connection = %d\n", soap->keep_alive));
5443  if (soap->status == 0)
5444  { size_t l = 0;
5445  if (s)
5446  { if (!strncmp(soap->msgbuf, "POST ", l = 5))
5447  httpcmd = 1;
5448  else if (!strncmp(soap->msgbuf, "PUT ", l = 4))
5449  httpcmd = 2;
5450  else if (!strncmp(soap->msgbuf, "GET ", l = 4))
5451  httpcmd = 3;
5452  else if (!strncmp(soap->msgbuf, "DELETE ", l = 7))
5453  httpcmd = 4;
5454  else if (!strncmp(soap->msgbuf, "OPTIONS ", l = 8))
5455  httpcmd = 5;
5456  else if (!strncmp(soap->msgbuf, "HEAD ", l = 5))
5457  httpcmd = 6;
5458  }
5459  if (s && httpcmd)
5460  { size_t m = strlen(soap->endpoint);
5461  size_t n = m + (s - soap->msgbuf) - l - 1;
5462  size_t k;
5463  if (n >= sizeof(soap->endpoint))
5464  n = sizeof(soap->endpoint) - 1;
5465  if (m > n)
5466  m = n;
5467  k = n - m + 1;
5468  if (k > sizeof(soap->path))
5469  k = sizeof(soap->path);
5470  strncpy(soap->path, soap->msgbuf + l, k);
5471  soap->path[k - 1] = '\0';
5472  if (*soap->path && *soap->path != '/')
5473  *soap->endpoint = '\0';
5474  strcat(soap->endpoint, soap->path);
5475  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Target endpoint='%s'\n", soap->endpoint));
5476  if (httpcmd > 1)
5477  { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP %s handler\n", soap->msgbuf));
5478  switch (httpcmd)
5479  { case 2: soap->error = soap->fput(soap); break;
5480  case 3: soap->error = soap->fget(soap); break;
5481  case 4: soap->error = soap->fdel(soap); break;
5482  case 5: soap->error = soap->fopt(soap); break;
5483  case 6: soap->error = soap->fhead(soap); break;
5484  default: soap->error = 405; break;
5485  }
5486  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP handler return = %d\n", soap->error));
5487  if (soap->error == SOAP_OK)
5488  soap->error = SOAP_STOP; /* prevents further processing */
5489  return soap->error;
5490  }
5491  if (status)
5492  return soap->error = status;
5493  }
5494  else if (status)
5495  return soap->error = status;
5496  else if (s)
5497  return soap->error = 405;
5498  return SOAP_OK;
5499  }
5500 #if 0
5501  if (soap->length > 0 || (soap->http_content && (!soap->keep_alive || soap->recv_timeout)) || (soap->imode & SOAP_IO) == SOAP_IO_CHUNK)
5502 #endif
5503  if (soap->body)
5504  { if ((soap->status >= 200 && soap->status <= 299) /* OK, Accepted, etc */
5505  || soap->status == 400 /* Bad Request */
5506  || soap->status == 500) /* Internal Server Error */
5507  return SOAP_OK;
5508  /* force close afterwards in soap_closesock() */
5509  soap->keep_alive = 0;
5510 #ifndef WITH_LEAN
5511  /* read HTTP body for error details */
5512  s = soap_get_http_body(soap, NULL);
5513  if (s)
5514  return soap_set_receiver_error(soap, soap->msgbuf, s, soap->status);
5515 #endif
5516  }
5517  else if (soap->status >= 200 && soap->status <= 299)
5518  return soap->error = soap->status;
5519  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP error %d\n", soap->status));
5520  return soap_set_receiver_error(soap, "HTTP Error", soap->msgbuf, soap->status);
5521 }
char msgbuf[1024]
Definition: stdsoap2.h:2067
short keep_alive
Definition: stdsoap2.h:2099
int error
Definition: stdsoap2.h:2112
const char * userid
Definition: stdsoap2.h:1974
char * action
Definition: stdsoap2.h:2095
soap_mode imode
Definition: stdsoap2.h:1937
soap_int32 soap_wchar
Definition: stdsoap2.h:1610
int(* fhead)(struct soap *)
Definition: stdsoap2.h:1987
SOAP_FMAC1 char *SOAP_FMAC2 soap_get_http_body(struct soap *soap, size_t *len)
Definition: stdsoap2.cpp:15414
#define SOAP_IO
Definition: stdsoap2.h:1342
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
arena_t NULL
Definition: jemalloc_internal.h:624
char path[SOAP_TAGLEN]
Definition: stdsoap2.h:2093
const char * authrealm
Definition: stdsoap2.h:1976
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1346
const char * passwd
Definition: stdsoap2.h:1975
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:2310
#define soap_blank(c)
Definition: stdsoap2.cpp:100
int(* fdel)(struct soap *)
Definition: stdsoap2.h:1985
const char * http_content
Definition: stdsoap2.h:1943
#define SOAP_HDRLEN
Definition: stdsoap2.h:1054
#define SOAP_STOP
Definition: stdsoap2.h:1308
soap_mode omode
Definition: stdsoap2.h:1938
char endpoint[SOAP_TAGLEN]
Definition: stdsoap2.h:2092
SOAP_FMAC1 int SOAP_FMAC2 soap_getline(struct soap *soap, char *s, int len)
Definition: stdsoap2.cpp:13929
int(* fput)(struct soap *)
Definition: stdsoap2.h:1984
const char * proxy_from
Definition: stdsoap2.h:2110
int recv_timeout
Definition: stdsoap2.h:1947
int(* fparsehdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1992
#define SOAP_OK
Definition: stdsoap2.h:1245
const char * ntlm_challenge
Definition: stdsoap2.h:1978
int status
Definition: stdsoap2.h:2111
size_t length
Definition: stdsoap2.h:2062
#define SOAP_IO_STORE
Definition: stdsoap2.h:1345
#define SOAP_EOF
Definition: stdsoap2.h:1243
short body
Definition: stdsoap2.h:2059
int(* fget)(struct soap *)
Definition: stdsoap2.h:1983
SOAP_FMAC1 int SOAP_FMAC2 soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:16714
int(* fopt)(struct soap *)
Definition: stdsoap2.h:1986

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_parse_header ( struct soap soap,
const char *  key,
const char *  val 
)
static
5530 { if (!soap_tag_cmp(key, "Host"))
5531  {
5532 #if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
5533  if (soap->imode & SOAP_ENC_SSL)
5534  strcpy(soap->endpoint, "https://");
5535  else
5536 #endif
5537  strcpy(soap->endpoint, "http://");
5538  strncat(soap->endpoint, val, sizeof(soap->endpoint) - 8);
5539  }
5540 #ifndef WITH_LEANER
5541  else if (!soap_tag_cmp(key, "Content-Type"))
5542  { const char *action;
5543  soap->http_content = soap_strdup(soap, val);
5544  if (soap_get_header_attribute(soap, val, "application/dime"))
5545  soap->imode |= SOAP_ENC_DIME;
5546  else if (soap_get_header_attribute(soap, val, "multipart/related")
5547  || soap_get_header_attribute(soap, val, "multipart/form-data"))
5548  { soap->mime.boundary = soap_strdup(soap, soap_get_header_attribute(soap, val, "boundary"));
5549  soap->mime.start = soap_strdup(soap, soap_get_header_attribute(soap, val, "start"));
5550  soap->imode |= SOAP_ENC_MIME;
5551  }
5552  action = soap_get_header_attribute(soap, val, "action");
5553  if (action)
5554  { if (*action == '"')
5555  { soap->action = soap_strdup(soap, action + 1);
5556  if (*soap->action)
5557  soap->action[strlen(soap->action) - 1] = '\0';
5558  }
5559  else
5560  soap->action = soap_strdup(soap, action);
5561  }
5562  }
5563 #endif
5564  else if (!soap_tag_cmp(key, "Content-Length"))
5565  { soap->length = soap_strtoul(val, NULL, 10);
5566  if (!soap->length)
5567  soap->body = 0;
5568  }
5569  else if (!soap_tag_cmp(key, "Content-Encoding"))
5570  { if (!soap_tag_cmp(val, "deflate"))
5571 #ifdef WITH_ZLIB
5572  soap->zlib_in = SOAP_ZLIB_DEFLATE;
5573 #else
5574  return SOAP_ZLIB_ERROR;
5575 #endif
5576  else if (!soap_tag_cmp(val, "gzip"))
5577 #ifdef WITH_GZIP
5578  soap->zlib_in = SOAP_ZLIB_GZIP;
5579 #else
5580  return SOAP_ZLIB_ERROR;
5581 #endif
5582  }
5583 #ifdef WITH_ZLIB
5584  else if (!soap_tag_cmp(key, "Accept-Encoding"))
5585  {
5586 #ifdef WITH_GZIP
5587  if (strchr(val, '*') || soap_get_header_attribute(soap, val, "gzip"))
5588  soap->zlib_out = SOAP_ZLIB_GZIP;
5589  else
5590 #endif
5591  if (strchr(val, '*') || soap_get_header_attribute(soap, val, "deflate"))
5592  soap->zlib_out = SOAP_ZLIB_DEFLATE;
5593  else
5594  soap->zlib_out = SOAP_ZLIB_NONE;
5595  }
5596 #endif
5597  else if (!soap_tag_cmp(key, "Transfer-Encoding"))
5598  { soap->imode &= ~SOAP_IO;
5599  if (!soap_tag_cmp(val, "chunked"))
5600  soap->imode |= SOAP_IO_CHUNK;
5601  }
5602  else if (!soap_tag_cmp(key, "Connection"))
5603  { if (!soap_tag_cmp(val, "keep-alive"))
5604  soap->keep_alive = -soap->keep_alive;
5605  else if (!soap_tag_cmp(val, "close"))
5606  soap->keep_alive = 0;
5607  }
5608 #ifndef WITH_LEAN
5609  else if (!soap_tag_cmp(key, "Authorization") || !soap_tag_cmp(key, "Proxy-Authorization"))
5610  {
5611 #ifdef WITH_NTLM
5612  if (!soap_tag_cmp(val, "NTLM*"))
5613  soap->ntlm_challenge = soap_strdup(soap, val + 4);
5614  else
5615 #endif
5616  if (!soap_tag_cmp(val, "Basic *"))
5617  { int n;
5618  char *s;
5619  soap_base642s(soap, val + 6, soap->tmpbuf, sizeof(soap->tmpbuf) - 1, &n);
5620  soap->tmpbuf[n] = '\0';
5621  if ((s = strchr(soap->tmpbuf, ':')))
5622  { *s = '\0';
5623  soap->userid = soap_strdup(soap, soap->tmpbuf);
5624  soap->passwd = soap_strdup(soap, s + 1);
5625  }
5626  }
5627  }
5628  else if (!soap_tag_cmp(key, "WWW-Authenticate") || !soap_tag_cmp(key, "Proxy-Authenticate"))
5629  {
5630 #ifdef WITH_NTLM
5631  if (!soap_tag_cmp(val, "NTLM*"))
5632  soap->ntlm_challenge = soap_strdup(soap, val + 4);
5633  else
5634 #endif
5635  soap->authrealm = soap_strdup(soap, soap_get_header_attribute(soap, val + 6, "realm"));
5636  }
5637  else if (!soap_tag_cmp(key, "Expect"))
5638  { if (!soap_tag_cmp(val, "100-continue"))
5639  { if ((soap->error = soap->fposthdr(soap, "HTTP/1.1 100 Continue", NULL))
5640  || (soap->error = soap->fposthdr(soap, NULL, NULL)))
5641  return soap->error;
5642  }
5643  }
5644 #endif
5645  else if (!soap_tag_cmp(key, "SOAPAction"))
5646  { if (*val == '"')
5647  { soap->action = soap_strdup(soap, val + 1);
5648  if (*soap->action)
5649  soap->action[strlen(soap->action) - 1] = '\0';
5650  }
5651  else
5652  soap->action = soap_strdup(soap, val);
5653  }
5654  else if (!soap_tag_cmp(key, "Location"))
5655  { strncpy(soap->endpoint, val, sizeof(soap->endpoint));
5656  soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
5657  }
5658  else if (!soap_tag_cmp(key, "X-Forwarded-For"))
5659  { soap->proxy_from = soap_strdup(soap, val);
5660  }
5661 #ifdef WITH_COOKIES
5662  else if (!soap_tag_cmp(key, "Cookie")
5663  || !soap_tag_cmp(key, "Cookie2")
5664  || !soap_tag_cmp(key, "Set-Cookie")
5665  || !soap_tag_cmp(key, "Set-Cookie2"))
5666  { soap_getcookies(soap, val);
5667  }
5668 #endif
5669  return SOAP_OK;
5670 }
SOAP_FMAC1 char *SOAP_FMAC2 soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2122
char tmpbuf[1024]
Definition: stdsoap2.h:2068
short keep_alive
Definition: stdsoap2.h:2099
int error
Definition: stdsoap2.h:2112
const char * userid
Definition: stdsoap2.h:1974
char * action
Definition: stdsoap2.h:2095
soap_mode imode
Definition: stdsoap2.h:1937
#define SOAP_IO
Definition: stdsoap2.h:1342
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1333
arena_t NULL
Definition: jemalloc_internal.h:624
SOAP_FMAC1 int SOAP_FMAC2 soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:2918
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1334
#define SOAP_ZLIB_GZIP
Definition: stdsoap2.h:1336
SOAP_FMAC1 const char *SOAP_FMAC2 soap_get_header_attribute(struct soap *soap, const char *line, const char *key)
Definition: stdsoap2.cpp:5680
const char * authrealm
Definition: stdsoap2.h:1976
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1346
const char * passwd
Definition: stdsoap2.h:1975
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:2310
const char * http_content
Definition: stdsoap2.h:1943
char endpoint[SOAP_TAGLEN]
Definition: stdsoap2.h:2092
int(* fposthdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1989
const char * start
Definition: stdsoap2.h:1754
const char * proxy_from
Definition: stdsoap2.h:2110
char * boundary
Definition: stdsoap2.h:1753
#define SOAP_OK
Definition: stdsoap2.h:1245
SOAP_FMAC1 const char *SOAP_FMAC2 soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
Definition: stdsoap2.cpp:15930
short zlib_in
Definition: stdsoap2.h:2201
const char * ntlm_challenge
Definition: stdsoap2.h:1978
size_t length
Definition: stdsoap2.h:2062
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1276
struct soap_mime mime
Definition: stdsoap2.h:2118
short body
Definition: stdsoap2.h:2059
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1355
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1356
short zlib_out
Definition: stdsoap2.h:2202
#define SOAP_ENC_SSL
Definition: stdsoap2.h:1359

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_post ( struct soap soap,
const char *  endpoint,
const char *  host,
int  port,
const char *  path,
const char *  action,
size_t  count 
)
static
5819 { register const char *s;
5820  register int err;
5821  switch (soap->status)
5822  { case SOAP_GET:
5823  s = "GET";
5824  break;
5825  case SOAP_PUT:
5826  s = "PUT";
5827  break;
5828  case SOAP_DEL:
5829  s = "DELETE";
5830  break;
5831  case SOAP_CONNECT:
5832  s = "CONNECT";
5833  break;
5834  default:
5835  s = "POST";
5836  }
5837  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP %s to %s\n", s, endpoint ? endpoint : "(null)"));
5838 #ifdef PALM
5839  if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && strncmp(endpoint, "httpg:", 6)) && strncmp(endpoint, "_beam:", 6) && strncmp(endpoint, "_local:", 7) && strncmp(endpoint, "_btobex:", 8))
5840 #else
5841  if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && strncmp(endpoint, "httpg:", 6)))
5842 #endif
5843  return SOAP_OK;
5844  if (strlen(endpoint) + strlen(soap->http_version) > sizeof(soap->tmpbuf) - 80
5845  || strlen(host) + strlen(soap->http_version) > sizeof(soap->tmpbuf) - 80)
5846  return soap->error = SOAP_EOM; /* prevent overrun (note that 'host' and 'soap->host' are substrings of 'endpoint') */
5847  if (soap->status == SOAP_CONNECT)
5848  {
5849 #ifdef HAVE_SNPRINTF
5850  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version);
5851 #else
5852  sprintf(soap->tmpbuf, "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version);
5853 #endif
5854  }
5855  else if (soap->proxy_host && endpoint)
5856  {
5857 #ifdef HAVE_SNPRINTF
5858  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s %s HTTP/%s", s, endpoint, soap->http_version);
5859 #else
5860  sprintf(soap->tmpbuf, "%s %s HTTP/%s", s, endpoint, soap->http_version);
5861 #endif
5862  }
5863  else
5864  {
5865 #ifdef HAVE_SNPRINTF
5866  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version);
5867 #else
5868  sprintf(soap->tmpbuf, "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version);
5869 #endif
5870  }
5871  if ((err = soap->fposthdr(soap, soap->tmpbuf, NULL)))
5872  return err;
5873 #ifdef WITH_OPENSSL
5874  if ((soap->ssl && port != 443) || (!soap->ssl && port != 80))
5875 #else
5876  if (port != 80)
5877 #endif
5878  {
5879 #ifdef WITH_IPV6
5880  if (*host != '[' && strchr(host, ':'))
5881  {
5882 #ifdef HAVE_SNPRINTF
5883  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "[%s]:%d", host, port); /* RFC 2732 */
5884 #else
5885  sprintf(soap->tmpbuf, "[%s]:%d", host, port); /* RFC 2732 */
5886 #endif
5887  }
5888  else
5889 #endif
5890  {
5891 #ifdef HAVE_SNPRINTF
5892  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s:%d", host, port);
5893 #else
5894  sprintf(soap->tmpbuf, "%s:%d", host, port);
5895 #endif
5896  }
5897  }
5898  else
5899  {
5900 #ifdef WITH_IPV6
5901  if (*host != '[' && strchr(host, ':'))
5902  {
5903 #ifdef HAVE_SNPRINTF
5904  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "[%s]", host); /* RFC 2732 */
5905 #else
5906  sprintf(soap->tmpbuf, "[%s]", host); /* RFC 2732 */
5907 #endif
5908  }
5909  else
5910 #endif
5911  strcpy(soap->tmpbuf, host);
5912  }
5913  if ((err = soap->fposthdr(soap, "Host", soap->tmpbuf)))
5914  return err;
5915  if ((err = soap->fposthdr(soap, "User-Agent", "gSOAP/2.8")))
5916  return err;
5917  if ((err = soap_puthttphdr(soap, SOAP_OK, count)))
5918  return err;
5919 #ifdef WITH_ZLIB
5920 #ifdef WITH_GZIP
5921  if ((err = soap->fposthdr(soap, "Accept-Encoding", "gzip, deflate")))
5922 #else
5923  if ((err = soap->fposthdr(soap, "Accept-Encoding", "deflate")))
5924 #endif
5925  return err;
5926 #endif
5927 #ifndef WITH_LEAN
5928 #ifdef WITH_NTLM
5929  if (soap->ntlm_challenge && strlen(soap->ntlm_challenge) + 6 < sizeof(soap->tmpbuf))
5930  { if (*soap->ntlm_challenge)
5931  {
5932 #ifdef HAVE_SNPRINTF
5933  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "NTLM %s", soap->ntlm_challenge);
5934 #else
5935  sprintf(soap->tmpbuf, "NTLM %s", soap->ntlm_challenge);
5936 #endif
5937  if (soap->proxy_host)
5938  { if ((err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
5939  return err;
5940  }
5941  else if ((err = soap->fposthdr(soap, "Authorization", soap->tmpbuf)))
5942  return err;
5943  }
5944  }
5945  else
5946  {
5947 #endif
5948  if (soap->userid && soap->passwd && strlen(soap->userid) + strlen(soap->passwd) < 761)
5949  { strcpy(soap->tmpbuf, "Basic ");
5950 #ifdef HAVE_SNPRINTF
5951  soap_snprintf(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, "%s:%s", soap->userid, soap->passwd);
5952 #else
5953  sprintf(soap->tmpbuf + 262, "%s:%s", soap->userid, soap->passwd);
5954 #endif
5955  soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
5956  if ((err = soap->fposthdr(soap, "Authorization", soap->tmpbuf)))
5957  return err;
5958  }
5959  if (soap->proxy_userid && soap->proxy_passwd && strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) < 761)
5960  { strcpy(soap->tmpbuf, "Basic ");
5961 #ifdef HAVE_SNPRINTF
5962  soap_snprintf(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
5963 #else
5964  sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
5965 #endif
5966  soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
5967  if ((err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
5968  return err;
5969  }
5970 #ifdef WITH_NTLM
5971  }
5972 #endif
5973 #endif
5974 #ifdef WITH_COOKIES
5975 #ifdef WITH_OPENSSL
5976  if (soap_putcookies(soap, host, path, soap->ssl != NULL))
5977  return soap->error;
5978 #else
5979  if (soap_putcookies(soap, host, path, 0))
5980  return soap->error;
5981 #endif
5982 #endif
5983  if (action && soap->status != SOAP_GET && soap->status != SOAP_DEL)
5984  {
5985 #ifdef HAVE_SNPRINTF
5986  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "\"%s\"", action);
5987 #else
5988  sprintf(soap->tmpbuf, "\"%s\"", strlen(action) < sizeof(soap->tmpbuf) - 3 ? action : SOAP_STR_EOS);
5989 #endif
5990  if ((err = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf)))
5991  return err;
5992  }
5993  return soap->fposthdr(soap, NULL, NULL);
5994 }
char tmpbuf[1024]
Definition: stdsoap2.h:2068
int error
Definition: stdsoap2.h:2112
const char * userid
Definition: stdsoap2.h:1974
const char * http_version
Definition: stdsoap2.h:1942
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
const char * proxy_host
Definition: stdsoap2.h:2106
arena_t NULL
Definition: jemalloc_internal.h:624
SOAP_FMAC1 int SOAP_FMAC2 soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:2918
#define SOAP_GET
Definition: stdsoap2.h:1317
const char * passwd
Definition: stdsoap2.h:1975
SOAP_FMAC1 int SOAP_FMAC2 soap_puthttphdr(struct soap *soap, int status, size_t count)
Definition: stdsoap2.cpp:16078
char host[SOAP_TAGLEN]
Definition: stdsoap2.h:2094
int(* fposthdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1989
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096
void * ssl
Definition: stdsoap2.h:2167
#define SOAP_CONNECT
Definition: stdsoap2.h:1320
const char * proxy_userid
Definition: stdsoap2.h:2108
#define SOAP_DEL
Definition: stdsoap2.h:1319
const char * proxy_passwd
Definition: stdsoap2.h:2109
#define SOAP_PUT
Definition: stdsoap2.h:1318
int port
Definition: stdsoap2.h:2098
SOAP_FMAC1 char *SOAP_FMAC2 soap_s2base64(struct soap *soap, const unsigned char *s, char *t, int n)
Definition: stdsoap2.cpp:15888
#define SOAP_OK
Definition: stdsoap2.h:1245
const char * ntlm_challenge
Definition: stdsoap2.h:1978
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:322
int status
Definition: stdsoap2.h:2111
#define soap_snprintf
Definition: stdsoap2.h:1235
#define SOAP_EOM
Definition: stdsoap2.h:1265

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_post_header ( struct soap soap,
const char *  key,
const char *  val 
)
static
6022 { if (key)
6023  { if (http_send_header(soap, key))
6024  return soap->error;
6025  if (val && (soap_send_raw(soap, ": ", 2) || http_send_header(soap, val)))
6026  return soap->error;
6027  }
6028  return soap_send_raw(soap, "\r\n", 2);
6029 }
static int http_send_header(struct soap *, const char *)
Definition: stdsoap2.cpp:6002
int error
Definition: stdsoap2.h:2112
SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:730

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_response ( struct soap soap,
int  status,
size_t  count 
)
static
6038 { register int err;
6039  char http[10];
6040  int code = status;
6041  const char *line;
6042 #ifdef WMW_RPM_IO
6043  if (soap->rpmreqid)
6044  httpOutputEnable(soap->rpmreqid);
6045 #endif
6046  if (!soap->http_version || strlen(soap->http_version) > 4)
6047  return soap->error = SOAP_EOM;
6048 #ifdef WMW_RPM_IO
6049  if (soap->rpmreqid || soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* RPM behaves as if standalone */
6050 #else
6051  if (soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* standalone application (socket) or CGI (stdin/out)? */
6052 #endif
6053  {
6054 #ifdef HAVE_SNPRINTF
6055  soap_snprintf(http, sizeof(http), "HTTP/%s", soap->http_version);
6056 #else
6057  sprintf(http, "HTTP/%s", soap->http_version);
6058 #endif
6059  }
6060  else
6061  strcpy(http, "Status:");
6062  if (!status || status == SOAP_HTML || status == SOAP_FILE)
6063  { if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK))
6064  code = 200;
6065  else
6066  code = 202;
6067  }
6068  else if (status < 200 || status >= 600)
6069  { const char *s = *soap_faultcode(soap);
6070  if (status >= SOAP_GET_METHOD && status <= SOAP_HTTP_METHOD)
6071  code = 405;
6072  else if (soap->version == 2 && (!s || !strcmp(s, "SOAP-ENV:Sender")))
6073  code = 400;
6074  else
6075  code = 500;
6076  }
6077  line = http_error(soap, code);
6078  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP Status = %d %s\n", code, line));
6079 #ifdef HAVE_SNPRINTF
6080  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s %d %s", http, code, line);
6081 #else
6082  sprintf(soap->tmpbuf, "%s %d %s", http, code, line);
6083 #endif
6084  if ((err = soap->fposthdr(soap, soap->tmpbuf, NULL)))
6085  return err;
6086 #ifndef WITH_LEAN
6087  if (status == 401)
6088  {
6089 #ifdef HAVE_SNPRINTF
6090  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) < sizeof(soap->tmpbuf) - 14) ? soap->authrealm : "gSOAP Web Service");
6091 #else
6092  sprintf(soap->tmpbuf, "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) < sizeof(soap->tmpbuf) - 14) ? soap->authrealm : "gSOAP Web Service");
6093 #endif
6094  if ((err = soap->fposthdr(soap, "WWW-Authenticate", soap->tmpbuf)))
6095  return err;
6096  }
6097  else if ((status >= 301 && status <= 303) || status == 307)
6098  { if ((err = soap->fposthdr(soap, "Location", soap->endpoint)))
6099  return err;
6100  }
6101 #endif
6102  if ((err = soap->fposthdr(soap, "Server", "gSOAP/2.8"))
6103  || (err = soap_puthttphdr(soap, status, count)))
6104  return err;
6105 #ifdef WITH_COOKIES
6106  if (soap_putsetcookies(soap))
6107  return soap->error;
6108 #endif
6109  return soap->fposthdr(soap, NULL, NULL);
6110 }
char tmpbuf[1024]
Definition: stdsoap2.h:2068
#define SOAP_FILE
Definition: stdsoap2.h:1311
int error
Definition: stdsoap2.h:2112
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
SOAP_SOCKET master
Definition: stdsoap2.h:2037
const char * http_version
Definition: stdsoap2.h:1942
short version
Definition: stdsoap2.h:1935
#define SOAP_IO
Definition: stdsoap2.h:1342
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
arena_t NULL
Definition: jemalloc_internal.h:624
SOAP_FMAC3 const char **SOAP_FMAC4 soap_faultcode(struct soap *soap)
Definition: soapC.cpp:93
static const char * http_error(struct soap *, int)
Definition: stdsoap2.cpp:5767
const char * authrealm
Definition: stdsoap2.h:1976
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1346
SOAP_FMAC1 int SOAP_FMAC2 soap_puthttphdr(struct soap *soap, int status, size_t count)
Definition: stdsoap2.cpp:16078
soap_mode omode
Definition: stdsoap2.h:1938
char endpoint[SOAP_TAGLEN]
Definition: stdsoap2.h:2092
int(* fposthdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1989
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096
Definition: inftrees.h:24
#define SOAP_HTTP_METHOD
Definition: stdsoap2.h:1264
#define soap_snprintf
Definition: stdsoap2.h:1235
#define SOAP_HTML
Definition: stdsoap2.h:1310
#define SOAP_EOM
Definition: stdsoap2.h:1265
SOAP_SOCKET socket
Definition: stdsoap2.h:2038
#define SOAP_GET_METHOD
Definition: stdsoap2.h:1260

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int http_send_header ( struct soap soap,
const char *  s 
)
static
6003 { register const char *t;
6004  do
6005  { t = strchr(s, '\n'); /* disallow \n in HTTP headers */
6006  if (!t)
6007  t = s + strlen(s);
6008  if (soap_send_raw(soap, s, t - s))
6009  return soap->error;
6010  s = t + 1;
6011  } while (*t);
6012  return SOAP_OK;
6013 }
int error
Definition: stdsoap2.h:2112
SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:730
#define SOAP_OK
Definition: stdsoap2.h:1245

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept ( struct soap soap)
4972 { int n = (int)sizeof(soap->peer);
4973  register int err;
4974 #ifndef WITH_LEAN
4975 #ifndef WIN32
4976  int len = SOAP_BUFLEN;
4977 #else
4978  int len = SOAP_BUFLEN + 1; /* speeds up windows xfer */
4979 #endif
4980  int set = 1;
4981 #endif
4982  soap->error = SOAP_OK;
4983  memset((void*)&soap->peer, 0, sizeof(soap->peer));
4984  soap->socket = SOAP_INVALID_SOCKET;
4985  soap->errmode = 0;
4986  soap->keep_alive = 0;
4987  if (!soap_valid_socket(soap->master))
4988  { soap->errnum = 0;
4989  soap_set_receiver_error(soap, tcp_error(soap), "no master socket in soap_accept()", SOAP_TCP_ERROR);
4990  return SOAP_INVALID_SOCKET;
4991  }
4992 #ifndef WITH_LEAN
4993  if ((soap->omode & SOAP_IO_UDP))
4994  return soap->socket = soap->master;
4995 #endif
4996  for (;;)
4997  { if (soap->accept_timeout || soap->send_timeout || soap->recv_timeout)
4998  { for (;;)
4999  { register int r;
5000  r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_ALL, soap->accept_timeout ? soap->accept_timeout : 60);
5001  if (r > 0)
5002  break;
5003  if (!r && soap->accept_timeout)
5004  { soap_set_receiver_error(soap, "Timeout", "accept failed in soap_accept()", SOAP_TCP_ERROR);
5005  return SOAP_INVALID_SOCKET;
5006  }
5007  if (r < 0)
5008  { r = soap->errnum;
5009  if (r != SOAP_EINTR)
5010  { soap_closesock(soap);
5011  soap_set_sender_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
5012  return SOAP_INVALID_SOCKET;
5013  }
5014  }
5015  }
5016  }
5017  if (soap->accept_timeout)
5018  SOAP_SOCKNONBLOCK(soap->master)
5019  else
5020  SOAP_SOCKBLOCK(soap->master)
5021  soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*)&soap->peer, &n);
5022  soap->peerlen = (size_t)n;
5023  if (soap_valid_socket(soap->socket))
5024  {
5025 #ifdef WITH_IPV6
5026  unsigned int ip1, ip2, ip3, ip4;
5027  char port[16];
5028  getnameinfo((struct sockaddr*)&soap->peer, n, soap->host, sizeof(soap->host), port, 16, NI_NUMERICHOST | NI_NUMERICSERV);
5029  sscanf(soap->host, "%u.%u.%u.%u", &ip1, &ip2, &ip3, &ip4);
5030  soap->ip = (unsigned long)ip1 << 24 | (unsigned long)ip2 << 16 | (unsigned long)ip3 << 8 | (unsigned long)ip4;
5031  soap->port = soap_strtol(port, NULL, 10);
5032 #else
5033  soap->ip = ntohl(soap->peer.sin_addr.s_addr);
5034 #ifdef HAVE_SNPRINTF
5035  soap_snprintf(soap->host, sizeof(soap->host), "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
5036 #else
5037  sprintf(soap->host, "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
5038 #endif
5039  soap->port = (int)ntohs(soap->peer.sin_port); /* does not return port number on some systems */
5040 #endif
5041  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket=%d at port=%d from IP='%s'\n", soap->socket, soap->port, soap->host));
5042 #ifndef WITH_LEAN
5043  if (soap->accept_flags == SO_LINGER)
5044  { struct linger linger;
5045  memset((void*)&linger, 0, sizeof(linger));
5046  linger.l_onoff = 1;
5047  linger.l_linger = soap->linger_time;
5048  if (setsockopt(soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
5049  { soap->errnum = soap_socket_errno(soap->socket);
5050  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR);
5051  soap_closesock(soap);
5052  return SOAP_INVALID_SOCKET;
5053  }
5054  }
5055  else if (soap->accept_flags && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags, (char*)&set, sizeof(int)))
5056  { soap->errnum = soap_socket_errno(soap->socket);
5057  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR);
5058  soap_closesock(soap);
5059  return SOAP_INVALID_SOCKET;
5060  }
5061  if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
5062  { soap->errnum = soap_socket_errno(soap->socket);
5063  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
5064  soap_closesock(soap);
5065  return SOAP_INVALID_SOCKET;
5066  }
5067  if (setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
5068  { soap->errnum = soap_socket_errno(soap->socket);
5069  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);
5070  soap_closesock(soap);
5071  return SOAP_INVALID_SOCKET;
5072  }
5073  if (setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
5074  { soap->errnum = soap_socket_errno(soap->socket);
5075  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);
5076  soap_closesock(soap);
5077  return SOAP_INVALID_SOCKET;
5078  }
5079 #ifdef TCP_NODELAY
5080  if (setsockopt(soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
5081  { soap->errnum = soap_socket_errno(soap->socket);
5082  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR);
5083  soap_closesock(soap);
5084  return SOAP_INVALID_SOCKET;
5085  }
5086 #endif
5087 #endif
5088  soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
5089  if (soap->send_timeout || soap->recv_timeout)
5090  SOAP_SOCKNONBLOCK(soap->socket)
5091  else
5092  SOAP_SOCKBLOCK(soap->socket)
5093  return soap->socket;
5094  }
5095  err = soap_socket_errno(soap->socket);
5096  if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK)
5097  { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));
5098  soap->errnum = err;
5099  soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
5100  soap_closesock(soap);
5101  return SOAP_INVALID_SOCKET;
5102  }
5103  }
5104 }
#define soap_socket_errno(s)
Definition: stdsoap2.h:1002
short keep_alive
Definition: stdsoap2.h:2099
int error
Definition: stdsoap2.h:2112
#define SOAP_SOCKNONBLOCK(fd)
Definition: stdsoap2.cpp:286
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
SOAP_SOCKET master
Definition: stdsoap2.h:2037
#define soap_strtol(s, t, b)
Definition: stdsoap2.h:2304
#define SOAP_EWOULDBLOCK
Definition: stdsoap2.h:984
#define SOAP_BUFLEN
Definition: stdsoap2.h:1013
#define SOAP_IO_UDP
Definition: stdsoap2.h:1348
int accept_timeout
Definition: stdsoap2.h:1950
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
arena_t NULL
Definition: jemalloc_internal.h:624
#define SOAP_EAGAIN
Definition: stdsoap2.h:978
int errmode
Definition: stdsoap2.h:2113
soap_mode omode
Definition: stdsoap2.h:1938
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096
int send_timeout
Definition: stdsoap2.h:1948
static int tcp_select(struct soap *, SOAP_SOCKET, int, int)
Definition: stdsoap2.cpp:4501
static const char * tcp_error(struct soap *)
Definition: stdsoap2.cpp:3718
#define SOAP_SOCKBLOCK(fd)
Definition: stdsoap2.cpp:285
struct sockaddr_in peer
Definition: stdsoap2.h:2141
SOAP_FMAC1 int SOAP_FMAC2 soap_set_sender_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:16704
int errnum
Definition: stdsoap2.h:2114
#define SOAP_TCP_SELECT_ALL
Definition: stdsoap2.cpp:243
int recv_timeout
Definition: stdsoap2.h:1947
#define SOAP_INVALID_SOCKET
Definition: stdsoap2.h:858
#define SOAP_OK
Definition: stdsoap2.h:1245
SOAP_FMAC1 int SOAP_FMAC2 soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:5113
#define soap_snprintf
Definition: stdsoap2.h:1235
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1273
SOAP_SOCKET socket
Definition: stdsoap2.h:2038
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1350
SOAP_FMAC1 int SOAP_FMAC2 soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:16714
#define SOAP_EINTR
Definition: stdsoap2.h:977

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_append_lab ( struct soap soap,
const char *  s,
size_t  n 
)
10593 { if (soap->labidx + n >= soap->lablen)
10594  { register char *t = soap->labbuf;
10595  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enlarging look-aside buffer to append data, size=%lu\n", (unsigned long)soap->lablen));
10596  if (soap->lablen == 0)
10597  soap->lablen = SOAP_LABLEN;
10598  while (soap->labidx + n >= soap->lablen)
10599  soap->lablen <<= 1;
10600  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New look-aside buffer size=%lu\n", (unsigned long)soap->lablen));
10601  soap->labbuf = (char*)SOAP_MALLOC(soap, soap->lablen);
10602  if (!soap->labbuf)
10603  { if (t)
10604  SOAP_FREE(soap, t);
10605  return soap->error = SOAP_EOM;
10606  }
10607  if (t)
10608  { memcpy(soap->labbuf, t, soap->labidx);
10609  SOAP_FREE(soap, t);
10610  }
10611  }
10612  if (s)
10613  { memcpy(soap->labbuf + soap->labidx, s, n);
10614  soap->labidx += n;
10615  }
10616  return SOAP_OK;
10617 }
size_t lablen
Definition: stdsoap2.h:2064
#define SOAP_LABLEN
Definition: stdsoap2.h:1019
int error
Definition: stdsoap2.h:2112
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1463
size_t labidx
Definition: stdsoap2.h:2065
char * labbuf
Definition: stdsoap2.h:2063
#define SOAP_OK
Definition: stdsoap2.h:1245
#define SOAP_EOM
Definition: stdsoap2.h:1265
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1467

+ Here is the caller graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_array_begin_out ( struct soap soap,
const char *  tag,
int  id,
const char *  type,
const char *  offset 
)
9891 { if (!type || !*type)
9892  return soap_element_begin_out(soap, tag, id, NULL);
9893  if (soap_element(soap, tag, id, "SOAP-ENC:Array"))
9894  return soap->error;
9895  if (soap->version == 2)
9896  { const char *s;
9897  s = soap_strrchr(type, '[');
9898  if (s && (size_t)(s - type) < sizeof(soap->tmpbuf))
9899  { strncpy(soap->tmpbuf, type, s - type);
9900  soap->tmpbuf[s - type] = '\0';
9901  if (soap_attribute(soap, "SOAP-ENC:itemType", soap->tmpbuf))
9902  return soap->error;
9903  s++;
9904  if (*s)
9905  { strncpy(soap->tmpbuf, s, sizeof(soap->tmpbuf));
9906  soap->tmpbuf[sizeof(soap->tmpbuf) - 1] = '\0';
9907  soap->tmpbuf[strlen(soap->tmpbuf) - 1] = '\0';
9908  if (soap_attribute(soap, "SOAP-ENC:arraySize", soap->tmpbuf))
9909  return soap->error;
9910  }
9911  }
9912  }
9913  else
9914  { if (offset && soap_attribute(soap, "SOAP-ENC:offset", offset))
9915  return soap->error;
9916  if (soap_attribute(soap, "SOAP-ENC:arrayType", type))
9917  return soap->error;
9918  }
9919 #ifndef WITH_LEAN
9920  if ((soap->mode & SOAP_XML_CANONICAL))
9921  soap_utilize_ns(soap, type);
9922 #endif
9923  return soap_element_start_end_out(soap, NULL);
9924 }
char tmpbuf[1024]
Definition: stdsoap2.h:2068
static void soap_utilize_ns(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9501
SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9757
int error
Definition: stdsoap2.h:2112
soap_mode mode
Definition: stdsoap2.h:1936
short version
Definition: stdsoap2.h:1935
arena_t NULL
Definition: jemalloc_internal.h:624
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1365
SOAP_FMAC1 int SOAP_FMAC2 soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9932
#define soap_strrchr(s, t)
Definition: stdsoap2.h:2298
SOAP_FMAC1 int SOAP_FMAC2 soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:10217
SOAP_FMAC1 int SOAP_FMAC2 soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9529

+ Here is the call graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup ( struct soap soap,
const void *  p,
const struct soap_array a,
int  n,
int  type,
struct soap_plist **  ppp 
)
7089 { register struct soap_plist *pp;
7090  *ppp = NULL;
7091  if (!p || !a->__ptr)
7092  return 0;
7093  for (pp = soap->pht[soap_hash_ptr(a->__ptr)]; pp; pp = pp->next)
7094  { if (pp->type == type && pp->array && pp->array->__ptr == a->__ptr)
7095  { register int i;
7096  for (i = 0; i < n; i++)
7097  if (((const int*)&pp->array->__size)[i] != ((const int*)&a->__size)[i])
7098  break;
7099  if (i == n)
7100  { *ppp = pp;
7101  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a->__ptr, type, pp->id));
7102  return pp->id;
7103  }
7104  }
7105  }
7106  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a->__ptr, type));
7107  return 0;
7108 }
struct soap_plist * next
Definition: stdsoap2.h:1644
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
const struct soap_array * array
Definition: stdsoap2.h:1646
arena_t NULL
Definition: jemalloc_internal.h:624
struct soap_plist * pht[SOAP_PTRHASH]
Definition: stdsoap2.h:1964
Definition: stdsoap2.h:1643
int id
Definition: stdsoap2.h:1648
int __size
Definition: stdsoap2.h:1639
#define soap_hash_ptr(p)
Definition: stdsoap2.cpp:106
void * __ptr
Definition: stdsoap2.h:1638
int type
Definition: stdsoap2.h:1647

+ Here is the caller graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference ( struct soap soap,
const void *  p,
const struct soap_array a,
int  n,
int  t 
)
7362 { struct soap_plist *pp;
7363  if (!p || !a->__ptr || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME|SOAP_ENC_MIME|SOAP_ENC_MTOM|SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE))
7364  return 1;
7365  if (soap_array_pointer_lookup(soap, p, a, n, t, &pp))
7366  { if (pp->mark1 == 0)
7367  { pp->mark1 = 2;
7368  pp->mark2 = 2;
7369  }
7370  }
7371  else if (!soap_pointer_enter(soap, p, a, n, t, &pp))
7372  return 1;
7373  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p dim=%d type=%d (%d %d)\n", p, a->__ptr, n, t, (int)pp->mark1, (int)pp->mark2));
7374  return pp->mark1;
7375 }
#define SOAP_XML_GRAPH
Definition: stdsoap2.h:1380
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1357
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
char mark1
Definition: stdsoap2.h:1649
SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:7088
SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:7049
#define SOAP_XML_TREE
Definition: stdsoap2.h:1366
soap_mode omode
Definition: stdsoap2.h:1938
Definition: stdsoap2.h:1643
void * __ptr
Definition: stdsoap2.h:1638
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1355
char mark2
Definition: stdsoap2.h:1650
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1356
const char * encodingStyle
Definition: stdsoap2.h:1944

+ Here is the call graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_attachment ( struct soap soap,
const char *  tag,
int  id,
const void *  p,
const struct soap_array a,
const char *  aid,
const char *  atype,
const char *  aoptions,
int  n,
const char *  type,
int  t 
)
7484 {
7485 #ifndef WITH_NOIDREF
7486  struct soap_plist *pp;
7487  int i;
7488  if (!p || !a->__ptr || (!aid && !atype))
7489  return soap_element_id(soap, tag, id, p, a, n, type, t);
7490  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid ? aid : SOAP_STR_EOS, id, atype ? atype : SOAP_STR_EOS));
7491  i = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
7492  if (!i)
7493  { i = soap_pointer_enter(soap, p, a, n, t, &pp);
7494  if (!i)
7495  { soap->error = SOAP_EOM;
7496  return -1;
7497  }
7498  }
7499  if (id <= 0)
7500  id = i;
7501  if (!aid)
7502  {
7503 #ifdef HAVE_SNPRINTF
7504  soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), soap->dime_id_format, id);
7505 #else
7506  sprintf(soap->tmpbuf, soap->dime_id_format, id);
7507 #endif
7508  aid = soap_strdup(soap, soap->tmpbuf);
7509  }
7510  /* Add MTOM xop:Include element when necessary */
7511  /* TODO: this code to be obsoleted with new import/xop.h conventions */
7512  if ((soap->mode & SOAP_ENC_MTOM) && strcmp(tag, "xop:Include"))
7513  { if (soap_element_begin_out(soap, tag, 0, type)
7514  || soap_element_href(soap, "xop:Include", 0, "xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href", aid)
7515  || soap_element_end_out(soap, tag))
7516  return soap->error;
7517  }
7518  else if (soap_element_href(soap, tag, 0, "href", aid))
7519  return soap->error;
7520  if (soap->mode & SOAP_IO_LENGTH)
7521  { if (pp->mark1 != 3)
7522  { struct soap_multipart *content;
7523  if (soap->mode & SOAP_ENC_MTOM)
7524  content = soap_new_multipart(soap, &soap->mime.first, &soap->mime.last, (char*)a->__ptr, a->__size);
7525  else
7526  content = soap_new_multipart(soap, &soap->dime.first, &soap->dime.last, (char*)a->__ptr, a->__size);
7527  if (!content)
7528  { soap->error = SOAP_EOM;
7529  return -1;
7530  }
7531  if (!strncmp(aid, "cid:", 4)) /* RFC 2111 */
7532  { if (soap->mode & SOAP_ENC_MTOM)
7533  { char *s = (char*)soap_malloc(soap, strlen(aid) - 1);
7534  if (s)
7535  { *s = '<';
7536  strcpy(s + 1, aid + 4);
7537  strcat(s, ">");
7538  content->id = s;
7539  }
7540  }
7541  else
7542  content->id = aid + 4;
7543  }
7544  else
7545  content->id = aid;
7546  content->type = atype;
7547  content->options = aoptions;
7548  content->encoding = SOAP_MIME_BINARY;
7549  pp->mark1 = 3;
7550  }
7551  }
7552  else
7553  pp->mark2 = 3;
7554 #endif
7555  return -1;
7556 }
SOAP_FMAC1 char *SOAP_FMAC2 soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2122
char tmpbuf[1024]
Definition: stdsoap2.h:2068
const char * id
Definition: stdsoap2.h:1786
Definition: stdsoap2.h:1772
SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9757
const char * dime_id_format
Definition: stdsoap2.h:1941
int error
Definition: stdsoap2.h:2112
struct soap_multipart * first
Definition: stdsoap2.h:1756
soap_mode mode
Definition: stdsoap2.h:1936
struct soap_multipart * first
Definition: stdsoap2.h:1741
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1357
static struct soap_multipart * soap_new_multipart(struct soap *, struct soap_multipart **, struct soap_multipart **, char *, size_t)
Definition: stdsoap2.cpp:14832
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
char mark1
Definition: stdsoap2.h:1649
SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:7088
enum soap_mime_encoding encoding
Definition: stdsoap2.h:1789
SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:7049
struct soap_dime dime
Definition: stdsoap2.h:2117
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1349
Definition: stdsoap2.h:1782
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096
SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:10030
Definition: stdsoap2.h:1643
struct soap_multipart * last
Definition: stdsoap2.h:1741
SOAP_FMAC1 int SOAP_FMAC2 soap_element_href(struct soap *soap, const char *tag, int id, const char *ref, const char *val)
Definition: stdsoap2.cpp:10098
struct soap_multipart * last
Definition: stdsoap2.h:1756
int __size
Definition: stdsoap2.h:1639
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:322
#define soap_snprintf
Definition: stdsoap2.h:1235
SOAP_FMAC1 int SOAP_FMAC2 soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, int n, const char *type, int t)
Definition: stdsoap2.cpp:10149
#define SOAP_EOM
Definition: stdsoap2.h:1265
const char * options
Definition: stdsoap2.h:1788
void * __ptr
Definition: stdsoap2.h:1638
struct soap_mime mime
Definition: stdsoap2.h:2118
char mark2
Definition: stdsoap2.h:1650
const char * type
Definition: stdsoap2.h:1787
int type
Definition: stdsoap2.h:1647
SOAP_FMAC1 void *SOAP_FMAC2 soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7638

+ Here is the call graph for this function:

SOAP_FMAC1 const char* SOAP_FMAC2 soap_attr_value ( struct soap soap,
const char *  name,
int  flag 
)
10368 { register struct soap_attribute *tp;
10369  if (*name == '-')
10370  return SOAP_STR_EOS;
10371  for (tp = soap->attributes; tp; tp = tp->next)
10372  { if (tp->visible && !soap_match_tag(soap, tp->name, name))
10373  break;
10374  }
10375  if (tp)
10376  { if (flag == 2 && (soap->mode & SOAP_XML_STRICT))
10377  soap->error = SOAP_PROHIBITED;
10378  else
10379  return tp->value;
10380  }
10381  else if (flag == 1 && (soap->mode & SOAP_XML_STRICT))
10382  soap->error = SOAP_REQUIRED;
10383  else
10384  soap->error = SOAP_OK;
10385  return NULL;
10386 }
int error
Definition: stdsoap2.h:2112
soap_mode mode
Definition: stdsoap2.h:1936
short visible
Definition: stdsoap2.h:1686
SOAP_FMAC1 int SOAP_FMAC2 soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:2966
arena_t NULL
Definition: jemalloc_internal.h:624
struct soap_attribute * next
Definition: stdsoap2.h:1681
short flag
Definition: stdsoap2.h:1682
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1361
Definition: stdsoap2.h:1680
struct soap_attribute * attributes
Definition: stdsoap2.h:2080
char name[1]
Definition: stdsoap2.h:1687
#define SOAP_PROHIBITED
Definition: stdsoap2.h:1288
#define SOAP_OK
Definition: stdsoap2.h:1245
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:322
#define SOAP_REQUIRED
Definition: stdsoap2.h:1287
char * value
Definition: stdsoap2.h:1683

+ Here is the call graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_attribute ( struct soap soap,
const char *  name,
const char *  value 
)
10218 {
10219  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute '%s'='%s'\n", name, value));
10220 #ifdef WITH_DOM
10221  if ((soap->mode & SOAP_XML_DOM) && !(soap->mode & SOAP_XML_CANONICAL) && soap->dom)
10222  { register struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
10223  if (!a)
10224  return soap->error;
10225  a->next = soap->dom->atts;
10226  a->nstr = NULL;
10227  a->name = soap_strdup(soap, name);
10228  a->data = soap_strdup(soap, value);
10229  a->wide = NULL;
10230  a->soap = soap;
10231  soap->dom->atts = a;
10232  return SOAP_OK;
10233  }
10234 #endif
10235 #ifndef WITH_LEAN
10236  if (soap->mode & SOAP_XML_CANONICAL)
10237  { /* push namespace */
10238  if (!strncmp(name, "xmlns", 5) && (name[5] == ':' || name[5] == '\0'))
10239  soap_push_ns(soap, name + 5 + (name[5] == ':'), value, 0);
10240  else if (soap_set_attr(soap, name, value, 1))
10241  return soap->error;
10242  }
10243  else
10244 #endif
10245  { if (soap_send(soap, " ") || soap_send(soap, name))
10246  return soap->error;
10247  if (value)
10248  if (soap_send_raw(soap, "=\"", 2)
10249  || soap_string_out(soap, value, 1)
10250  || soap_send_raw(soap, "\"", 1))
10251  return soap->error;
10252  }
10253  return SOAP_OK;
10254 }
SOAP_FMAC1 char *SOAP_FMAC2 soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2122
struct soap_dom_element * dom
Definition: stdsoap2.h:2116
int error
Definition: stdsoap2.h:2112
const char * nstr
Definition: stdsoap2.h:1833
soap_mode mode
Definition: stdsoap2.h:1936
SOAP_FMAC1 int SOAP_FMAC2 soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:845
#define SOAP_XML_DOM
Definition: stdsoap2.h:1379
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
arena_t NULL
Definition: jemalloc_internal.h:624
SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:730
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1365
wchar_t * wide
Definition: stdsoap2.h:1836
static struct soap_nlist * soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
Definition: stdsoap2.cpp:9457
struct soap_dom_attribute * next
Definition: stdsoap2.h:1832
char name[1]
Definition: stdsoap2.h:1687
#define SOAP_OK
Definition: stdsoap2.h:1245
SOAP_FMAC1 int SOAP_FMAC2 soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:11066
char * name
Definition: stdsoap2.h:1834
Definition: stdsoap2.h:1831
char * data
Definition: stdsoap2.h:1835
struct soap_dom_attribute * atts
Definition: stdsoap2.h:1878
const FieldDescriptor value
Definition: descriptor.h:1522
SOAP_FMAC1 int SOAP_FMAC2 soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
Definition: stdsoap2.cpp:10394
SOAP_FMAC1 void *SOAP_FMAC2 soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7638
struct soap * soap
Definition: stdsoap2.h:1837

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 const char* SOAP_FMAC2 soap_base642s ( struct soap soap,
const char *  s,
char *  t,
size_t  l,
int *  n 
)
15931 { register size_t i, j;
15932  register soap_wchar c;
15933  register unsigned long m;
15934  register const char *p;
15935  if (!s || !*s)
15936  { if (n)
15937  *n = 0;
15938  if (soap->error)
15939  return NULL;
15940  return SOAP_NON_NULL;
15941  }
15942  if (!t)
15943  { l = (strlen(s) + 3) / 4 * 3 + 1; /* make sure enough space for \0 */
15944  t = (char*)soap_malloc(soap, l);
15945  }
15946  if (!t)
15947  return NULL;
15948  p = t;
15949  if (n)
15950  *n = 0;
15951  for (i = 0; ; i += 3, l -= 3)
15952  { m = 0;
15953  j = 0;
15954  while (j < 4)
15955  { c = *s++;
15956  if (c == '=' || !c)
15957  { if (l >= j - 1)
15958  { switch (j)
15959  { case 2:
15960  *t++ = (char)((m >> 4) & 0xFF);
15961  i++;
15962  l--;
15963  break;
15964  case 3:
15965  *t++ = (char)((m >> 10) & 0xFF);
15966  *t++ = (char)((m >> 2) & 0xFF);
15967  i += 2;
15968  l -= 2;
15969  }
15970  }
15971  if (n)
15972  *n = (int)i;
15973  if (l)
15974  *t = '\0';
15975  return p;
15976  }
15977  c -= '+';
15978  if (c >= 0 && c <= 79)
15979  { int b = soap_base64i[c];
15980  if (b >= 64)
15981  { soap->error = SOAP_TYPE;
15982  return NULL;
15983  }
15984  m = (m << 6) + b;
15985  j++;
15986  }
15987  else if (!soap_blank(c + '+'))
15988  { soap->error = SOAP_TYPE;
15989  return NULL;
15990  }
15991  }
15992  if (l < 3)
15993  { if (n)
15994  *n = (int)i;
15995  if (l)
15996  *t = '\0';
15997  return p;
15998  }
15999  *t++ = (char)((m >> 16) & 0xFF);
16000  *t++ = (char)((m >> 8) & 0xFF);
16001  *t++ = (char)(m & 0xFF);
16002  }
16003 }
int error
Definition: stdsoap2.h:2112
soap_int32 soap_wchar
Definition: stdsoap2.h:1610
arena_t NULL
Definition: jemalloc_internal.h:624
#define SOAP_NON_NULL
Definition: stdsoap2.cpp:323
#define SOAP_TYPE
Definition: stdsoap2.h:1249
#define soap_blank(c)
Definition: stdsoap2.cpp:100
SOAP_FMAC1 void *SOAP_FMAC2 soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7638
const char soap_base64i[81]
Definition: stdsoap2.cpp:306

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 void SOAP_FMAC2 soap_begin ( struct soap soap)
9241 { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reinitializing context\n"));
9242  if (!soap->keep_alive)
9243  { soap->buflen = 0;
9244  soap->bufidx = 0;
9245  }
9246  soap->null = 0;
9247  soap->position = 0;
9248  soap->encoding = 0;
9249  soap->mustUnderstand = 0;
9250  soap->mode = 0;
9251  soap->ns = 0;
9252  soap->part = SOAP_END;
9253  soap->event = 0;
9254  soap->evlev = 0;
9255  soap->alloced = 0;
9256  soap->count = 0;
9257  soap->length = 0;
9258  soap->cdata = 0;
9259  soap->error = SOAP_OK;
9260  soap->peeked = 0;
9261  soap->ahead = 0;
9262  soap->idnum = 0;
9263  soap->level = 0;
9264  soap->endpoint[0] = '\0';
9265  soap->encodingStyle = SOAP_STR_EOS;
9266 #ifndef WITH_LEANER
9267  soap->dime.chunksize = 0;
9268  soap->dime.buflen = 0;
9269 #endif
9270  soap_free_temp(soap);
9271 }
short alloced
Definition: stdsoap2.h:2088
short keep_alive
Definition: stdsoap2.h:2099
size_t chunksize
Definition: stdsoap2.h:1733
int error
Definition: stdsoap2.h:2112
short part
Definition: stdsoap2.h:2085
soap_mode mode
Definition: stdsoap2.h:1936
short ns
Definition: stdsoap2.h:2084
unsigned int level
Definition: stdsoap2.h:2060
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
struct soap_dime dime
Definition: stdsoap2.h:2117
short peeked
Definition: stdsoap2.h:2089
unsigned int evlev
Definition: stdsoap2.h:2087
soap_wchar ahead
Definition: stdsoap2.h:2057
int position
Definition: stdsoap2.h:2078
char endpoint[SOAP_TAGLEN]
Definition: stdsoap2.h:2092
short encoding
Definition: stdsoap2.h:2081
short cdata
Definition: stdsoap2.h:2058
size_t bufidx
Definition: stdsoap2.h:2055
#define SOAP_END
Definition: stdsoap2.h:1427
short mustUnderstand
Definition: stdsoap2.h:2082
#define SOAP_OK
Definition: stdsoap2.h:1245
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:322
int idnum
Definition: stdsoap2.h:1970
size_t length
Definition: stdsoap2.h:2062
SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp(struct soap *soap)
Definition: stdsoap2.cpp:8495
size_t buflen
Definition: stdsoap2.h:1734
short null
Definition: stdsoap2.h:2083
size_t buflen
Definition: stdsoap2.h:2056
const char * encodingStyle
Definition: stdsoap2.h:1944
size_t count
Definition: stdsoap2.h:2061
short event
Definition: stdsoap2.h:2086

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_begin_count ( struct soap soap)
7118 { soap_free_ns(soap);
7119 #ifndef WITH_LEANER
7120  if ((soap->mode & SOAP_ENC_DIME) || (soap->omode & SOAP_ENC_DIME))
7121  soap->mode = soap->omode | SOAP_IO_LENGTH | SOAP_ENC_DIME;
7122  else
7123 #endif
7124  { soap->mode = soap->omode;
7125  if ((soap->mode & SOAP_IO_UDP))
7126  soap->mode |= SOAP_ENC_XML;
7127  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE
7128  || (((soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_ENC_XML))
7129 #ifndef WITH_LEANER
7130  && !soap->fpreparesend
7131 #endif
7132  ))
7133  soap->mode &= ~SOAP_IO_LENGTH;
7134  else
7135  soap->mode |= SOAP_IO_LENGTH;
7136  }
7137 #ifdef WITH_ZLIB
7138  if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
7139  { if (!(soap->mode & SOAP_ENC_DIME))
7140  soap->mode &= ~SOAP_IO_LENGTH;
7141  if (soap->mode & SOAP_ENC_XML)
7142  soap->mode |= SOAP_IO_BUFFER;
7143  else
7144  soap->mode |= SOAP_IO_STORE;
7145  }
7146 #endif
7147 #ifndef WITH_LEANER
7148  if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME))
7149  soap->mode |= SOAP_ENC_MIME;
7150  else if (!(soap->mode & SOAP_ENC_MIME))
7151  soap->mode &= ~SOAP_ENC_MTOM;
7152  if (soap->mode & SOAP_ENC_MIME)
7154  soap->dime.list = soap->dime.last; /* keep track of last DIME attachment */
7155 #endif
7156  soap->count = 0;
7157  soap->ns = 0;
7158  soap->null = 0;
7159  soap->position = 0;
7160  soap->mustUnderstand = 0;
7161  soap->encoding = 0;
7162  soap->part = SOAP_BEGIN;
7163  soap->event = 0;
7164  soap->evlev = 0;
7165  soap->idnum = 0;
7166  soap_clr_attr(soap);
7168 #ifndef WITH_LEANER
7169  soap->dime.count = 0; /* count # of attachments */
7170  soap->dime.size = 0; /* accumulate total size of attachments */
7171  if (soap->fprepareinitsend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)))
7172  return soap->error;
7173 #endif
7174  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, (unsigned int)soap->mode, (unsigned long)soap->count));
7175  return SOAP_OK;
7176 }
int error
Definition: stdsoap2.h:2112
short part
Definition: stdsoap2.h:2085
soap_mode mode
Definition: stdsoap2.h:1936
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1357
size_t size
Definition: stdsoap2.h:1732
#define SOAP_BEGIN
Definition: stdsoap2.h:1419
short ns
Definition: stdsoap2.h:2084
#define SOAP_IO_UDP
Definition: stdsoap2.h:1348
#define SOAP_IO_FLUSH
Definition: stdsoap2.h:1343
#define SOAP_IO
Definition: stdsoap2.h:1342
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
int(* fprepareinitsend)(struct soap *)
Definition: stdsoap2.h:2015
struct soap_multipart * list
Definition: stdsoap2.h:1740
struct soap_dime dime
Definition: stdsoap2.h:2117
SOAP_FMAC1 void SOAP_FMAC2 soap_clr_attr(struct soap *soap)
Definition: stdsoap2.cpp:10493
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1346
unsigned int evlev
Definition: stdsoap2.h:2087
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1349
int position
Definition: stdsoap2.h:2078
int(* fpreparesend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:2017
soap_mode omode
Definition: stdsoap2.h:1938
size_t count
Definition: stdsoap2.h:1731
short encoding
Definition: stdsoap2.h:2081
#define SOAP_IO_BUFFER
Definition: stdsoap2.h:1344
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1358
struct soap_multipart * last
Definition: stdsoap2.h:1741
short mustUnderstand
Definition: stdsoap2.h:2082
#define SOAP_OK
Definition: stdsoap2.h:1245
int idnum
Definition: stdsoap2.h:1970
#define SOAP_IO_STORE
Definition: stdsoap2.h:1345
static void soap_select_mime_boundary(struct soap *)
Definition: stdsoap2.cpp:14912
#define SOAP_ENC_XML
Definition: stdsoap2.h:1354
SOAP_SOCKET socket
Definition: stdsoap2.h:2038
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1355
SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces(struct soap *soap)
Definition: stdsoap2.cpp:9381
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1356
short null
Definition: stdsoap2.h:2083
static void soap_free_ns(struct soap *soap)
Definition: stdsoap2.cpp:8545
size_t count
Definition: stdsoap2.h:2061
short event
Definition: stdsoap2.h:2086

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_begin_recv ( struct soap soap)
15045 { register soap_wchar c;
15046  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for input from socket=%d/fd=%d\n", soap->socket, soap->recvfd));
15047  soap->error = SOAP_OK;
15048  soap->filterstop = SOAP_OK;
15049  soap_free_temp(soap);
15051  soap->version = 0; /* don't assume we're parsing SOAP content by default */
15052 #ifndef WITH_NOIDREF
15053  soap_free_iht(soap);
15054 #endif
15055  if ((soap->imode & SOAP_IO) == SOAP_IO_CHUNK)
15056  soap->omode |= SOAP_IO_CHUNK;
15057  soap->imode &= ~(SOAP_IO | SOAP_ENC_MIME);
15058  soap->mode = soap->imode;
15059  if (!soap->keep_alive)
15060  { soap->buflen = 0;
15061  soap->bufidx = 0;
15062  }
15063  if (!(soap->mode & SOAP_IO_KEEPALIVE))
15064  soap->keep_alive = 0;
15065  soap->ahead = 0;
15066  soap->peeked = 0;
15067  soap->level = 0;
15068  soap->part = SOAP_BEGIN;
15069  soap->alloced = 0;
15070  soap->body = 1;
15071  soap->count = 0;
15072  soap->length = 0;
15073  soap->cdata = 0;
15074  *soap->endpoint = '\0';
15075  soap->action = NULL;
15076  soap->header = NULL;
15077  soap->fault = NULL;
15078  soap->status = 0;
15079  soap->fform = NULL;
15080 #ifndef WITH_LEANER
15081  soap->dom = NULL;
15082  soap->dime.chunksize = 0;
15083  soap->dime.buflen = 0;
15084  soap->dime.list = NULL;
15085  soap->dime.first = NULL;
15086  soap->dime.last = NULL;
15087  soap->mime.list = NULL;
15088  soap->mime.first = NULL;
15089  soap->mime.last = NULL;
15090  soap->mime.boundary = NULL;
15091  soap->mime.start = NULL;
15092 #endif
15093 #ifdef WIN32
15094 #ifndef UNDER_CE
15095 #ifndef WITH_FASTCGI
15096  if (!soap_valid_socket(soap->socket) && !soap->is) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
15097 #ifdef __BORLANDC__
15098  setmode(soap->recvfd, _O_BINARY);
15099 #else
15100  _setmode(soap->recvfd, _O_BINARY);
15101 #endif
15102 #endif
15103 #endif
15104 #endif
15105 #ifdef WITH_ZLIB
15106  soap->mode &= ~SOAP_ENC_ZLIB;
15107  soap->zlib_in = SOAP_ZLIB_NONE;
15108  soap->zlib_out = SOAP_ZLIB_NONE;
15109  soap->d_stream->next_in = Z_NULL;
15110  soap->d_stream->avail_in = 0;
15111  soap->d_stream->next_out = (Byte*)soap->buf;
15112  soap->d_stream->avail_out = SOAP_BUFLEN;
15113  soap->z_ratio_in = 1.0;
15114 #endif
15115 #ifdef WITH_OPENSSL
15116  if (soap->ssl)
15117  ERR_clear_error();
15118 #endif
15119 #ifndef WITH_LEANER
15120  if (soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap)))
15121  return soap->error;
15122 #endif
15123  c = soap_getchar(soap);
15124 #ifdef WITH_GZIP
15125  if (c == 0x1F)
15126  { if (soap_getgziphdr(soap))
15127  return soap->error;
15128  if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK)
15129  return soap->error = SOAP_ZLIB_ERROR;
15130  if (soap->z_dict)
15131  { if (inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK)
15132  return soap->error = SOAP_ZLIB_ERROR;
15133  }
15134  soap->zlib_state = SOAP_ZLIB_INFLATE;
15135  soap->mode |= SOAP_ENC_ZLIB;
15136  soap->zlib_in = SOAP_ZLIB_GZIP;
15137  soap->z_crc = crc32(0L, NULL, 0);
15138  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
15139  if (!soap->z_buf)
15140  soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
15141  memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
15142  /* should not chunk over plain transport, so why bother to check? */
15143  /* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */
15144  /* soap->z_buflen = soap->bufidx; */
15145  /* else */
15146  soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
15147  soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx);
15148  soap->z_buflen = soap->buflen;
15149  soap->buflen = soap->bufidx;
15150  c = ' ';
15151  }
15152 #endif
15153  while (soap_blank(c))
15154  c = soap_getchar(soap);
15155 #ifndef WITH_LEANER
15156  if (c == '-' && soap_get0(soap) == '-')
15157  soap->mode |= SOAP_ENC_MIME;
15158  else if ((c & 0xFFFC) == (SOAP_DIME_VERSION | SOAP_DIME_MB) && (soap_get0(soap) & 0xFFF0) == 0x20)
15159  soap->mode |= SOAP_ENC_DIME;
15160  else
15161 #endif
15162  { /* skip BOM */
15163  if (c == 0xEF && soap_get0(soap) == 0xBB)
15164  { c = soap_get1(soap);
15165  if ((c = soap_get1(soap)) == 0xBF)
15166  { soap->mode &= ~SOAP_ENC_LATIN;
15167  c = soap_getchar(soap);
15168  }
15169  else
15170  c = (0x0F << 12) | (0xBB << 6) | (c & 0x3F); /* UTF-8 */
15171  }
15172  else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */
15173  || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */
15174  return soap->error = SOAP_UTF_ERROR;
15175  /* skip space */
15176  while (soap_blank(c))
15177  c = soap_getchar(soap);
15178  }
15179  if ((int)c == EOF)
15180  return soap->error = SOAP_CHK_EOF;
15181  soap_unget(soap, c);
15182 #ifndef WITH_NOHTTP
15183  /* if not XML/MIME/DIME/ZLIB, assume HTTP method or status line */
15184  if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !(soap->mode & (SOAP_ENC_MIME | SOAP_ENC_DIME | SOAP_ENC_ZLIB | SOAP_ENC_XML)))
15185  { soap_mode m = soap->imode;
15186  soap->mode &= ~SOAP_IO;
15187  soap->error = soap->fparse(soap);
15188  if (soap->error && soap->error < SOAP_STOP)
15189  { soap->keep_alive = 0; /* force close later */
15190  return soap->error;
15191  }
15192  if (soap->error == SOAP_STOP)
15193  { if (soap->fform)
15194  { soap->error = soap->fform(soap);
15195  if (soap->error == SOAP_OK)
15196  soap->error = SOAP_STOP; /* prevents further processing */
15197  }
15198  return soap->error;
15199  }
15200  soap->mode = soap->imode; /* if imode is changed, effectuate */
15201  soap->imode = m; /* restore imode */
15202 #ifdef WITH_ZLIB
15203  soap->mode &= ~SOAP_ENC_ZLIB;
15204 #endif
15205  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
15206  { soap->chunkbuflen = soap->buflen;
15207  soap->buflen = soap->bufidx;
15208  soap->chunksize = 0;
15209  }
15210  /* Note: fparse should not use soap_unget to push back last char */
15211 #if 0
15212  if (soap->status > 200 && soap->length == 0 && !(soap->http_content && (!soap->keep_alive || soap->recv_timeout)) && (soap->imode & SOAP_IO) != SOAP_IO_CHUNK)
15213 #endif
15214  if (soap->status && !soap->body)
15215  return soap->error = soap->status;
15216 #ifdef WITH_ZLIB
15217  if (soap->zlib_in != SOAP_ZLIB_NONE)
15218  {
15219 #ifdef WITH_GZIP
15220  if (soap->zlib_in != SOAP_ZLIB_DEFLATE)
15221  { c = soap_get1(soap);
15222  if (c == (int)EOF)
15223  return soap->error = SOAP_EOF;
15224  if (c == 0x1F)
15225  { if (soap_getgziphdr(soap))
15226  return soap->error;
15227  if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK)
15228  return soap->error = SOAP_ZLIB_ERROR;
15229  soap->z_crc = crc32(0L, NULL, 0);
15230  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
15231  }
15232  else
15233  { soap_revget1(soap);
15234  if (inflateInit(soap->d_stream) != Z_OK)
15235  return soap->error = SOAP_ZLIB_ERROR;
15236  soap->zlib_in = SOAP_ZLIB_DEFLATE;
15237  }
15238  }
15239  else
15240 #endif
15241  if (inflateInit(soap->d_stream) != Z_OK)
15242  return soap->error = SOAP_ZLIB_ERROR;
15243  if (soap->z_dict)
15244  { if (inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK)
15245  return soap->error = SOAP_ZLIB_ERROR;
15246  }
15247  soap->zlib_state = SOAP_ZLIB_INFLATE;
15248  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n"));
15249  soap->mode |= SOAP_ENC_ZLIB;
15250  if (!soap->z_buf)
15251  soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
15252  memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
15253  soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
15254  soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx);
15255  soap->z_buflen = soap->buflen;
15256  soap->buflen = soap->bufidx;
15257  }
15258 #endif
15259 #ifndef WITH_LEANER
15260  if (soap->fpreparerecv && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK && soap->buflen > soap->bufidx)
15261  { int r;
15262  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking fpreparerecv\n"));
15263  if ((r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, soap->buflen - soap->bufidx)))
15264  return soap->error = r;
15265  }
15266 #endif
15267  if (soap_get0(soap) == (int)EOF)
15268  { if (soap->status == 0 || soap->status == 200)
15269  return soap->error = SOAP_NO_DATA; /* HTTP OK: always expect data */
15270  return soap->error = soap->status;
15271  }
15272  if (soap->error)
15273  { if (soap->error == SOAP_FORM && soap->fform)
15274  { soap->error = soap->fform(soap);
15275  if (soap->error == SOAP_OK)
15276  soap->error = SOAP_STOP; /* prevents further processing */
15277  }
15278  return soap->error;
15279  }
15280  }
15281 #endif
15282 #ifndef WITH_LEANER
15283  if (soap->mode & SOAP_ENC_MIME)
15284  { do /* skip preamble */
15285  { if ((int)(c = soap_getchar(soap)) == EOF)
15286  return soap->error = SOAP_CHK_EOF;
15287  } while (c != '-' || soap_get0(soap) != '-');
15288  soap_unget(soap, c);
15289  if (soap_getmimehdr(soap))
15290  return soap->error;
15291  if (soap->mime.start)
15292  { do
15293  { if (!soap->mime.last->id)
15294  break;
15295  if (!soap_match_cid(soap, soap->mime.start, soap->mime.last->id))
15296  break;
15297  } while (soap_get_mime_attachment(soap, NULL));
15298  }
15299  if (soap_get_header_attribute(soap, soap->mime.first->type, "application/dime"))
15300  soap->mode |= SOAP_ENC_DIME;
15301  }
15302  if (soap->mode & SOAP_ENC_DIME)
15303  { if (soap_getdimehdr(soap))
15304  return soap->error;
15305  if (soap->dime.flags & SOAP_DIME_CF)
15306  { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked DIME SOAP message\n"));
15307  soap->dime.chunksize = soap->dime.size;
15308  if (soap->buflen - soap->bufidx >= soap->dime.chunksize)
15309  { soap->dime.buflen = soap->buflen;
15310  soap->buflen = soap->bufidx + soap->dime.chunksize;
15311  }
15312  else
15313  soap->dime.chunksize -= soap->buflen - soap->bufidx;
15314  }
15315  soap->count = soap->buflen - soap->bufidx;
15316  }
15317 #endif
15318  return SOAP_OK;
15319 }
const char * id
Definition: stdsoap2.h:1786
short alloced
Definition: stdsoap2.h:2088
short keep_alive
Definition: stdsoap2.h:2099
int filterstop
Definition: stdsoap2.h:2021
void * is
Definition: stdsoap2.h:2046
int recvfd
Definition: stdsoap2.h:2050
struct soap_dom_element * dom
Definition: stdsoap2.h:2116
size_t chunksize
Definition: stdsoap2.h:1733
int error
Definition: stdsoap2.h:2112
struct soap_multipart * first
Definition: stdsoap2.h:1756
unsigned char Byte
Definition: zconf.h:368
struct soap_multipart * list
Definition: stdsoap2.h:1755
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
short part
Definition: stdsoap2.h:2085
char * action
Definition: stdsoap2.h:2095
soap_mode imode
Definition: stdsoap2.h:1937
soap_mode mode
Definition: stdsoap2.h:1936
struct soap_multipart * first
Definition: stdsoap2.h:1741
soap_int32 soap_wchar
Definition: stdsoap2.h:1610
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1969
#define SOAP_BUFLEN
Definition: stdsoap2.h:1013
size_t size
Definition: stdsoap2.h:1732
#define SOAP_BEGIN
Definition: stdsoap2.h:1419
size_t chunksize
Definition: stdsoap2.h:2090
short version
Definition: stdsoap2.h:1935
SOAP_FMAC1 struct soap_multipart *SOAP_FMAC2 soap_get_mime_attachment(struct soap *soap, void *handle)
Definition: stdsoap2.cpp:14500
#define SOAP_IO
Definition: stdsoap2.h:1342
unsigned int level
Definition: stdsoap2.h:2060
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1333
arena_t NULL
Definition: jemalloc_internal.h:624
struct soap_multipart * list
Definition: stdsoap2.h:1740
#define SOAP_ZLIB_INFLATE
Definition: stdsoap2.h:1335
int(* fprepareinitrecv)(struct soap *)
Definition: stdsoap2.h:2016
#define SOAP_UTF_ERROR
Definition: stdsoap2.h:1292
struct soap_dime dime
Definition: stdsoap2.h:2117
size_t z_buflen
Definition: stdsoap2.h:2204
short zlib_state
Definition: stdsoap2.h:2200
Byte FAR Bytef
Definition: zconf.h:377
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1334
int(* fform)(struct soap *)
Definition: stdsoap2.h:1988
const char * z_dict
Definition: stdsoap2.h:2198
short peeked
Definition: stdsoap2.h:2089
#define SOAP_ZLIB_GZIP
Definition: stdsoap2.h:1336
SOAP_FMAC1 const char *SOAP_FMAC2 soap_get_header_attribute(struct soap *soap, const char *line, const char *key)
Definition: stdsoap2.cpp:5680
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1346
soap_int32 soap_mode
Definition: stdsoap2.h:1340
#define soap_unget(soap, c)
Definition: stdsoap2.h:2284
soap_wchar ahead
Definition: stdsoap2.h:2057
SOAP_FMAC1 int SOAP_FMAC2 soap_match_cid(struct soap *soap, const char *s, const char *t)
Definition: stdsoap2.cpp:14622
#define inflateInit2(strm, windowBits)
Definition: zlib.h:1654
#define soap_blank(c)
Definition: stdsoap2.cpp:100
void * d_stream
Definition: stdsoap2.h:2195
const char * http_content
Definition: stdsoap2.h:1943
#define soap_revget1(soap)
Definition: stdsoap2.h:2283
#define SOAP_STOP
Definition: stdsoap2.h:1308
#define SOAP_DIME_VERSION
Definition: stdsoap2.h:1327
soap_mode omode
Definition: stdsoap2.h:1938
soap_int32 z_crc
Definition: stdsoap2.h:2196
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1463
char endpoint[SOAP_TAGLEN]
Definition: stdsoap2.h:2092
void * ssl
Definition: stdsoap2.h:2167
SOAP_FMAC1 int SOAP_FMAC2 soap_getmimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14397
const char * start
Definition: stdsoap2.h:1754
static void soap_free_iht(struct soap *)
Definition: stdsoap2.cpp:7576
short cdata
Definition: stdsoap2.h:2058
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1358
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1968
float z_ratio_in
Definition: stdsoap2.h:2206
struct soap_multipart * last
Definition: stdsoap2.h:1741
unsigned int z_dict_len
Definition: stdsoap2.h:2199
#define SOAP_FORM
Definition: stdsoap2.h:1309
struct soap_multipart * last
Definition: stdsoap2.h:1756
size_t bufidx
Definition: stdsoap2.h:2055
int recv_timeout
Definition: stdsoap2.h:1947
#define SOAP_CHK_EOF
Definition: stdsoap2.h:875
SOAP_FMAC1 int SOAP_FMAC2 soap_getdimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14228
#define SOAP_DIME_CF
Definition: stdsoap2.h:1324
char * boundary
Definition: stdsoap2.h:1753
#define SOAP_OK
Definition: stdsoap2.h:1245
short zlib_in
Definition: stdsoap2.h:2201
char * z_buf
Definition: stdsoap2.h:2203
int status
Definition: stdsoap2.h:2111
#define SOAP_ENC_LATIN
Definition: stdsoap2.h:1353
#define soap_get1(soap)
Definition: stdsoap2.h:2262
#define inflateInit(strm)
Definition: zlib.h:1649
#define soap_get0(soap)
Definition: stdsoap2.h:2261
size_t length
Definition: stdsoap2.h:2062
#define Z_OK
Definition: zlib.h:173
SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp(struct soap *soap)
Definition: stdsoap2.cpp:8495
char buf[SOAP_BUFLEN]
Definition: stdsoap2.h:2066
char flags
Definition: stdsoap2.h:1735
#define SOAP_NO_DATA
Definition: stdsoap2.h:1259
int(* fpreparerecv)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:2018
size_t chunkbuflen
Definition: stdsoap2.h:2091
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1276
#define Z_NULL
Definition: zlib.h:208
#define SOAP_ENC_XML
Definition: stdsoap2.h:1354
struct soap_mime mime
Definition: stdsoap2.h:2118
#define SOAP_EOF
Definition: stdsoap2.h:1243
SOAP_SOCKET socket
Definition: stdsoap2.h:2038
short body
Definition: stdsoap2.h:2059
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1355
size_t buflen
Definition: stdsoap2.h:1734
const char * type
Definition: stdsoap2.h:1787
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1350
SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces(struct soap *soap)
Definition: stdsoap2.cpp:9381
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1356
SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1337
size_t buflen
Definition: stdsoap2.h:2056
#define MAX_WBITS
Definition: zconf.h:247
int(* fparse)(struct soap *)
Definition: stdsoap2.h:1991
short zlib_out
Definition: stdsoap2.h:2202
#define SOAP_DIME_MB
Definition: stdsoap2.h:1326
size_t count
Definition: stdsoap2.h:2061

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SOAP_FMAC1 int SOAP_FMAC2 soap_begin_send ( struct soap soap)
7202 { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for output to socket=%d/fd=%d\n", soap->socket, soap->sendfd));
7203  soap_free_ns(soap);
7204  soap->error = SOAP_OK;
7205  soap->mode = soap->omode | (soap->mode & (SOAP_IO_LENGTH | SOAP_ENC_DIME));
7206 #ifdef WITH_ZLIB
7207  if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
7208  { if (soap->mode & SOAP_ENC_XML)
7209  soap->mode |= SOAP_IO_BUFFER;
7210  else
7211  soap->mode |= SOAP_IO_STORE;
7212  }
7213 #endif
7214 #ifndef WITH_LEAN
7215  if ((soap->mode & SOAP_IO_UDP))
7216  { soap->mode |= SOAP_ENC_XML;
7217  if (soap->count > SOAP_BUFLEN)
7218  return soap->error = SOAP_UDP_ERROR;
7219  }
7220 #endif
7221  if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH && soap_valid_socket(soap->socket))
7222  { if (soap->count || (soap->mode & SOAP_IO_LENGTH) || (soap->mode & SOAP_ENC_XML))
7223  soap->mode |= SOAP_IO_BUFFER;
7224  else
7225  soap->mode |= SOAP_IO_STORE;
7226  }
7227  soap->mode &= ~SOAP_IO_LENGTH;
7228  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
7229  if (soap_new_block(soap) == NULL)
7230  return soap->error;
7231  if (!(soap->mode & SOAP_IO_KEEPALIVE))
7232  soap->keep_alive = 0;
7233 #ifndef WITH_LEANER
7234  if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME))
7235  { soap->mode |= SOAP_ENC_MIME;
7236  soap->mode &= ~SOAP_ENC_DIME;
7237  }
7238  else if (!(soap->mode & SOAP_ENC_MIME))
7239  soap->mode &= ~SOAP_ENC_MTOM;
7240  if (soap->mode & SOAP_ENC_MIME)
7242 #ifdef WIN32
7243 #ifndef UNDER_CE
7244 #ifndef WITH_FASTCGI
7245  if (!soap_valid_socket(soap->socket) && !soap->os) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
7246 #ifdef __BORLANDC__
7247  setmode(soap->sendfd, _O_BINARY);
7248 #else
7249  _setmode(soap->sendfd, _O_BINARY);
7250 #endif
7251 #endif
7252 #endif
7253 #endif
7254 #endif
7255  if (soap->mode & SOAP_IO)
7256  { soap->bufidx = 0;
7257  soap->buflen = 0;
7258  }
7259  soap->chunksize = 0;
7260  soap->ns = 0;
7261  soap->null = 0;
7262  soap->position = 0;
7263  soap->mustUnderstand = 0;
7264  soap->encoding = 0;
7265  soap->idnum = 0;
7266  soap->level = 0;
7267  soap_clr_attr(soap);
7269 #ifdef WITH_ZLIB
7270  soap->z_ratio_out = 1.0;
7271  if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state != SOAP_ZLIB_DEFLATE)
7272  { if (!soap->z_buf)
7273  soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
7274  soap->d_stream->next_out = (Byte*)soap->z_buf;
7275  soap->d_stream->avail_out = SOAP_BUFLEN;
7276 #ifdef WITH_GZIP
7277  if (soap->zlib_out != SOAP_ZLIB_DEFLATE)
7278  { memcpy(soap->z_buf, "\37\213\10\0\0\0\0\0\0\377", 10);
7279  soap->d_stream->next_out = (Byte*)soap->z_buf + 10;
7280  soap->d_stream->avail_out = SOAP_BUFLEN - 10;
7281  soap->z_crc = crc32(0L, NULL, 0);
7282  soap->zlib_out = SOAP_ZLIB_GZIP;
7283  if (soap->z_dict)
7284  *((Byte*)soap->z_buf + 2) = 0xff;
7286  return soap->error = SOAP_ZLIB_ERROR;
7287  }
7288  else
7289 #endif
7290  if (deflateInit(soap->d_stream, soap->z_level) != Z_OK)
7291  return soap->error = SOAP_ZLIB_ERROR;
7292  if (soap->z_dict)
7293  { if (deflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK)
7294  return soap->error = SOAP_ZLIB_ERROR;
7295  }
7296  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflate initialized\n"));
7297  soap->zlib_state = SOAP_ZLIB_DEFLATE;
7298  }
7299 #endif
7300 #ifdef WITH_OPENSSL
7301  if (soap->ssl)
7302  ERR_clear_error();
7303 #endif
7304  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
7305  soap->part = SOAP_BEGIN;
7306 #ifndef WITH_LEANER
7307  if (soap->fprepareinitsend && (soap->mode & SOAP_IO) == SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)))
7308  return soap->error;
7309 #endif
7310  return SOAP_OK;
7311 }
short keep_alive
Definition: stdsoap2.h:2099
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy)
Definition: zlib.h:1651
unsigned short z_level
Definition: stdsoap2.h:2205
int error
Definition: stdsoap2.h:2112
unsigned char Byte
Definition: zconf.h:368
#define soap_valid_socket(n)
Definition: stdsoap2.h:859
int sendfd
Definition: stdsoap2.h:2049
short part
Definition: stdsoap2.h:2085
#define SOAP_UDP_ERROR
Definition: stdsoap2.h:1272
soap_mode mode
Definition: stdsoap2.h:1936
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1357
#define SOAP_BUFLEN
Definition: stdsoap2.h:1013
#define SOAP_BEGIN
Definition: stdsoap2.h:1419
short ns
Definition: stdsoap2.h:2084
#define SOAP_IO_UDP
Definition: stdsoap2.h:1348
size_t chunksize
Definition: stdsoap2.h:2090
#define SOAP_IO_FLUSH
Definition: stdsoap2.h:1343
#define SOAP_IO
Definition: stdsoap2.h:1342
unsigned int level
Definition: stdsoap2.h:2060
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1600
int(* fprepareinitsend)(struct soap *)
Definition: stdsoap2.h:2015
arena_t NULL
Definition: jemalloc_internal.h:624