Re: POST ?
"Greg Haerr" <[email protected]> Thu, 10 Oct 2002 21:58:43 -0600
| Newsgroups | gmane.comp.web.viewml.devel |
|---|---|
| Message-ID | <[email protected]> |
> I just downloaded the binary viewml-x11 (from > ftp://ftp.viewml.com/pub/viewml/binary/) after having failed to build it > myself from CVS under Linux (more about that might follow in another mail). Please send some details about your CVS problems. I'm curious to see what the problem is and to get it fixed. > This binary does not fire off a POST request properly even though the form > I try it on uses method="post"! > > Instead it simple makes a GET on the 'action' URL, not even passing along > the input variables correctly. > > Is this fixed in a later version? This binary version may indeed have a problem with POST. Originally, ViewML didn't support anything but GET requests. However, Chris Hawks submitted a patch that should fix this (which I've attached to this email, in case you cannot work with the CVS code, as you mentioned above.) As far as I can tell, this patch was added to the CVS version. > I'm trying this to evaluate viewml to figure out if it is "Good Enough" for > a forthcoming project of mine. > > Also, I couldn't find any info about it, but I take it ViewML has no > problems with ordinary cookies? Cookies are not currently supported by ViewML, unfortunately. Jason Kingan, by way of Greg Haerr Century Software ############################################################# This message is sent to you because you are subscribed to the mailing list <[email protected]>. To unsubscribe, E-mail to: <[email protected]> To switch to the DIGEST mode, E-mail to <[email protected]> To switch to the INDEX mode, E-mail to <[email protected]> Send administrative queries to <[email protected]>
post.diff
(application/octet-stream, 1.7 KB)
--- ../../viewml-0.21/src/http.cpp Tue Apr 10 15:22:16 2001
+++ http.cpp Tue Sep 11 08:47:26 2001
@@ -85,7 +88,8 @@
m_bThreadRunning = false;
m_pDocCallback = 0;
- HTProfile_newPreemptiveClient("ViewML", "0.14");
+ /* This lets us run the event loop by hand (post doesn't work otherwise */
+ HTProfile_newNoCacheClient("ViewML", "0.21");
HTPrint_setCallback(printer);
HTTrace_setCallback(tracer);
@@ -245,6 +296,14 @@
}
+// CRH
+int request_handler (HTRequest * request, HTResponse * response,
+ void * param, int status)
+ {
+ HTEventList_stopLoop ();
+ return HT_OK;
+ }
+
int HTTPConnection::postURL(HTTPRequest * r)
{
char * c = (char*)alloca(strlen(r->getData())+1);
@@ -267,22 +326,33 @@
c = c_ptr+1;
}
+ /* Add the last field */
+ if (*c) {
+ if (!formfields) formfields = HTAssocList_new();
+ HTParseFormInput(formfields, c);
+ }
+
/* Create a request */
request = HTRequest_new();
/* Set the default output to "asis" */
HTRequest_setOutputFormat(request, WWW_SOURCE);
- HTRequest_setPreemptive(request, YES);
-
+
/* Get an anchor object for the URI */
anchor = HTAnchor_findAddress(r->getURL());
+
+ r->_request = request;
/* Post the data and get the result in a chunk */
chunk = HTPostFormAnchorToChunk(formfields, anchor, request);
+ /* Run event loop by hand */
+ HTNet_addAfter(request_handler, NULL, NULL, HT_ALL, HT_FILTER_LAST);
+ HTEventList_loop(request);
+ HTNet_deleteAfter (request_handler);
+
/* If chunk != NULL then we have the data */
if (chunk) {
-
int sz = HTChunk_size(chunk);
r->addBuffer((unsigned char*)HTChunk_data(chunk),sz);
HTChunk_delete(chunk);