make circ->onionskin a pointer, not a static array. moria2 was using

125000 circuit_t's after it had been up for a few weeks, which translates
to 20+ megs of wasted space.


svn:r5333
This commit is contained in:
Roger Dingledine
2005-10-29 19:13:48 +00:00
parent bf2be9abd7
commit 44b3f3060a
5 changed files with 16 additions and 3 deletions
+2
View File
@@ -428,6 +428,7 @@ assign_to_cpuworker(connection_t *cpuworker, uint8_t question_type,
if (question_type == CPUWORKER_TASK_ONION) {
circ = task;
tor_assert(circ->onionskin);
if (num_cpuworkers_busy == num_cpuworkers) {
debug(LD_OR,"No idle cpuworkers. Queuing.");
@@ -453,6 +454,7 @@ assign_to_cpuworker(connection_t *cpuworker, uint8_t question_type,
connection_write_to_buf((char*)&question_type, 1, cpuworker);
connection_write_to_buf(tag, sizeof(tag), cpuworker);
connection_write_to_buf(circ->onionskin, ONIONSKIN_CHALLENGE_LEN, cpuworker);
tor_free(circ->onionskin);
}
return 0;
}