• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/gsoap/source_build_platform/gsoap/plugin/

Lines Matching defs:soap

54 	struct soap soap;
55 soap_init(&soap);
56 soap_register_plugin_arg(&soap, http_form, http_form_handler);
58 ... = soap_copy(&soap); // copies plugin too but not its data: plugin data is shared since fcopy is not set
60 soap_done(&soap); // detach plugin (calls plugin->fdelete)
63 int http_form_handler(struct soap*)
71 char *s = form(soap);
73 { char *key = query_key(soap, &s); // decode next form string key
74 char *val = query_val(soap, &s); // decode next form string value (if any)
79 soap_response(soap, SOAP_HTML); // use this to return HTML ...
80 soap_response(soap, SOAP_OK); // ... or use this to return a SOAP message
82 soap_send(soap, "<HTML>...</HTML>"); // example HTML
84 soap_end_send(soap);
96 static int http_form_init(struct soap *soap, struct http_form_data *data, int (*handler)(struct soap*));
97 static void http_form_delete(struct soap *soap, struct soap_plugin *p);
98 static int http_form_parse_header(struct soap *soap, const char*, const char*);
100 int http_form(struct soap *soap, struct soap_plugin *p, void *arg)
105 if (http_form_init(soap, (struct http_form_data*)p->data, (int (*)(struct soap*))arg))
112 static int http_form_init(struct soap *soap, struct http_form_data *data, int (*handler)(struct soap*))
113 { data->fparsehdr = soap->fparsehdr; /* save old HTTP header parser callback */
114 soap->fparsehdr = http_form_parse_header; /* replace HTTP header parser callback with ours */
116 soap->fform = handler;
120 static void http_form_delete(struct soap *soap, struct soap_plugin *p)
121 { free(p->data); /* free allocated plugin data (this function is not called for shared plugin data, but only when the final soap_done() is invoked on the original soap struct) */
124 static int http_form_parse_header(struct soap *soap, const char *key, const char *val)
125 { struct http_form_data *data = (struct http_form_data*)soap_lookup_plugin(soap, http_form_id);
128 soap->error = data->fparsehdr(soap, key, val); /* parse HTTP header */
129 if (soap->error == SOAP_OK)
133 soap->error = SOAP_FORM; /* delegate body parsing to form handler */
136 return soap->error;
139 char* form(struct soap *soap)
142 if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK
144 || soap->zlib_in != SOAP_ZLIB_NONE
148 soap->labidx = 0;
149 if (soap_append_lab(soap, "?", 1))
153 if (soap_append_lab(soap, NULL, 0))
155 s = soap->labbuf + soap->labidx;
156 k = soap->lablen - soap->labidx;
157 soap->labidx = soap->lablen;
159 { if ((c = soap_getchar(soap)) == (int)EOF)
165 s = soap->labbuf;
168 { if (soap->length)
169 { s = (char*)soap_malloc(soap, soap->length + 2);
174 for (i = soap->length; i; i--)
176 if ((c = soap_getchar(soap)) == (int)EOF)
177 { soap->error = SOAP_EOF;
186 soap_end_recv(soap);