[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r36227 - libmicrohttpd/src/microhttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r36227 - libmicrohttpd/src/microhttpd |
Date: |
Sat, 8 Aug 2015 14:29:28 +0200 |
Author: Karlson2k
Date: 2015-08-08 14:29:28 +0200 (Sat, 08 Aug 2015)
New Revision: 36227
Modified:
libmicrohttpd/src/microhttpd/connection.c
Log:
connection.c: try_ready_chunked_body(): refactoring for optimization and clarity
Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c 2015-08-08 12:29:20 UTC (rev
36226)
+++ libmicrohttpd/src/microhttpd/connection.c 2015-08-08 12:29:28 UTC (rev
36227)
@@ -429,7 +429,9 @@
connection->write_buffer = buf;
}
- if ( (response->data_start <=
+ if (0 == response->total_size)
+ ret = 0; /* response must be empty, don't bother calling crc */
+ else if ( (response->data_start <=
connection->response_write_position) &&
(response->data_size + response->data_start >
connection->response_write_position) )
@@ -446,13 +448,10 @@
else
{
/* buffer not in range, try to fill it */
- if (0 == response->total_size)
- ret = 0; /* response must be empty, don't bother calling crc */
- else
- ret = response->crc (response->crc_cls,
- connection->response_write_position,
- &connection->write_buffer[sizeof (cbuf)],
- connection->write_buffer_size - sizeof (cbuf) - 2);
+ ret = response->crc (response->crc_cls,
+ connection->response_write_position,
+ &connection->write_buffer[sizeof (cbuf)],
+ connection->write_buffer_size - sizeof (cbuf) - 2);
}
if ( ((ssize_t) MHD_CONTENT_READER_END_WITH_ERROR) == ret)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r36227 - libmicrohttpd/src/microhttpd,
gnunet <=