forked from KolibriOS/kolibrios
- Added http_free function to http.h (ktcc)
git-svn-id: svn://kolibrios.org@8558 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
abebbdd698
commit
26aceab675
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
FASM = fasm
|
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
|
%.o : %.asm
|
||||||
$(FASM) $<
|
$(FASM) $<
|
||||||
|
18
programs/develop/ktcc/trunk/lib/http/free.asm
Normal file
18
programs/develop/ktcc/trunk/lib/http/free.asm
Normal file
@ -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
|
@ -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.
|
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 {
|
typedef struct http_msg_s {
|
||||||
unsigned socket; // socket on which the actual transfer happens
|
unsigned socket; // socket on which the actual transfer happens
|
||||||
unsigned flags; // flags, reflects status of the transfer using bitflags
|
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
|
unsigned content_received; // number of currently received content bytes
|
||||||
char * http_header;
|
char * http_header;
|
||||||
} http_msg;
|
} http_msg;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
url = pointer to ASCIIZ URL
|
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:
|
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)){};
|
#define http_long_receive(x) while(http_receive(x)){};
|
||||||
|
|
||||||
#endif // _HTTP_H_
|
#endif // _HTTP_H_
|
||||||
|
Loading…
Reference in New Issue
Block a user