if (! rawquery.isEmpty ()) {
setRawQuery (fd);
} else {
- ustring data;
- buildQuery (queryParam (), data);
- setFormType_urlencoded ();
- ne_set_request_body_buffer (req, data.c_str (), data.size ());
+ rawquery.setText ();
+ buildQuery (queryParam (), rawquery.param);
+ setRawQuery (fd);
}
break;
case METHOD_FILE:
void MLNeon::newSession (MlEnv* mlenv) {
session.reset (new NeonSession (proto, host, port));
// *** User-Agent
- query.reset (new NeonQuery (session->get (), mlenv));
+// query.reset (new NeonQuery (session->get (), mlenv));
}
//============================================================
{NULL, 0, 0}
};
+ obj->query.reset (new NeonQuery (obj->session->get (), mlenv));
setParams (arg, 1, ¶ms, kwlist, &keywords, NULL);
obj->query->path = eval_str (params[0], mlenv);
if (evkw_bool (0, f)) // 0:get
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
return newMNode_num (obj->query->getStatus ());
}
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
std::stringstream ostr;
MotorOutputOStream out (&ostr);
nextNode (arg);
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
tgt = mlenv->env->path_store_file (name);
tmp.assign (tgt).append (CharConst ("-tmp")).append (to_ustring (getpid ()));
setParams (arg, 0, NULL, kwlist, &keywords, NULL);
if (keywords[0] && eval_bool (keywords[0], mlenv))
cflag = true;
+ if (! obj->query)
+ return NULL;
if (! mlenv->env->responseDone)
mlenv->env->standardResponse_html ();
nextNode (arg);
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
ustring ans = obj->query->getResponseCookie (name);
if (ans.length () > 0) {
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
return obj->query->getResponseCookieAll ();
}
MNode* ml_neon_http_content_type (MNode* cell, MlEnv* mlenv, MLFunc* mobj) {
MNode* arg = cell->cdr ();
MLNeon* obj = (MLNeon*)mobj;
- ustring u = obj->query->getResponseHeader ("content-type");
+ if (! obj->query)
+ return NULL;
+
+ ustring u = obj->query->getResponseHeader ("content-type");
if (u.length () > 0) {
uiterator b, e, m;
b = u.begin ();
nextNode (arg);
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
u = obj->query->getResponseHeader (name.c_str ());
if (u.length () > 0) {
if (arg)
throw (uErrorWrongNumber);
+ if (! obj->query)
+ return NULL;
return obj->query->getResponseHeaderAll ();
}