}
return 0;
}
- printf("Erronious socks.c transmit_ready() callback on step %u with reason %u.\n",
- ih->step, reason );
/* if (reason == 48) register_sender (ih); */
/* GNUNET_break(0); */
return 0;
- } else
- printf("Good socks.c transmit_ready() callback on step %u with reason %u.\n",
- ih->step, GNUNET_SCHEDULER_get_reason () );
+ }
GNUNET_assert (1024 >= size && size > 0);
GNUNET_assert (SOCKS5_step_done > ih->step && ih->step >= 0);
unsigned char * b = ih->outstep[ih->step];
- unsigned char * e = ih->outstep[ih->step++];
+ unsigned char * e = ih->outstep[ih->step+1];
GNUNET_assert (e <= &ih->outbuf[1024]);
unsigned l = e - b;
GNUNET_assert (size >= l && l >= 0);
- memcpy(b, buf, l);
+ memcpy(buf, b, l);
register_reciever (ih, register_reciever_wants(ih));
return l;
}
{
struct GNUNET_TIME_Relative timeout = GNUNET_TIME_UNIT_MINUTES;
- GNUNET_assert (SOCKS5_step_done > ih->step && ih->step >= 0);
+ GNUNET_assert (SOCKS5_step_done > ih->step);
+ GNUNET_assert (ih->step >= 0);
if (0 == ih->step)
timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 3);
unsigned char * b = ih->outstep[ih->step];
unsigned char * e = ih->outstep[ih->step+1];
GNUNET_assert (ih->outbuf <= b && b < e && e < &ih->outbuf[1024]);
- printf("register_sender on step %u for %u bytes.\n", ih->step, (unsigned)(e - b) );
ih->th = GNUNET_CONNECTION_notify_transmit_ready (ih->socks5_connection,
e - b,
timeout,
ih->outstep[SOCKS5_step_cmd] = b;
+ ih->inend = ih->instart = ih->inbuf;
+
return ih;
}