Compilation optimisation
Do not compile the code related to the webserver in http_SendMessage when --disable-webserver is set
This commit is contained in:
@@ -2,6 +2,12 @@
|
|||||||
Version 1.6.18
|
Version 1.6.18
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
|
2012-04-03 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
|
||||||
|
|
||||||
|
Compilation optimisation
|
||||||
|
|
||||||
|
Do not compile the code related to the webserver in http_SendMessage
|
||||||
|
when --disable-webserver is set
|
||||||
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
Version 1.6.17
|
Version 1.6.17
|
||||||
|
@@ -363,27 +363,32 @@ ExitFunction:
|
|||||||
|
|
||||||
int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
|
int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
#if EXCLUDE_WEB_SERVER == 0
|
||||||
FILE *Fp;
|
FILE *Fp;
|
||||||
va_list argp;
|
|
||||||
struct SendInstruction *Instr = NULL;
|
struct SendInstruction *Instr = NULL;
|
||||||
char *buf = NULL;
|
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
char *file_buf = NULL;
|
char *file_buf = NULL;
|
||||||
char *ChunkBuf = NULL;
|
char *ChunkBuf = NULL;
|
||||||
|
/* 10 byte allocated for chunk header. */
|
||||||
char Chunk_Header[CHUNK_HEADER_SIZE];
|
char Chunk_Header[CHUNK_HEADER_SIZE];
|
||||||
|
size_t num_read;
|
||||||
|
size_t amount_to_be_read = (size_t)0;
|
||||||
|
size_t Data_Buf_Size = WEB_SERVER_BUF_SIZE;
|
||||||
|
#endif /* EXCLUDE_WEB_SERVER */
|
||||||
|
va_list argp;
|
||||||
|
char *buf = NULL;
|
||||||
char c;
|
char c;
|
||||||
int nw;
|
int nw;
|
||||||
int RetVal = 0;
|
int RetVal = 0;
|
||||||
size_t buf_length;
|
size_t buf_length;
|
||||||
size_t num_read;
|
|
||||||
size_t num_written;
|
size_t num_written;
|
||||||
size_t amount_to_be_read = (size_t)0;
|
|
||||||
/* 10 byte allocated for chunk header. */
|
|
||||||
size_t Data_Buf_Size = WEB_SERVER_BUF_SIZE;
|
|
||||||
|
|
||||||
|
#if EXCLUDE_WEB_SERVER == 0
|
||||||
memset(Chunk_Header, 0, sizeof(Chunk_Header));
|
memset(Chunk_Header, 0, sizeof(Chunk_Header));
|
||||||
|
#endif /* EXCLUDE_WEB_SERVER */
|
||||||
va_start(argp, fmt);
|
va_start(argp, fmt);
|
||||||
while ((c = *fmt++)) {
|
while ((c = *fmt++)) {
|
||||||
|
#if EXCLUDE_WEB_SERVER == 0
|
||||||
if (c == 'I') {
|
if (c == 'I') {
|
||||||
Instr = va_arg(argp, struct SendInstruction *);
|
Instr = va_arg(argp, struct SendInstruction *);
|
||||||
if (Instr->ReadSendSize >= 0)
|
if (Instr->ReadSendSize >= 0)
|
||||||
@@ -505,7 +510,9 @@ Cleanup_File:
|
|||||||
fclose(Fp);
|
fclose(Fp);
|
||||||
}
|
}
|
||||||
goto ExitFunction;
|
goto ExitFunction;
|
||||||
} else if (c == 'b') {
|
} else
|
||||||
|
#endif /* EXCLUDE_WEB_SERVER */
|
||||||
|
if (c == 'b') {
|
||||||
/* memory buffer */
|
/* memory buffer */
|
||||||
buf = va_arg(argp, char *);
|
buf = va_arg(argp, char *);
|
||||||
buf_length = va_arg(argp, size_t);
|
buf_length = va_arg(argp, size_t);
|
||||||
@@ -527,7 +534,9 @@ Cleanup_File:
|
|||||||
|
|
||||||
ExitFunction:
|
ExitFunction:
|
||||||
va_end(argp);
|
va_end(argp);
|
||||||
|
#if EXCLUDE_WEB_SERVER == 0
|
||||||
free(ChunkBuf);
|
free(ChunkBuf);
|
||||||
|
#endif /* EXCLUDE_WEB_SERVER */
|
||||||
return RetVal;
|
return RetVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user