View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002607 | GNUnet | util library | public | 2012-11-01 17:36 | 2012-11-05 18:33 |
| Reporter | bratao | Assigned To | LRN | ||
| Priority | normal | Severity | major | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Platform | W32 | OS | Windows | OS Version | 8 |
| Product Version | Git master | ||||
| Target Version | 0.9.4 | Fixed in Version | 0.9.4 | ||
| Summary | 0002607: Optimize GNUNET_NETWORK_fdset_add for W32 | ||||
| Description | This function was responsible for 99% of the CPU usage on W32 (again) In Winsocks we dont care about nfds, so this code should be similar. Al the tests are passing. | ||||
| Tags | No tags attached. | ||||
| Attached Files | network.c.patch (947 bytes)
Index: network.c
===================================================================
--- network.c (revision 24639)
+++ network.c (working copy)
@@ -896,8 +896,9 @@
GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
const struct GNUNET_NETWORK_FDSet *src)
{
+#ifndef MINGW
int nfds;
-
+
for (nfds = src->nsds; nfds > 0; nfds--)
if (FD_ISSET (nfds, &src->sds))
@@ -906,7 +907,17 @@
if (nfds + 1 > dst->nsds)
dst->nsds = nfds + 1;
}
-#ifdef MINGW
+#else
+ int i;
+ /* Copy all the writes to the except, so we can detect connect() errors */
+ for (i = 0; i < src->sds.fd_count; i++)
+ {
+ if (src->sds.fd_array[i] != 0 && src->sds.fd_array[i] != -1)
+ FD_SET (src->sds.fd_array[i], &dst->sds);
+
+ if (src->nsds > dst->nsds)
+ dst->nsds = src->nsds;
+ }
GNUNET_CONTAINER_slist_append (dst->handles, src->handles);
#endif
}
| ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-11-01 17:36 | bratao | New Issue | |
| 2012-11-01 17:36 | bratao | File Added: network.c.patch | |
| 2012-11-02 00:40 | LRN | Note Added: 0006505 | |
| 2012-11-02 00:40 | LRN | Status | new => resolved |
| 2012-11-02 00:40 | LRN | Fixed in Version | => Git master |
| 2012-11-02 00:40 | LRN | Resolution | open => fixed |
| 2012-11-02 00:40 | LRN | Assigned To | => LRN |
| 2012-11-05 17:50 | Christian Grothoff | Fixed in Version | Git master => 0.9.4 |
| 2012-11-05 17:50 | Christian Grothoff | Target Version | => 0.9.4 |
| 2012-11-05 18:33 | Christian Grothoff | Status | resolved => closed |