cherokee / webserver

Cherokee Web Server
GNU General Public License v2.0
569 stars 104 forks source link

dwriter add XML-RPC #224

Open danielniccoli opened 11 years ago

danielniccoli commented 11 years ago

Original author: ste...@konink.de (October 29, 2008 11:35:39)

I think something that implements XML-RPC, concatenation based not DOM, would be a great extension for dwriter (and thus dbslayer). You can assign me :)

Original issue: http://code.google.com/p/cherokee/issues/detail?id=170

danielniccoli commented 11 years ago

From alobbs on October 29, 2008 11:58:37 So.. you'd send the 'plain query' and expect to receive XML (as in XML-RPC)?

danielniccoli commented 11 years ago

From ste...@konink.de on October 29, 2008 14:01:32 Yes; I think I have it almost implemented (train trip was too short).

But the reason I added it has a completely different reason (not slayer related); Tim is working on something extremely cool, and XML-RPC is required for it.

danielniccoli commented 11 years ago

From alobbs on October 29, 2008 14:26:38 Sounds cool.. please send the patch when you finish it :)

danielniccoli commented 11 years ago

From tah...@gmail.com on October 29, 2008 14:45:36 +1 I would love to see the code for that :)

danielniccoli commented 11 years ago

From ste...@konink.de on October 29, 2008 15:18:38 It has code now; but I need to verify the correct output. Anyone has a quick way to do this in a qa test?

danielniccoli commented 11 years ago

From optimiza...@gmail.com on October 29, 2008 15:43:54 And, instead of a 'plain query' full XML-RPC compatibility wouldn't make sense?

This way one could do (python):

import xmlrpclib db = xmlrpclib.ServerProxy("http://host/dbslayer")

result = db.query("SELECT * FROM ....... ")

what do you think?

danielniccoli commented 11 years ago

From ste...@konink.de on October 29, 2008 15:48:28 It compiles but is NOT tested, so consider it less than alpha ;) Tahers if you, next to looking at it, also want to try it, be my guest.

danielniccoli commented 11 years ago

From tah...@gmail.com on October 29, 2008 16:08:02 I will as soon as I get the chance :)

danielniccoli commented 11 years ago

From alobbs on October 29, 2008 17:11:21 Stefan, since you are the coder, it'd much more easy if you could send both the patch and a working example. :- )

danielniccoli commented 11 years ago

From ste...@konink.de on October 29, 2008 17:46:08 I have absolutely no problem using the unittest you must have created to test the dwriter code. If only I had it.

danielniccoli commented 11 years ago

From alobbs on October 29, 2008 17:55:22 DBslayer is the only handler using dwriter, so as long as it cannot be automatically tested because its dependency on MySQL, there are no QA tests for that class.

Anyway, the only thing you'd need at this stage is a proof of concept client, don't you think? :-) Something like a Python script that can receive the information and convert back to native structures.

danielniccoli commented 11 years ago

From ste...@konink.de on October 29, 2008 18:04:59 My problem is that I don't have a dbslayer setup available to play with ;) But I have finally managed to create a small test.c to test any dwriter. Will provide the code later (because I noticed some 'this should not happen' things).

danielniccoli commented 11 years ago

From ste...@konink.de on October 30, 2008 02:48:48 Output: [ "test", 0.0001, "oeutest", 1.0001 ] { "test": "test", "hoi": "yessir" }

test 0.0001 oeutest 1.0001 test test hoi yessir test0.0001oeutest1.0001testtesthoiyessir Nifty code to test it: ``` cherokee_buffer_t tmp = CHEROKEE_BUF_INIT; cherokee_buffer_t tmp2 = CHEROKEE_BUF_INIT; cherokee_dwriter_t writer; cherokee_dwriter_init (&writer, &tmp); //writer.lang = dwriter_xmlrpc; writer.pretty = TRUE; cherokee_dwriter_set_buffer(&writer, &tmp2); cherokee_dwriter_list_open (&writer); cherokee_dwriter_string (&writer, "test", 4); cherokee_dwriter_double (&writer, 0.0001f); cherokee_dwriter_string (&writer, "oeutest", 7); cherokee_dwriter_double (&writer, 1.0001f); cherokee_dwriter_list_close (&writer); cherokee_dwriter_dict_open (&writer); cherokee_dwriter_string (&writer, "test", 4); cherokee_dwriter_string (&writer, "test", 4); cherokee_dwriter_string (&writer, "hoi", 3); cherokee_dwriter_string (&writer, "yessir", 6); cherokee_dwriter_dict_close (&writer); cherokee_dwriter_mrproper(&writer); cherokee_buffer_mrproper(&tmp); cherokee_buffer_mrproper(&tmp2); ``` XML-RPC also supports Base64 and a Datetime field in ISO8601. Since this is not yet handled in DBSlayer, I cannot yet test Dbslayer code I'll leave the addiction of DATE_TYTE2S to the next brave young soul. In essence it would be duplicating the string function, and replace 'string' with 'dateTime.iso8601'.
danielniccoli commented 11 years ago

From ste...@konink.de on October 21, 2011 02:30:49 https://github.com/skinkie/webserver/commit/0aa0b71f75d2edd59a22bab8f00963fb0291b99e

danielniccoli commented 11 years ago

From alobbs on October 21, 2011 09:31:56 Stefan, let's not close the bugs until the features make it upstream or are rejected.