Code Monkey home page Code Monkey logo

babelouest / ulfius Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 183.0 6.67 MB

Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services

Home Page: https://babelouest.github.io/ulfius

License: GNU Lesser General Public License v2.1

Makefile 2.02% C 94.34% HTML 0.63% CSS 0.02% CMake 2.64% Shell 0.23% Roff 0.10% Dockerfile 0.02%
c json libcurl libmicrohttpd rest-api restful web-development webservice websocket-client websocket-communication websocket-server websockets

ulfius's Introduction

What?

Main projects

Project Descripion License Last release
Glewlwyd Experimental Single Sign On server, OAuth2, Openid Connect, MFA GitHub GitHub release (latest by date)
Ulfius Web Framework in C GitHub GitHub release (latest by date)
Rhonabwy JWK, JWKS, JWS, JWE and JWT C library GitHub GitHub release (latest by date)
Iddawc OAuth2 and OIDC client library GitHub GitHub release (latest by date)
Hoel C Database abstraction library with json based language GitHub GitHub release (latest by date)
Taliesin Lightweight audio streaming server GitHub GitHub release (latest by date)
Angharad House automation system with a REST/Json interface GitHub GitHub release (latest by date)
Hutch Online password and secret locker GitHub GitHub release (latest by date)
Yder Logging library for C applications GitHub GitHub release (latest by date)
Orcania Potluck library GitHub GitHub release (latest by date)

Other projects

Project Descripion License
Taulas Arduino source files for Angharad system devices GitHub
Huddersfield Project packages builder and publisher GitHub

Why?

C combines the power and performance of assembly language with the flexibility and ease-of-use of assembly language.

Coding backend in C and front-end in HTML/Javascript is the true meaning of life.

Who?

Nicolas Mora

My GPG key: 8405 B02F CC28 EF97 44C8 F253 FE82 1394 40BD 22B9

avatar I don't look like that

Where?

Québec City, Canada

How?

(Debian || Ubuntu) && GNU && Geany

ulfius's People

Contributors

alteholz avatar babelouest avatar chipitsine avatar dlblv avatar giedriusm avatar hmkim123 avatar jkbenaim avatar laf0rge avatar locutusofborg avatar madebr avatar nageshlop avatar nazzarenomarziale avatar nixbody avatar oliv3 avatar ronangaillard avatar timgates42 avatar utoni avatar yogo1212 avatar yomgui1 avatar zhangxinlong633 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ulfius's Issues

websocket demo issue

Hi,

I am interested in the websocket demo. The demo works with Firefox but it doesn't work with Chrome.
When the websocket connection request is sent, the websocket is created and then directly deleted.

Also, there is an issue with string handling.

  • The user data "my_user_data" has its 4 first bytes overwrited when passed to the websocket engine.
  • And string messages coming from the websocket client don't reach the incoming messages callback on the server.

Please let me know if I can support you.
Best regards,
Michael

compilation issue

Hello, I found and fixed a small issue in your Makefile. Hereafter the diff:

diff --git a/src/Makefile b/src/Makefile
index cc45510..3ab1c76 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -73,7 +73,7 @@ clean:
 
 install: all
        cp $(OUTPUT).$(VERSION) $(PREFIX)/lib
-       cp ulfius.h $(PREFIX)/include
+       cp $(ULFIUS_INCLUDE)/ulfius.h $(PREFIX)/include
        -ldconfig
 
 static-install: static

Regards,

Eric

Handing over the desired microhttpd thread model when starting framework

Hello,

I currently investigate using ulfius for my embedded system. Therefore I am interested, if it would be possible to make it possible to specify some options for the start_framework call to indicate what kind of thread-model to use in the underlying microhttpd.

To be more specific, I would like to use MHD_USE_SELECT_INTERNALLY to reduce the costs of spawning a thread for each connection.

I don't know if it would be wise to pass-through all of the microhttpd thread models blindly as I can't oversee the impact on the ulfius library in its whole.

So what is your opinion about this?

websocket incoming messages empty

Hi Nicolas,

