X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=uclient-backend.h;h=c2b9fd538189e2c4a96240bb7bae159031abd3eb;hb=refs%2Fheads%2Fmaster;hp=a5cf4f3d392ab9fd5fa2a6510d49c0f6bcfb355b;hpb=29c798a52907b7ee28c8e001c99ceed65ebe5d39;p=project%2Fuclient.git diff --git a/uclient-backend.h b/uclient-backend.h index a5cf4f3..1b808ac 100644 --- a/uclient-backend.h +++ b/uclient-backend.h @@ -25,6 +25,7 @@ struct uclient_backend { struct uclient *(*alloc)(void); void (*free)(struct uclient *cl); + void (*update_proxy_url)(struct uclient *cl); void (*update_url)(struct uclient *cl); int (*connect)(struct uclient *cl); @@ -32,12 +33,18 @@ struct uclient_backend { void (*disconnect)(struct uclient *cl); int (*read)(struct uclient *cl, char *buf, unsigned int len); - int (*write)(struct uclient *cl, char *buf, unsigned int len); + int (*write)(struct uclient *cl, const char *buf, unsigned int len); + int (*pending_bytes)(struct uclient *cl, bool write); }; void uclient_backend_set_error(struct uclient *cl, int code); void uclient_backend_set_eof(struct uclient *cl); void uclient_backend_reset_state(struct uclient *cl); struct uclient_url *uclient_get_url(const char *url_str, const char *auth_str); +struct uclient_url *uclient_get_url_location(struct uclient_url *url, const char *location); +static inline void uclient_backend_read_notify(struct uclient *cl) +{ + uloop_timeout_set(&cl->read_notify, 1); +} #endif