Skip to content

Commit

Permalink
Bump to 4.0 version.
Browse files Browse the repository at this point in the history
Added multi-thread support with httpmt functions and http_ctx.
  • Loading branch information
alimon committed Oct 13, 2013
1 parent 9762991 commit cc2c62f
Show file tree
Hide file tree
Showing 5 changed files with 340 additions and 199 deletions.
8 changes: 3 additions & 5 deletions Makefile
Expand Up @@ -25,12 +25,10 @@ INCDIR=$(prefix)/include
# Your compiler
CC = gcc
# Compile flags
CDEBUGFLAGS = -O -Wmissing-prototypes -Wall -ansi -pedantic
#CDEBUGFLAGS = -O
CDEBUGFLAGS = -O -Wall # -g

# defines (needed for string ops on linux2/glibc for instance), remove
# _DEBUG for production:
DEFINES= -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE -D_DEBUG
# defines (needed for string ops on linux2/glibc for instance)
DEFINES= -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE #-D_DEBUG

# for HPUX (ansi)
#DEFINES= -D_HPUX_SOURCE
Expand Down
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -10,12 +10,13 @@ For support basic auth you should be implement your own
function for base64 encoding or use another one, see
http-basic-auth.c for example of implementation.

Added multi-thread support with functions httpmt.

- http\_post added
- http\_set\_basic\_auth added
- http_read_buffer_eof (GET/POST support for read body without Content length header field)
- httpmt\_\*.

TODO

- Making library thread-safe.
- Improve code style.
- Update manual pages.
3 changes: 2 additions & 1 deletion http.c
Expand Up @@ -138,6 +138,7 @@ int main(int argc,char* argv[])
ret=http_get(filename,&data,&lg,typebuf);
fprintf(stderr,"res=%d,type='%s',lg=%d\n",ret,typebuf,lg);
fwrite(data,lg,1,stdout);
fprintf(stderr, "%s\n", data);
break;
/* *** HEAD *** */
case DOHEA:
Expand All @@ -153,7 +154,7 @@ int main(int argc,char* argv[])
ret = http_post(filename, "your_name=1", 11, NULL, &data, &data_len, &type);
fprintf(stderr,"res=%d\n",ret);
fprintf(stderr,"%s\n", type);
fprintf(stderr,"%s\n", data);
fprintf(stderr,"data: %s\n", data);
break;
/* impossible... */
default:
Expand Down

0 comments on commit cc2c62f

Please sign in to comment.