In the websocket example, I always have text payload empty.
The message information however shows that some data have been received (data length isn't null).
But the data itself seems empty.

Please let me know need further information.

Thank you.
Michael

Websocket don't build...

Hi,

On your last commit, you did this:
`#if defined(_WIN32) && !defined(U_DISABLE_WEBSOCKET)
#define U_DISABLE_WEBSOCKET
#endif

#if (MHD_VERSION < 0x00095300) && !defined(U_DISABLE_WEBSOCKET)
#define U_DISABLE_WEBSOCKET
#endif

#ifndef U_DISABLE_WEBSOCKET
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <poll.h>
#ifndef POLLRDHUP
#define POLLRDHUP 0x2000
#endif
#endif
#include <pthread.h>
#include <microhttpd.h>`

So basically you check microhttpd version before including the header file...
Of course MHD_VERSION is not define and Websocket are disabled...

Could you please fix that?

Best regards,

Michael

How do I build Ulfius 2.0?

Hello,

Firstly, thanks for this awesome job, I didn't know that this project existed.

So, I'm trying to compile Ulfius 2.0 with the following steps:

$ git clone https://github.com/babelouest/ulfius.git
$ cd ulfius/
$ git checkout 2.0
$ git submodule update --init
$ make
$ sudo make install

but it fails in the make step:

$ make
cd lib/orcania && make
make[1]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/orcania'
cd ./src && make
make[2]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/orcania/src'
gcc -c -fPIC -Wall -D_REENTRANT -O3  memory.c
gcc -c -fPIC -Wall -D_REENTRANT -O3  orcania.c
gcc -shared -Wl,-soname,liborcania.so -o liborcania.so.1.1 orcania.o memory.o -lc -ljansson
ln -sf liborcania.so.1.1 liborcania.so
make[2]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/orcania/src'
make[1]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/orcania'
cd lib/yder/src && make
make[1]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/yder/src'
gcc -c -fPIC -Wall -D_REENTRANT -O3 yder.c
yder.c:33:21: fatal error: orcania.h: No such file or directory
compilation terminated.
Makefile:35: recipe for target 'yder.o' failed
make[1]: *** [yder.o] Error 1
make[1]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/yder/src'
Makefile:45: recipe for target 'libulfius.so' failed
make: *** [libulfius.so] Error 2

and make clean fails too:

$ make clean 
cd lib/orcania && make clean
make[1]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/orcania'
cd ./src && make clean
make[2]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/orcania/src'
rm -f *.o *.so liborcania.so liborcania.so.*
make[2]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/orcania/src'
cd ./test && make clean
make[2]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/orcania/test'
rm -f *.o str_test split_test memory_test jansson_test valgrind.txt
make[2]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/orcania/test'
make[1]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/orcania'
cd lib/yder/src && make clean
make[1]: Entering directory '/home/silvioprog/dev/git/ulfius/lib/yder/src'
rm -f *.o *.so libyder.so libyder.so.*
make[1]: Leaving directory '/home/silvioprog/dev/git/ulfius/lib/yder/src'
cd ./src && make clean
make[1]: Entering directory '/home/silvioprog/dev/git/ulfius/src'
rm -f *.o *.so libulfius.so libulfius.so.*
make[1]: Leaving directory '/home/silvioprog/dev/git/ulfius/src'
cd ./examples && make clean
/bin/sh: 1: cd: can't cd to ./examples
Makefile:29: recipe for target 'clean' failed
make: *** [clean] Error 2

How do I build Ulfius.0 2?

Thank you!

ulfius_get_json_body_response doesn't work

Hello,

Sorry for my silence, I had difficulties with dependances. ( I work with Aix...)
Proxy evolution works, maybe add 'port' variable?

There are a problem with ulfius_get_json_body_response, if the Content-Type is "application/json; charset=UTF-8", the json body isn't loaded.
In:
if (response != NULL && response->map_header != NULL && NULL != o_strstr(ULFIUS_HTTP_ENCODING_JSON, u_map_get_case(response->map_header, ULFIUS_HTTP_HEADER_CONTENT)))

ULFIUS_HTTP_ENCODING_JSON should be in second parameter.

Providing non NULL argument insufficient to restrict binding to specific address

A call to ulfius_init_instance(); succeeds if a sockaddr_in * argument (containing IP address) is supplied, however, a subsequent ulfius_start_framework() call fails and appears to ignore the previously supplied argument to the ulfius_init_instance() routine.

Ulfius code appears to correctly stash the pointer for background microhttpd, call, however, it doesn't appear to setting the required flag in the microhttpd MHD_start_daemon call or to be manipulating the port argument both of which which appear to be requirements to have microhttpd respect the original ulfius caller's intentions.

Ulfius should set the MHD_OPTION_SOCK_ADDR option flag, and potentially move the ulfius caller's port number into the user's supplied sockaddr_in structure (if both arguments are supplied) via htons() prior to the MHD_start_daemon call (likely behind ulfius_start_framework() call) since microhttpd explicitly ignores its own port argument if the user supplies a sockaddr_in argument according to its documentation.

This is just preliminary analysis on my part. I'm using IPv4 addressing and structures - unclear what the IPv6 implications are to me.

https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#toc-Starting-and-stopping-the-server

MHD_OPTION_SOCK_ADDR

Bind daemon to the supplied socket address. This option should be followed by a struct sockaddr . If MHD_USE_IPv6 is specified, the struct sockaddr should point to a struct sockaddr_in6, otherwise to a struct sockaddr_in. If this option is not specified, the daemon will listen to incoming connections from anywhere. If you use this option, the ’port’ argument from MHD_start_daemon is ignored and the port from the given struct sockaddr * will be used instead.

Painful to build on Centos 6.5

Hi Babelouest. Good job on a very awesome REST framework.
It was easy to install and use on Centos 7.

I have one issue: this is painful to install on systems that do not support > libcurl 20.
I have a few 6.5 machines that will want to run this, and the centos repos do not have anything newer than libcurl 7.19.

These kind of errors come up -
u_send_request.c:724: error: ‘CURLOPT_MAIL_RCPT’ undeclared (first use in this function)
u_send_request.c:724: warning: type defaults to ‘int’ in declaration of ‘_curl_opt’
make[1]: *** [u_send_request.o] Error 1
make[1]: Leaving directory `/home/xxx/ulfius/src'
make: *** [libulfius.so] Error 2

Since I am not using SMTP in my project, I was able to disable the entire ulfius_send_smtp_email function. Do you have any suggestions for dealing with this?

Maybe a configure option to disable SMTP features?
Or some older CURLOPT flag for backwards compat?

Thanks!

Building for Android

Hi, I'm trying integrate your library in my Android project.
So far I was using MHD and was also able to build Jensson.
But ulfius won't build. It gives me this error:
-- Could NOT find Systemd (missing: SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR)

Ulfius build on Mac OS X

My apologies if this is solved somewhere and I haven't found it yet but wanted to get some feedback on the error I'm currently seeing when trying to compile. I'm trying to compile on MacOS 10.12.3. Thanks in advance!

➜  orcania git:(0adb944) make && sudo make install
cd ./src && /Library/Developer/CommandLineTools/usr/bin/make debug
gcc -shared -Wl,-soname,liborcania.so -o liborcania.so.1.1 orcania.o memory.o base64.o -lc -ljansson
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [liborcania.so] Error 1
make: *** [debug] Error 2

Installing on Ubuntu 16.04

Hi,

I'm trying to install ulfius on my Ubuntu 16.04. However, while installing the deb package, it throws an error
libulfius depends on libmicrohttpd12 (>= 0.9.51); however: Package libmicrohttpd12 is not installed.

When I checked the project page [1], the latest version of libmicrohttpd12 for Ubuntu 16.04 is 0.9.44. Is there a way to install ulfius on Ubuntu 16.04?

[1] = https://launchpad.net/ubuntu/+source/libmicrohttpd

undefined reference to symbol 'json_array_append_new'

brandon@ns547847:~$ gcc -I`pg_config --includedir` -L`pg_config --libdir` sql.c -o sql -lpq -lulfius
/usr/bin/ld: /tmp/ccJpLQsk.o: undefined reference to symbol 'json_array_append_new'
//usr/lib/x86_64-linux-gnu/libjansson.so.4: error adding symbols: DSO missing from command line
brandon@ns547847:~$ uname -a
Linux foo 4.9.33-mod-std-ipv6-64 #1 SMP Tue Jun 20 11:36:21 CEST 2017 x86_64 x86_64 x86_64 GNU/Linux

FreeBSD: Error while building caused by Linux Poll

Hi again,
I asked you sometime ago about building ulfius on FreeBSD and we got the cmake working yet I have been super busy since then.
Now I’m looking at the library again so returned to the code and all seems fine, I decided to use the normal make (not cmake and just updated the clags and lib to include /usr/local/lib and /usr/local/include - would be easier for me in the future to port to FreeBSD port system).

Both orcania and yder were built fine (and created symbolic links for the libs will add that to make later)
yet when I arrived to last make command, it threw an error (last time I had the same issue when I was working on cmake as well).

Thanks so much...

/home/code/app/lib/ulfius >gmake && sudo gmake install
cd ./src && gmake
gmake[1]: Entering directory '/usr/home/code/app/lib/ulfius/src'
cc -c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../include -I../lib/orcania/src -I../lib/yder/src -O3 -I/usr/local/include ulfius.c
cc -c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../include -I../lib/orcania/src -I../lib/yder/src -O3 -I/usr/local/include u_map.c
cc -c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../include -I../lib/orcania/src -I../lib/yder/src -O3 -I/usr/local/include u_request.c
cc -c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../include -I../lib/orcania/src -I../lib/yder/src -O3 -I/usr/local/include u_response.c
cc -c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../include -I../lib/orcania/src -I../lib/yder/src -O3 -I/usr/local/include u_send_request.c
cc -c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../include -I../lib/orcania/src -I../lib/yder/src -O3 -I/usr/local/include u_websocket.c
u_websocket.c:151:67: error: use of undeclared identifier 'POLLRDHUP'
} else if (websocket->websocket_manager->fds.revents & (POLLRDHUP|POLLERR|POLLHUP|POLLNVAL)) {
^
u_websocket.c:224:59: error: use of undeclared identifier 'POLLRDHUP'
websocket->websocket_manager->fds.events = POLLIN | POLLRDHUP;
^
u_websocket.c:516:54: error: use of undeclared identifier 'POLLRDHUP'
} else if (!(websocket_manager->fds.revents & (POLLRDHUP|POLLERR|POLLHUP|POLLNVAL)) && poll_ret > 0) {
^
3 errors generated.
gmake[1]: *** [Makefile:66: u_websocket.o] Error 1
gmake[1]: Leaving directory '/usr/home/code/app/lib/ulfius/src'
gmake: *** [Makefile:53: libulfius.so] Error 2

problem initializing submodules

Hello,

I'm not pro git user but I was struggling with the installation step:

git submodule --init

It was returning a usage message for me in proj main directory.

It would be easier to simply run (it's just a hint):

git clone --recursive https://github.com/babelouest/ulfius.git

Building on FreeBSD

Hi @babelouest
Thanks for this awesome work
I was trying to install the ulfius library on FreeBSD (couldn't find it the port system) and it complained about systemd absence.
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Systemd (missing: SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR)

Is there away to get around this to get work on freeBSD? and is there any plan for the future to support a freeBSD release as well?

Cheers

Error in Make at Arch!

[guest@base]: ~/Projects/ulfius/src>$ make
gcc -shared -Wl,-soname,libulfius.so -o libulfius.so.2.1 ulfius.o u_map.o u_request.o u_response.o u_send_request.o u_websocket.o -L/usr/local/lib -L../lib/orcania/src -L../lib/yder/src -lc -lmicrohttpd -lyder -lorcania -lpthread -ljansson -lcurl -lgnutls
/usr/bin/ld: cannot find -lyder
/usr/bin/ld: cannot find -lorcania
collect2: error: ld returned 1 exit status
make: *** [Makefile:46: libulfius.so] Error 1
[guest@base]: ~/Projects/ulfius/src>$ cd ..
[guest@base]: ~/Projects/ulfius>$ make
cd ./src && make   
make[1]: Entering directory '/home/guest/Projects/ulfius/src'
gcc -shared -Wl,-soname,libulfius.so -o libulfius.so.2.1 ulfius.o u_map.o u_request.o u_response.o u_send_request.o u_websocket.o -L/usr/local/lib -L../lib/orcania/src -L../lib/yder/src -lc -lmicrohttpd -lyder -lorcania -lpthread -ljansson -lcurl -lgnutls
/usr/bin/ld: cannot find -lyder
/usr/bin/ld: cannot find -lorcania
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:46: libulfius.so] Error 1
make[1]: Leaving directory '/home/guest/Projects/ulfius/src'
make: *** [Makefile:53: libulfius.so] Error 2
[guest@base]: ~/Projects/ulfius>$ 

Websocket example

Hi @babelouest
compliment for fine work.

I could ask you how to compile websocket sample?
I tried compiling ulfius with websocket support, but when compiling the example I have an error (ulfuis is not available in websocket mode).

thanks for listening.

Build per intructions broken again

Something has changed in the past few days. Following your INSTALL.md instructions...
Building under Debian (arm) fails:

$ cd ../yder
$ make && sudo make install

1) in the yder/examples portion - "***No rule to make target 'install'. Stop"

$cd ../..
2) in the ulfius portion: "MHD_ALLOW_UPGRADE" undeclared.....

The first problem is immaterial - but the second is a compilation error - and I have no idea what to do about it.

Thanks. Also thanks for an excellent library.

client aborting connection causes double free fault

it happens randomly but i believe it happens when connection is dropped or aborted.
here is the back trace of what happens
#0 0x00007f8c5be03428 in __GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:54
resultvar = 0
pid = 23201
selftid = 36159
#1 0x00007f8c5be0502a in __GI_abort () at abort.c:89
save_stage = 2
act = {__sigaction_handler = {sa_handler = 0x3030302070782d72,
sa_sigaction = 0x3030302070782d72}, sa_mask = {__val = {
4048771456345059376, 3761974860267466810, 2314885530819639605,
2314885530818453536, 3395749441387372576, 6860733171187738988,
8679965255892022326, 3270858180467255085, 751946305058778674,
7306073576450844215, 4063996380969971769, 3472331827566556515,
3467895053655089200, 2319406791620833328, 2319389199435444272,
7233684126751405834}}, sa_flags = 808466534, sa_restorer = 0x5c}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00007f8c5be457ea in __libc_message (do_abort=do_abort@entry=2,
fmt=fmt@entry=0x7f8c5bf5eed8 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
ap = <error reading variable ap (Attempt to dereference a generic pointe r.)>
fd = 8
on_2 =
list =
nlist =
cp =
written =
#3 0x00007f8c5be4e37a in malloc_printerr (ar_ptr=,
ptr=, str=0x7f8c5bf5efe8 "double free or corruption (out)",
action=3) at malloc.c:5006
buf = "00007f8c50004c90"
cp =
ar_ptr =
str = 0x7f8c5bf5efe8 "double free or corruption (out)"
action = 3
#4 _int_free (av=, p=, have_lock=0)
at malloc.c:3867
size =
fb =
nextchunk =
nextsize =
---Type to continue, or q to quit---
nextinuse =
prevsize =
bck =
fwd =
errstr =
locked =
#5 0x00007f8c5be5253c in _GI___libc_free (mem=mem@entry=0x7f8c50004c90)
at malloc.c:2968
ar_ptr =
p = 0x7f8c50004c80
hook =
#6 0x00007f8c5bbc3ffc in MHD_destroy_post_processor (pp=0x7f8c50004c90)
at postprocessor.c:1278
ret = 0
#7 0x00007f8c5c9cee90 in mhd_request_completed ()
from /usr/local/lib/libulfius.so.1.1
No symbol table info available.
#8 0x00007f8c5bbb584c in MHD_connection_close
(connection=0x7f8c54010f20,
termination_code=MHD_REQUEST_TERMINATED_CLIENT_ABORT) at connection.c:950
daemon = 0x215b2c0
resp = 0x0
#9 0x00007f8c5bbb9299 in call_handlers (con=con@entry=0x7f8c54010f20,
read_ready=, write_ready=write_ready@entry=false,
force_close=force_close@entry=false) at daemon.c:1112
ret =
states_info_processed = false
on_fasttrack =
#10 0x00007f8c5bbbc7e8 in thread_main_handle_connection (data=0x7f8c54010f20)
at daemon.c:1965
err_state = false
timeout =
urh =
con = 0x7f8c54010f20
daemon = 0x215b2c0
num_ready =
rs = {fds_bits = {64, 0 <repeats 15 times>}}
ws = {fds_bits = {0 <repeats 16 times>}}
es = {fds_bits = {0 <repeats 16 times>}}
maxsock = 6
tv = {tv_sec = 140240547212308, tv_usec = 140240547212512}
tvp =
---Type to continue, or q to quit---
now =
p = {{fd = 20, events = 0, revents = 0}}
use_poll = false
was_suspended = false
#11 0x00007f8c5c3aa6ba in start_thread (arg=0x7f8c4bfff700) at pthread_create.c:333
__res =
pd = 0x7f8c4bfff700
now =
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140240547215104, -2954216517296733425, 0, 140240781949599, 8388608, 140240681538096, 2889081447915701007, 2889124923418460943},
mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call =
pagesize_m1 =
sp =
freesize =
PRETTY_FUNCTION = "start_thread"

HTTPS support?

I have been recently searching for a small REST implementation preferably coded in C, and this one looks promising. It looks like it supports everything I need, and as it uses libmicrohttpd, I suppose it also supports HTTPS.

But I have not been able to find information about how to use HTTPS with ulfius. Is it supported? If affirmative, are there any examples or directions I can follow to get HTTPS working with ulfius?

General discussion about Ulfius and its next features

Hi dudes.

Please sorry if it was an irrelevant sharing, but I've shared Ulfius at MHD's list in a topic regarding GSoC (Google Summer of Code):

http://lists.gnu.org/archive/html/libmicrohttpd/2018-01/msg00006.html

IMHO, Ulfius is the best and prepared project using MHD that should be presented in that event, and it is very easy to learn too.

I'm not familiar with GSoCs because I've never participated one, but I think that anything shown in these Google events get its ecosystem growing more and more.

Thank you!

Adding large file upload support - improve file upload

I'm currently using ulfius in an embedded project. We need to upload large files, but that doesn't appear to be currently implemented in ulflus. I was thinking I would modify ulfius to mplementing a stream reading handler, sort of the reverse of the ulfius_set_stream_response. Before I do that, I wanted to make sure I'm not reinventing the wheel and that I conform to any design or naming standards you have in case you would like to merge it back into your tree. Let me know if you have any questions or suggestions.

Thanks,

Thad Phetteplace
Software Engineer
GLACI, Inc.

Duplicate header keys

Thanks for your previous quick response. I have a problem that may actually be in the curl libraries.

A response to a post returns several header values including to values with the same key. I get a seesion key and an xrsf key with the header key string "Set-Cookie". According to the Wireshark traces both these key value pairs are present in the response, but an enumeration from the response returned by Ulfius appears to overwrite the first value with the second and show only that value in the list. When I call PrintResponse(&Response); from your example code, for example, I get a list with one fewer value than was actually sent, and the value of the repeated key is only the second one that was transmitted.

I followed this problem down into your code, but it looks like you are just setting the curl opts and using the returned list. I'm betting you are more familiar with those calls than I am, so I decided to open this issue.

Streaming with websocket

Hi,

I face some streaming issues using the websocket feature.
In my project, I stream audio files (Wav, 44100kHz, 16b = a lot of data).
I have sized the buffer load of the websocket to 1024Bytes and use a javascript interface as a client, to send these sample buffer to my application via ulfius websocket interface.

It's a lot of data to stream, and usually (in less than 2sec), some websocket bytes are missing on ulfius side.
In the function ulfius_read_incoming_message, I get incoherent values (message length, mask, opcode...). And that mess completely the streaming.
Playing with your code, I tried to force a lot of things like waiting for 1024 data byte each time to be delivered, checking using "poll".. but it's not enough.
I also checked that my client webpage doesn't saturate the bus, putting some sleeping time before each websocket send message, didn't worked either.

I am now completely lost and I don't know what else to test or fix.

Could you help me please?¨
Please let me know if you need further information.

Michael

Segmentation Fault on MHD-connection

Hello
thank you for such a helpful framework , I love how you made it so easy for users 👍
sometimes i get segmentation fault on my program that is related to ulfius i backtraced the core dump for your info below .can you please tell me or show me a way to avoid the fault. thanks

Thread 4 (Thread 0x7f3411145700 (LWP 46903)):
#0 0x00007f3412d575d3 in select () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007f3412a4a7eb in MHD_select (daemon=0x2517260, may_block=)
at daemon.c:3498
#2 0x00007f3412a4ab15 in MHD_polling_thread (cls=0x2517260) at daemon.c:4430
#3 0x00007f34132366ba in start_thread (arg=0x7f3411145700) at pthread_create.c:333
#4 0x00007f3412d6141d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f3413c78700 (LWP 46577)):
#0 0x00007f3412d2630d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007f3412d57d94 in usleep (useconds=) at ../sysdeps/posix/usleep.c:32
#2 0x0000000000408eb8 in ?? ()
#3 0x00007f3412c7a830 in __libc_start_main (main=0x4079c2, argc=1, argv=0x7fff5b4eea18,
init=, fini=, rtld_fini=,
stack_end=0x7fff5b4eea08) at ../csu/libc-start.c:291
#4 0x00000000004021a9 in ?? ()

Thread 2 (Thread 0x7f340bfff700 (LWP 48824)):
#0 0x00007f3412d575d3 in select () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007f3412a48732 in thread_main_handle_connection (data=0x7f340c008c00)
at daemon.c:1937
#2 0x00007f34132366ba in start_thread (arg=0x7f340bfff700) at pthread_create.c:333
#3 0x00007f3412d6141d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f3410944700 (LWP 49305)):
#0 _GI___libc_free (mem=0x50) at malloc.c:2951
#1 0x00007f3413859a24 in u_map_clean () from /usr/local/lib/libulfius.so
#2 0x00007f3413857798 in mhd_request_completed () from /usr/local/lib/libulfius.so
#3 0x00007f3412a4184c in MHD_connection_close
(
connection=connection@entry=0x7f340c0008c0,
termination_code=termination_code@entry=MHD_REQUEST_TERMINATED_WITH_ERROR)
at connection.c:950
#4 0x00007f3412a41934 in connection_close_error (
emsg=0x7f3412a52648 "Received malformed line (no colon). Closing connection.\n",
connection=0x7f340c0008c0) at connection.c:1042
#5 process_header_line (connection=connection@entry=0x7f340c0008c0,
line=0x7f340c000aef "\367", <incomplete sequence \365>) at connection.c:2572
#6 0x00007f3412a43f11 in MHD_connection_handle_idle (
connection=connection@entry=0x7f340c0008c0) at connection.c:3315
#7 0x00007f3412a452a1 in call_handlers (con=con@entry=0x7f340c0008c0,
read_ready=, write_ready=write_ready@entry=false,
force_close=force_close@entry=false) at daemon.c:1113
#8 0x00007f3412a487e8 in thread_main_handle_connection (data=0x7f340c0008c0)
at daemon.c:1965
#9 0x00007f34132366ba in start_thread (arg=0x7f3410944700) at pthread_create.c:333
#10 0x00007f3412d6141d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Unable to install in CentOS 7

Hello,

I am unable to build ulfius in CentOS 7 - using the makefile directions, I've installed Orcania, but yder fails to install with the following output:

cd ./src && make make[1]: Entering directory /REDACTED/ulfius/lib/yder/src'
gcc -shared -Wl,-soname,libyder.so -o libyder.so.1.2.1 yder.o -lc -lorcania
/usr/bin/ld: cannot find -lorcania
collect2: error: ld returned 1 exit status
make[1]: *** [libyder.so] Error 1
make[1]: Leaving directory /REDACTED/ulfius/lib/yder/src' make: *** [libyder.so] Error 2

I'm building as root on a CI server - does this require that you build as a nonroot user?

won't build as per instructions

I've followed the instructions to build from source, but the code fails in orcania.c:

make[1]: Entering directory `/work/ulfius/lib/orcania'
gcc -c -fPIC -Wall -D_REENTRANT -O3 orcania.c
orcania.c: In function 'trimwhitespace':
orcania.c:382:3: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
while(isspace((unsigned char)*str)) str++;
^

Different make failure on a separate jessie install

Pi Specs:

ARMv7 Processor rev 5 (v7l)
Raspbian GNU/Linux 8.0 (jessie),
Linux version 4.4.41-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #942 SMP Mon Jan 9 15:00:25 GMT 2017

It doesn't matter which example I choose:

'$ make test
cd ../../src && make debug
make[1]: Entering directory '/home/pi/ulfius/src'
gcc -c -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../lib/orcania -I../lib/yder/src -DDEBUG -g -O0 ulfius.c
In file included from ulfius.c:27:0:
ulfius.h:30:24: fatal error: microhttpd.h: No such file or directory
#include <microhttpd.h>
^
compilation terminated.
Makefile:41: recipe for target 'ulfius.o' failed
make[1]: *** [ulfius.o] Error 1
make[1]: Leaving directory '/home/pi/ulfius/src'
Makefile:32: recipe for target 'libulfius.so' failed
make: *** [libulfius.so] Error 2
'

Does this mean I have to install microhttpd or (microhttpd-dev?) separately?

request_example autoinitialization

Great stuff! I'm liking you code.

I built the request_example on a Raspberry Pi 2b running their raspbian jesse and got mostly nulls displayed in both the client and server consoles. On the two json tests the client segfaulted. There were warnings on the compile (which I ignored) so I built it on ubuntu 16.04 lts as a verification and had the same problems.

Rolling up my sleeves, I looked at the warnings (like I should have in the first place), made the following change to the client.c code at about line 86, and it cleaned it right up. The original was missing a zero value for each check_server_certificate or timeout, depending on how you look at it.

/* DMerrell 5/17/17 - Autoinitialization doesn't match definition. Added check_server_certificate=0.

struct _u_request req_list[] = {
{"GET", SERVER_URL_PREFIX "/get/", 0, NULL, NULL, NULL, &url_params, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0}, // Parameters in url
{"DELETE", SERVER_URL_PREFIX "/delete/", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0}, // No parameters
{"POST", SERVER_URL_PREFIX "/post/param/", 0, NULL, NULL, NULL, NULL, NULL, NULL, &post_params, NULL, NULL, 0, string_body, strlen(string_body)}, // Parameters in post_map and string_body
{"POST", SERVER_URL_PREFIX "/post/plain/", 0, NULL, NULL, NULL, NULL, &req_headers, NULL, NULL, NULL, NULL, 0, string_body, strlen(string_body)}, // Paremeters in string body, header MHD_HTTP_POST_ENCODING_FORM_URLENCODED
{"POST", SERVER_URL_PREFIX "/post/json/", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, json_body, NULL, 0, NULL, 0}, // Parameters in json_body
{"PUT", SERVER_URL_PREFIX "/put/plain", 0, NULL, NULL, NULL, NULL, &req_headers, NULL, NULL, NULL, NULL, 0, string_body, strlen(string_body)}, // Paremeters in string body, header MHD_HTTP_POST_ENCODING_FORM_URLENCODED
{"PUT", SERVER_URL_PREFIX "/put/json", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, json_body, NULL, 0, NULL, 0}, // Parameters in json_body
{"POST", SERVER_URL_PREFIX "/post/param/", 0, NULL, NULL, NULL, NULL, NULL, NULL, &post_params, NULL, NULL, 0, NULL, 0} // Parameters in post_map
};
*/
struct _u_request req_list[] = {
{"GET", SERVER_URL_PREFIX "/get/", 0, 0, NULL, NULL, NULL, &url_params, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0}, // Parameters in url
{"DELETE", SERVER_URL_PREFIX "/delete/", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0}, // No parameters
{"POST", SERVER_URL_PREFIX "/post/param/", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, &post_params, NULL, NULL, 0, string_body, strlen(string_body)}, // Parameters in post_map and string_body
{"POST", SERVER_URL_PREFIX "/post/plain/", 0, 0, NULL, NULL, NULL, NULL, &req_headers, NULL, NULL, NULL, NULL, 0, string_body, strlen(string_body)}, // Paremeters in string body, header MHD_HTTP_POST_ENCODING_FORM_URLENCODED
{"POST", SERVER_URL_PREFIX "/post/json/", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, json_body, NULL, 0, NULL, 0}, // Parameters in json_body
{"PUT", SERVER_URL_PREFIX "/put/plain", 0, 0, NULL, NULL, NULL, NULL, &req_headers, NULL, NULL, NULL, NULL, 0, string_body, strlen(string_body)}, // Paremeters in string body, header MHD_HTTP_POST_ENCODING_FORM_URLENCODED
{"PUT", SERVER_URL_PREFIX "/put/json", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, json_body, NULL, 0, NULL, 0}, // Parameters in json_body
{"POST", SERVER_URL_PREFIX "/post/param/", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, &post_params, NULL, NULL, 0, NULL, 0} // Parameters in post_map
};

Proxy

Bonjour,

J'utilise en ce moment Ulfius et il est très pratique, un petit bijou qui m'a éviter de perdre beaucoup de temps à chercher une solution pour faire une simple requête JSON sur un WebService.
Seulement je me vois confronter à un problème, lorsque mon code sera mise en production il faudra passer par un proxy et je n'ai rien trouvé sur ce sujet dans l'API.
Serais je passé à coté? Est-ce qu'il y a une solution de prévu que je n'aurais pas vu?

Cordialement

memory issue with websocket example

Hi Nicolas,

In the websocket example, when the websocket is created, we give user data:
"char * websocket_user_data = "my_user_data";"
But when this data is read in the callback functions, the 4 firsts bytes have been overwritten.

I managed to solve this issue, declaring the variable websocket_user_data as a global variable (getting it out of the function).

For your information, I work on an arm target. So this may come from my compiler.

Thank you for your work.

After install

Following the the steps in INSTALL.md on my raspberry pi (specs at the end of this issue), when I run make, I get an error (see below) that looks like maybe jansson wasn't installed correctly (although it appears to be, at /usr/share/doc/libjansson4/).

I thought at first it was because I had done the apt-get of the dependencies with sudo instead of as root. So I did remove, then su'ed to root, then did the apt-get again and exited. Make still gave me the error:

$ make cd lib/orcania && make make[1]: Entering directory '/home/pi/ulfius/lib/orcania' gcc -c -fPIC -Wall -D_REENTRANT -O3 orcania.c orcania.c: In function ‘json_search’: orcania.c:273:5: warning: implicit declaration of function ‘json_array_foreach’ [-Wimplicit-function-declaration] orcania.c:273:49: error: expected ‘;’ before ‘{’ token Makefile:35: recipe for target 'orcania.o' failed make[1]: *** [orcania.o] Error 1 make[1]: Leaving directory '/home/pi/ulfius/lib/orcania' Makefile:45: recipe for target 'libulfius.so' failed make: *** [libulfius.so] Error 2

Debian GNU/Linux 7.11 (wheezy)
ARMv7 Processor rev 5 (v7l)
I've updated the firmware, and I've done sudo apt-get update and 'sudo apt-get upgrade' as well.

ulfius.c does not compile

I've followed the installation instructions, but at the last step, the compilation of ulfius.c fails:

vagrant@jessie:/ulfius$ make
cd ./src && make   
make[1]: Entering directory '/ulfius/src'
gcc -c -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../lib/orcania/src -I../lib/yder/src -O3    ulfius.c
ulfius.c: In function ‘ulfius_init_instance’:
ulfius.c:1155:65: error: dereferencing pointer to incomplete type
     ((struct _websocket_handler *)u_instance->websocket_handler)->pthread_init = 1;
                                                                 ^
Makefile:50: recipe for target 'ulfius.o' failed
make[1]: *** [ulfius.o] Error 1
make[1]: Leaving directory '/ulfius/src'
Makefile:53: recipe for target 'libulfius.so' failed
make: *** [libulfius.so] Error 2


I can compile when I checkout the 2.0.1 tag, so it seems to be a problem in the current master branch. I'm running on Debian Jessie, with

$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Please let me know if you need more information! For reproducibility, you can use the provided Vagrantfile. For the full log of what I did after git submodule update --init:

vagrant@jessie:/ulfius$ cd lib/orcania/
vagrant@jessie:/ulfius/lib/orcania$ make
cd ./src && make
make[1]: Entering directory '/ulfius/lib/orcania/src'
gcc -c -fPIC -Wall -D_REENTRANT -O3  orcania.c
gcc -shared -Wl,-soname,liborcania.so -o liborcania.so.1.1 orcania.o memory.o base64.o -lc -ljansson
ln -sf liborcania.so.1.1 liborcania.so
make[1]: Leaving directory '/ulfius/lib/orcania/src'
vagrant@jessie:/ulfius/lib/orcania$ sudo make install
cd ./src && make install
make[1]: Entering directory '/ulfius/lib/orcania/src'
cp liborcania.so.1.1 /usr/local/lib
cp orcania.h /usr/local/include
/sbin/ldconfig
make[1]: Leaving directory '/ulfius/lib/orcania/src'
vagrant@jessie:/ulfius/lib/orcania$ cd ../yder/
vagrant@jessie:/ulfius/lib/yder$ make
cd ./src && make
make[1]: Entering directory '/ulfius/lib/yder/src'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/ulfius/lib/yder/src'
vagrant@jessie:/ulfius/lib/yder$ sudo make install
cd ./src && make install
make[1]: Entering directory '/ulfius/lib/yder/src'
cp libyder.so.2.0 /usr/local/lib
cp yder.h /usr/local/include
/sbin/ldconfig
make[1]: Leaving directory '/ulfius/lib/yder/src'
vagrant@jessie:/ulfius/lib/yder$ cd ../../
vagrant@jessie:/ulfius$ make
cd ./src && make   
make[1]: Entering directory '/ulfius/src'
gcc -c -fPIC -Wall -D_REENTRANT -I/usr/local/include -I../lib/orcania/src -I../lib/yder/src -O3    ulfius.c
ulfius.c: In function ‘ulfius_init_instance’:
ulfius.c:1155:65: error: dereferencing pointer to incomplete type
     ((struct _websocket_handler *)u_instance->websocket_handler)->pthread_init = 1;
                                                                 ^
Makefile:50: recipe for target 'ulfius.o' failed
make[1]: *** [ulfius.o] Error 1
make[1]: Leaving directory '/ulfius/src'
Makefile:53: recipe for target 'libulfius.so' failed
make: *** [libulfius.so] Error 2

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
  config.vm.box = "debian/jessie64"
  config.vm.synced_folder ".", "/ulfius", type: 'virtualbox'
  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    apt-get install -y libmicrohttpd-dev libjansson-dev libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev
  SHELL
end

confusing static lib name

Hello (.*),

Currently, I'm testing ulfius if it is usable for my project. But before, I need to port it to OpenWrt.
During my first steps I tried to fast build a usable static lib. After the build, my static lib was named `liblibulfius.a' which is a bit confusing.

The problematic line in CMakeLists.txt:
set_target_properties(ulfius_static PROPERTIES OUTPUT_NAME libulfius)

On Unix/Linux CMAKE_SHARED_LIBRARY_PREFIX_lang defaults to `lib'.

So replacing
set_target_properties(ulfius_static PROPERTIES OUTPUT_NAME libulfius)
with
set_target_properties(ulfius_static PROPERTIES OUTPUT_NAME ulfius)
should do the job.

After the first look I'm quite optimistic that it will be usable for my project.

Need better JSON example

Really could use a simple, isolated example of proper JSON handling from within callback routines. Unclear which data structures need to be dereferenced in the call back routine itself and which data structures should not be dereferenced because you're in a callback routine and they are de-referenced elsewhere.

A simple client.c and server.c in which the client formulates a JSON message to send to the server and the server decomposes it into key-value pairs would probably do it. Extra credit if the server response builds a JSON response and the client does the same with the response.

....or point me to a minimalist example elsewhere.

The intended data structure life-cycle is not clearly documented. The API lists the calls but doesn't explain very well how they should be ordered.

reference git submodules

Hey,
i tried to use your project ulfius at commit 62f71b9
this project looks very nice !
but i get a error while init the submodules.

could it be that the url in the .gitmodules file
[email protected]:babelouest/orcania.git
should look like:
https://github.com/babelouest/orcania.git ?
so the whole .gitmodules file:
[submodule "lib/orcania"]
path = lib/orcania
url = https://github.com/babelouest/orcania.git
[submodule "lib/yder"]
path = lib/yder
url = https://github.com/babelouest/yder.git

Could you might double check this ?

Also i use usually to checkout the submodules the follwoing commands:
git submodule init
git submodule update

afterwards everything compiles fantastic

thanks
heissenschorse

ulfius can't listen to the specific address

start ulfius framewrok as follows:
struct sockaddr_in sa4p;
char host = "192.168.1.1";
int port = 8043;
memset(&sa4p,0,sizeof(sa4p));
sa4p.sin_family = AF_INET;
sa4p.sin_port = htons(port);
sa4p.sin_addr.s_addr = inet_addr(host);
ulfius_init_instance(&instance, port, &sa4p)
then netstat -na, can't listen 192.168.1.1:8043,always 0.0.0.0:8043,
/logs # netstat -na
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8043 0.0.0.0:
LISTEN

I modify it like this:
struct MHD_Daemon * ulfius_run_mhd_daemon(struct _u_instance * u_instance, const char * key_pem, const char * cert_pem)
...
mhd_ops[1].option = MHD_OPTION_SOCK_ADDR;
//mhd_ops[1].value = (intptr_t)u_instance->bind_address;
//mhd_ops[1].ptr_value = NULL;
mhd_ops[1].value = 0;
mhd_ops[1].ptr_value = (void *)u_instance->bind_address;
...
the function works.

Websocket opcode question

Hi,

Is it normal that both text and binary opcode for websocket has the same value?

#define U_WEBSOCKET_OPCODE_TEXT 0x01 #define U_WEBSOCKET_OPCODE_BINARY 0x01

Best regards,

Michael

Sheep example - POST not working properly?

In the sheep example, the PUT behaves the way I expect, incrementing nbsheep and returning JSON like:

{ "nbsheep": 4 }

The POST, however, doesn't seem to. When I send a POST with a payload like:
{ "nbsheep": 6 }
returns this JSON:
{ "nbsheep": 0 }

If, after line 157 in sheep_counter.c, I put printf("json_body = %s\n", request->json_body); and send the POST again, it tells me that the request->json_body is null, which would explain why I don't get a value back in the response.
If I assign a constant value into *nb_sheep after the if/else block, and do another POST, the constant value is returned, as expected, in the JSON response.

ulfius_get_json_body_response doesn't response json

hello ,
After calling ulfius_get_json_body_response, json cannot be returned. The code is as follows:
ulfius_init_response(&response);
res = ulfius_send_http_request(&req_list[0], &response);
if (res == U_OK) {
print_response(&response);
//json_body = ulfius_get_json_body_response(&response, &json_error);
printf("JSON String========: %c \n", ulfius_get_json_body_response(&response, &json_error));
} else {
printf("Error in http request: %d\n", res);
}
ulfius_clean_response(&response);

Ulfius is now available in AUR for Archlinux

Hi!
Thanks for this awesome piece of work! I still haven't got time to dig into the implementation, but the API is really great!
I recently pushed a package to the AUR for Archlinux with your latest release, you can find it here: https://aur.archlinux.org/packages/libulfius/ .
So you can add Arch to the list of supported OS!
I'd like to ask you about orcania and yder though: must they be forcedly built? I mean, i am having some issues initing git submodules from a github release tarball, so i wonder whether these 2 submodules are really mandatory and what i'd miss if i do not package them.

Again, thank you very much!

general question

I'm comparing ulfius to openwrt's uhttpd+cgi model, just curious, what's the benefit of using ulfius when you have many lightweight httpd server available(there are many) plus cgi/fcgi support, won't them do the simple task ulfius designed to do with small footprint too? or am I missing something here.

on the other hand, for simple webservice you have libonion and kore to use, how does ulfius compare to them?

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.