content-length api: unsigned long to lws_filepos_t
This commit is contained in:
parent
393b38aed9
commit
37053b3a9c
2 changed files with 30 additions and 29 deletions
|
@ -96,13 +96,13 @@ lws_add_http_header_by_token(struct lws *wsi, enum lws_token_indexes token,
|
|||
}
|
||||
|
||||
int lws_add_http_header_content_length(struct lws *wsi,
|
||||
unsigned long content_length,
|
||||
lws_filepos_t content_length,
|
||||
unsigned char **p, unsigned char *end)
|
||||
{
|
||||
char b[24];
|
||||
int n;
|
||||
|
||||
n = sprintf(b, "%lu", content_length);
|
||||
n = sprintf(b, "%llu", (unsigned long long)content_length);
|
||||
if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH,
|
||||
(unsigned char *)b, n, p, end))
|
||||
return 1;
|
||||
|
|
|
@ -670,6 +670,33 @@ typedef int lws_filefd_type;
|
|||
#define LWS_POLLOUT (POLLOUT)
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__)
|
||||
/* ... */
|
||||
#if !defined(ssize_t)
|
||||
typedef SSIZE_T ssize_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LWS_HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
/* !!! >:-[ */
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
#else
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned char uint8_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef size_t lws_filepos_t;
|
||||
typedef ssize_t lws_fileofs_t;
|
||||
typedef uint32_t lws_fop_flags_t;
|
||||
|
||||
/** struct lws_pollargs - argument structure for all external poll related calls
|
||||
* passed in via 'in' */
|
||||
struct lws_pollargs {
|
||||
|
@ -3171,7 +3198,7 @@ lws_add_http_header_by_token(struct lws *wsi, enum lws_token_indexes token,
|
|||
*/
|
||||
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT
|
||||
lws_add_http_header_content_length(struct lws *wsi,
|
||||
unsigned long content_length,
|
||||
lws_filepos_t content_length,
|
||||
unsigned char **p, unsigned char *end);
|
||||
/**
|
||||
* lws_finalize_http_header() - terminate header block
|
||||
|
@ -4535,32 +4562,6 @@ lws_cgi_kill(struct lws *wsi);
|
|||
|
||||
struct lws_plat_file_ops;
|
||||
|
||||
#if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__)
|
||||
/* ... */
|
||||
#if !defined(ssize_t)
|
||||
typedef SSIZE_T ssize_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LWS_HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
/* !!! >:-[ */
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
#else
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned char uint8_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef size_t lws_filepos_t;
|
||||
typedef ssize_t lws_fileofs_t;
|
||||
typedef uint32_t lws_fop_flags_t;
|
||||
|
||||
struct lws_fop_fd {
|
||||
lws_filefd_type fd;
|
||||
/**< real file descriptor related to the file... */
|
||||
|
|
Loading…
Add table
Reference in a new issue