-int from_backend(int is_stderr, char *data, int len)
+int from_backend(void *frontend_handle, int is_stderr, char *data, int len)
- error = back->init(cfg.host, cfg.port, &realhost, nodelay);
+ error = back->init(NULL, &backhandle, cfg.host, cfg.port,
+ &realhost, nodelay);
/*
* Create a separate thread to read from stdin. This is
* a total pain, but I can't find another way to do it:
/*
* Create a separate thread to read from stdin. This is
* a total pain, but I can't find another way to do it:
bufchain_consume(&stdout_data, odata.lenwritten);
if (bufchain_size(&stdout_data) > 0)
try_output(0);
bufchain_consume(&stdout_data, odata.lenwritten);
if (bufchain_size(&stdout_data) > 0)
try_output(0);
- if (connopen && back->socket() != NULL) {
- back->unthrottle(bufchain_size(&stdout_data) +
+ if (connopen && back->socket(backhandle) != NULL) {
+ back->unthrottle(backhandle, bufchain_size(&stdout_data) +
bufchain_consume(&stderr_data, edata.lenwritten);
if (bufchain_size(&stderr_data) > 0)
try_output(1);
bufchain_consume(&stderr_data, edata.lenwritten);
if (bufchain_size(&stderr_data) > 0)
try_output(1);
- if (connopen && back->socket() != NULL) {
- back->unthrottle(bufchain_size(&stdout_data) +
+ if (connopen && back->socket(backhandle) != NULL) {
+ back->unthrottle(backhandle, bufchain_size(&stdout_data) +
bufchain_size(&stdout_data) == 0 &&
bufchain_size(&stderr_data) == 0)
break; /* we closed the connection */
}
WSACleanup();
bufchain_size(&stdout_data) == 0 &&
bufchain_size(&stderr_data) == 0)
break; /* we closed the connection */
}
WSACleanup();
if (exitcode < 0) {
fprintf(stderr, "Remote process exit code unavailable\n");
exitcode = 1; /* this is an error condition */
if (exitcode < 0) {
fprintf(stderr, "Remote process exit code unavailable\n");
exitcode = 1; /* this is an error condition */