Fix bug and debug algo naive
This commit is contained in:
parent
349909ff47
commit
bc8973b7e9
1 changed files with 4 additions and 0 deletions
|
@ -165,6 +165,7 @@ void on_tcp_read(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) {
|
||||||
|
|
||||||
// 3. A whole packet has been read, we will find someone to write it
|
// 3. A whole packet has been read, we will find someone to write it
|
||||||
sprintf(url, "udp:write:127.0.0.1:%d", bp->ip.ap.str.port);
|
sprintf(url, "udp:write:127.0.0.1:%d", bp->ip.ap.str.port);
|
||||||
|
printf("wil forwared to: %s\n", url);
|
||||||
to_fdinfo = evt_core_get_from_url (ctx, url);
|
to_fdinfo = evt_core_get_from_url (ctx, url);
|
||||||
if (to_fdinfo == NULL) goto co_error;
|
if (to_fdinfo == NULL) goto co_error;
|
||||||
|
|
||||||
|
@ -228,6 +229,8 @@ void on_udp_read(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) {
|
||||||
mv_buffer_rtow (app_ctx, fdinfo, to_fdinfo, bp);
|
mv_buffer_rtow (app_ctx, fdinfo, to_fdinfo, bp);
|
||||||
on_tcp_write(ctx, to_fdinfo);
|
on_tcp_write(ctx, to_fdinfo);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
co_error:
|
co_error:
|
||||||
perror("Failed to UDP read");
|
perror("Failed to UDP read");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -251,6 +254,7 @@ void on_udp_write (struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) {
|
||||||
mv_buffer_wtor(app_ctx, fdinfo, bp);
|
mv_buffer_wtor(app_ctx, fdinfo, bp);
|
||||||
notify_read(ctx, app_ctx);
|
notify_read(ctx, app_ctx);
|
||||||
|
|
||||||
|
return;
|
||||||
co_error:
|
co_error:
|
||||||
perror("Failed to UDP write");
|
perror("Failed to UDP write");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
Loading…
Reference in a new issue