Remove debug

This commit is contained in:
Quentin 2019-03-05 20:57:58 +01:00
parent 99c06ccc8d
commit a84560c76b

View file

@ -18,7 +18,6 @@ void init_tcp_client(struct donar_client_ctx* ctx, int i) {
while (1) { while (1) {
fdinfo.fd = create_tcp_client("127.0.0.1", "9050"); fdinfo.fd = create_tcp_client("127.0.0.1", "9050");
perror("1");
if (fdinfo.fd < 0) goto failed_socks5; if (fdinfo.fd < 0) goto failed_socks5;
ctx->client_sock[i].fd = fdinfo.fd; ctx->client_sock[i].fd = fdinfo.fd;
ctx->client_sock[i].state = SOCKS5_STATE_NEW; ctx->client_sock[i].state = SOCKS5_STATE_NEW;
@ -26,7 +25,6 @@ void init_tcp_client(struct donar_client_ctx* ctx, int i) {
evt_core_add_fd (&(ctx->evts), &fdinfo); evt_core_add_fd (&(ctx->evts), &fdinfo);
//@FIXME: We suppose that we will be able to do the whole write at once which is wrong //@FIXME: We suppose that we will be able to do the whole write at once which is wrong
err = socks5_handshake_syn(fdinfo.fd); err = socks5_handshake_syn(fdinfo.fd);
perror("2");
if (err) goto failed_socks5; if (err) goto failed_socks5;
break; break;
@ -59,21 +57,17 @@ int configure_tcp_clients(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdin
case SOCKS5_STATE_NEW: case SOCKS5_STATE_NEW:
//@FIXME: We suppose that we will be able to do the whole read at once which is wrong //@FIXME: We suppose that we will be able to do the whole read at once which is wrong
err = socks5_handshake_ack (fdinfo->fd); err = socks5_handshake_ack (fdinfo->fd);
perror("3");
if (err < 0) goto on_socks5_err; if (err < 0) goto on_socks5_err;
//@FIXME: We suppose that we will be able to do the whole write at once which is wrong too //@FIXME: We suppose that we will be able to do the whole write at once which is wrong too
err = socks5_connect_dns(fdinfo->fd, target_host, app_ctx->ports[pos]); err = socks5_connect_dns(fdinfo->fd, target_host, app_ctx->ports[pos]);
perror("4");
if (err < 0) goto on_socks5_err; if (err < 0) goto on_socks5_err;
app_ctx->client_sock[pos].state = SOCKS5_STATE_ACK; app_ctx->client_sock[pos].state = SOCKS5_STATE_ACK;
printf("Socket %d/%d %s:%d is connecting...\n", pos+1, CLIENT_PORT_SIZE, target_host, app_ctx->ports[pos]); printf("Socket %d/%d %s:%d is connecting...\n", pos+1, CLIENT_PORT_SIZE, target_host, app_ctx->ports[pos]);
break; break;
case SOCKS5_STATE_ACK: case SOCKS5_STATE_ACK:
//@FIXME: We suppose that we will be able to do the whole read at once which is wrong too //@FIXME: We suppose that we will be able to do the whole read at once which is wrong too
perror("5");
err = socks5_reply (fdinfo->fd); err = socks5_reply (fdinfo->fd);
fprintf(stderr, "captured err: %d\n", err); fprintf(stderr, "captured err: %d\n", err);
perror("6");
if (err < 0) goto on_socks5_err; if (err < 0) goto on_socks5_err;
app_ctx->client_sock[pos].state = SOCKS5_STATE_RDY; app_ctx->client_sock[pos].state = SOCKS5_STATE_RDY;
int sock1, sock2; int sock1, sock2;