diff --git a/programs/develop/ktcc/trunk/bin/lib/libhttp.a b/programs/develop/ktcc/trunk/bin/lib/libhttp.a index 79abba8e76..80fdce442a 100644 Binary files a/programs/develop/ktcc/trunk/bin/lib/libhttp.a and b/programs/develop/ktcc/trunk/bin/lib/libhttp.a differ diff --git a/programs/develop/ktcc/trunk/lib/http/Makefile b/programs/develop/ktcc/trunk/lib/http/Makefile index 3b3ba744b2..8cdf824dac 100644 --- a/programs/develop/ktcc/trunk/lib/http/Makefile +++ b/programs/develop/ktcc/trunk/lib/http/Makefile @@ -1,6 +1,6 @@ FASM = fasm -OBJS = get.o head.o __lib__.o post.o receive.o send.o +OBJS = get.o head.o __lib__.o post.o receive.o send.o free.o %.o : %.asm $(FASM) $< diff --git a/programs/develop/ktcc/trunk/lib/http/free.asm b/programs/develop/ktcc/trunk/lib/http/free.asm new file mode 100644 index 0000000000..77e7ee108e --- /dev/null +++ b/programs/develop/ktcc/trunk/lib/http/free.asm @@ -0,0 +1,18 @@ +format ELF + +include "__lib__.inc" + +fun equ http_free +fun_str equ 'free' + +section '.text' + +fun_name db fun_str, 0 + +section '.data' + +extrn lib_name +public fun + +fun dd fun_name +lib dd lib_name diff --git a/programs/develop/ktcc/trunk/libc/include/clayer/http.h b/programs/develop/ktcc/trunk/libc/include/clayer/http.h index e8452a61ae..ac296576e3 100644 --- a/programs/develop/ktcc/trunk/libc/include/clayer/http.h +++ b/programs/develop/ktcc/trunk/libc/include/clayer/http.h @@ -54,6 +54,7 @@ If however, you want to receive multiple files, or do other things in the progra You may use system function 10 or 23 to wait for network event before calling one or more receive() functions. */ +#pragma pack(push,1) typedef struct http_msg_s { unsigned socket; // socket on which the actual transfer happens unsigned flags; // flags, reflects status of the transfer using bitflags @@ -68,6 +69,7 @@ typedef struct http_msg_s { unsigned content_received; // number of currently received content bytes char * http_header; } http_msg; +#pragma pack(pop) /* url = pointer to ASCIIZ URL @@ -140,6 +142,12 @@ extern int stdcall (*http_send)(http_msg *identifier, void *dataptr, unsigned da /* Sometimes the http_receive function receives incomplete data. If you have the same problem then a macro can help you: */ + +extern int stdcall (*http_free)(http_msg *identifier); +/* + Free unused data +*/ + #define http_long_receive(x) while(http_receive(x)){}; #endif // _HTTP_H_