[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8817 - in libmicrohttpd: . src/daemon
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8817 - in libmicrohttpd: . src/daemon |
Date: |
Mon, 3 Aug 2009 16:21:34 -0600 |
Author: grothoff
Date: 2009-08-03 16:21:33 -0600 (Mon, 03 Aug 2009)
New Revision: 8817
Modified:
libmicrohttpd/ChangeLog
libmicrohttpd/src/daemon/connection.c
Log:
fixing double-read issue
Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog 2009-07-30 20:29:55 UTC (rev 8816)
+++ libmicrohttpd/ChangeLog 2009-08-03 22:21:33 UTC (rev 8817)
@@ -1,3 +1,13 @@
+Tue Aug 4 00:14:04 CEST 2009
+ Fixing double-call to read from content-reader callback for first
+ data segment (as reported by Alex on the mailinglist). -CG
+
+Thu Jul 29 21:41:52 CEST 2009
+ Fixed issue with the code not using the "block_size" argument
+ given to MHD_create_response_from_callback causing inefficiencies
+ for values < 2048 and segmentation faults for values > 2048
+ (as reported by Andre Colomb on the mailinglist). -CG
+
Sun May 17 03:29:46 MDT 2009
Releasing libmicrohttpd 0.4.2. -CG
Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c 2009-07-30 20:29:55 UTC (rev
8816)
+++ libmicrohttpd/src/daemon/connection.c 2009-08-03 22:21:33 UTC (rev
8817)
@@ -328,6 +328,11 @@
response = connection->response;
if (response->crc == NULL)
return MHD_YES;
+ if ( (response->data_start <=
+ connection->response_write_position) &&
+ (response->data_size + response->data_start >
+ connection->response_write_position) )
+ return MHD_YES; /* response already ready */
ret = response->crc (response->crc_cls,
connection->response_write_position,
response->data,
@@ -402,10 +407,27 @@
connection->write_buffer = buf;
}
- ret = response->crc (response->crc_cls,
- connection->response_write_position,
- &connection->write_buffer[sizeof (cbuf)],
- connection->write_buffer_size - sizeof (cbuf) - 2);
+ if ( (response->data_start <=
+ connection->response_write_position) &&
+ (response->data_size + response->data_start >
+ connection->response_write_position) )
+ {
+ /* buffer already ready, use what is there for the chunk */
+ ret = response->data_size + response->data_start -
connection->response_write_position;
+ if (ret > connection->write_buffer_size - sizeof (cbuf) - 2)
+ ret = connection->write_buffer_size - sizeof (cbuf) - 2;
+ memcpy (&connection->write_buffer[sizeof (cbuf)],
+ &response->data[connection->response_write_position -
response->data_start],
+ ret);
+ }
+ else
+ {
+ /* buffer not in range, try to fill it */
+ ret = response->crc (response->crc_cls,
+ connection->response_write_position,
+ &connection->write_buffer[sizeof (cbuf)],
+ connection->write_buffer_size - sizeof (cbuf) - 2);
+ }
if (ret == -1)
{
/* end of message, signal other side! */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8817 - in libmicrohttpd: . src/daemon,
gnunet <=