Beispiel #1
0
static int sk_proxy_write_oob(Socket s, const char *data, int len) {
	Proxy_Socket ps = (Proxy_Socket) s;

	if (ps->state != PROXY_STATE_ACTIVE) {
		bufchain_clear(&ps->pending_output_data);
		bufchain_clear(&ps->pending_oob_output_data);
		bufchain_add(&ps->pending_oob_output_data, data, len);
		return len;
	}
	return sk_write_oob(ps->sub_socket, data, len);
}
Beispiel #2
0
static int sk_proxy_write_oob (Socket s, const void *data, int len)
{
    ProxySocket *ps = FROMFIELD(s, ProxySocket, sockvt);

    if (ps->state != PROXY_STATE_ACTIVE) {
	bufchain_clear(&ps->pending_output_data);
	bufchain_clear(&ps->pending_oob_output_data);
	bufchain_add(&ps->pending_oob_output_data, data, len);
	return len;
    }
    return sk_write_oob(ps->sub_socket, data, len);
}
Beispiel #3
0
static size_t sk_proxy_write_oob (Socket *s, const void *data, size_t len)
{
    ProxySocket *ps = container_of(s, ProxySocket, sock);

    if (ps->state != PROXY_STATE_ACTIVE) {
	bufchain_clear(&ps->pending_output_data);
	bufchain_clear(&ps->pending_oob_output_data);
	bufchain_add(&ps->pending_oob_output_data, data, len);
	return len;
    }
    return sk_write_oob(ps->sub_socket, data, len);
}
Beispiel #4
0
static void sk_handle_close(Socket s)
{
    Handle_Socket ps = (Handle_Socket) s;

    handle_free(ps->send_h);
    handle_free(ps->recv_h);
    CloseHandle(ps->send_H);
    if (ps->recv_H != ps->send_H)
        CloseHandle(ps->recv_H);
    bufchain_clear(&ps->inputdata);
    bufchain_clear(&ps->stderrdata);

    sfree(ps);
}
Beispiel #5
0
void log_free(void *handle)
{
    struct LogContext *ctx = (struct LogContext *)handle;

    logfclose(ctx);
    bufchain_clear(&ctx->queue);
    sfree(ctx);
}
Beispiel #6
0
static void handle_destroy(struct handle *h)
{
    if (h->type == HT_OUTPUT)
	bufchain_clear(&h->u.o.queued_data);
    CloseHandle(h->u.g.ev_from_main);
    CloseHandle(h->u.g.ev_to_main);
    del234(handles_by_evtomain, h);
    sfree(h);
}
Beispiel #7
0
static void sk_localproxy_close (Socket s)
{
    Local_Proxy_Socket ps = (Local_Proxy_Socket) s;

    if (ps->to_cmd >= 0) {
        del234(localproxy_by_tofd, ps);
        uxsel_del(ps->to_cmd);
        close(ps->to_cmd);
    }

    del234(localproxy_by_fromfd, ps);
    uxsel_del(ps->from_cmd);
    close(ps->from_cmd);

    bufchain_clear(&ps->pending_input_data);
    bufchain_clear(&ps->pending_output_data);
    sfree(ps);
}
Beispiel #8
0
static void serial_free(void *handle)
{
    Serial serial = (Serial) handle;

    serial_close(serial);

    bufchain_clear(&serial->output_data);

    sfree(serial);
}
Beispiel #9
0
static void sk_handle_close(Socket s)
{
    Handle_Socket ps = (Handle_Socket) s;

    #ifdef MPEXT
    // WinSCP core uses do_select as signalization of connection up/down
    do_select(ps->plug, INVALID_SOCKET, 0);
    #endif

    handle_free(ps->send_h);
    handle_free(ps->recv_h);
    CloseHandle(ps->send_H);
    if (ps->recv_H != ps->send_H)
        CloseHandle(ps->recv_H);
    bufchain_clear(&ps->inputdata);
    bufchain_clear(&ps->stderrdata);

    sfree(ps);
}
Beispiel #10
0
void log_free(void *handle)
{
    struct LogContext *ctx = (struct LogContext *)handle;

    logfclose(ctx);
    bufchain_clear(&ctx->queue);
    if (ctx->currlogfilename)
        filename_free(ctx->currlogfilename);
    conf_free(ctx->conf);
    sfree(ctx);
}